partitionDesc = getPartition(databaseName, tableName, partition.getPartitionName()); pstmt1.setInt(1, partitionDesc.getId()); pstmt1.addBatch(); pstmt1.clearParameters(); pstmt2.setInt(1, partitionDesc.getId()); pstmt2.addBatch(); pstmt2.clearParameters(); pstmt3.setString(2, partition.getPartitionName()); pstmt3.setString(3, partition.getPath()); pstmt3.setLong(4, partition.getNumBytes()); pstmt3.addBatch(); pstmt3.clearParameters(); for (int i = 0; i < partition.getPartitionKeysCount(); i++) { PartitionKeyProto partitionKey = partition.getPartitionKeys(i); pstmt4.setInt(1, tableId); pstmt4.setString(2, partition.getPartitionName()); pstmt4.setInt(3, tableId); pstmt4.setString(4, partitionKey.getColumnName());
CatalogProtos.PartitionDescProto.Builder builder = CatalogProtos.PartitionDescProto.newBuilder(); builder.setPath(hivePartition.getSd().getLocation());
public Builder mergeFrom(org.apache.tajo.catalog.proto.CatalogProtos.PartitionDescProto other) { if (other == org.apache.tajo.catalog.proto.CatalogProtos.PartitionDescProto.getDefaultInstance()) return this; if (other.hasPartitionName()) { bitField0_ |= 0x00000001; partitionName_ = other.partitionName_; if (other.hasPath()) { bitField0_ |= 0x00000004; path_ = other.path_; onChanged(); if (other.hasId()) { setId(other.getId()); this.mergeUnknownFields(other.getUnknownFields()); return this;
org.apache.tajo.catalog.proto.CatalogProtos.PartitionDescProto.Builder subBuilder = null; if (((bitField0_ & 0x00000020) == 0x00000020)) { subBuilder = partitionDesc_.toBuilder();
partitionDesc = getPartition(databaseName, tableName, partition.getPartitionName()); pstmt1.setInt(1, partitionDesc.getId()); pstmt1.addBatch(); pstmt1.clearParameters(); pstmt2.setInt(1, partitionDesc.getId()); pstmt2.addBatch(); pstmt2.clearParameters(); pstmt3.setString(2, partition.getPartitionName()); pstmt3.setString(3, partition.getPath()); pstmt3.addBatch(); pstmt3.clearParameters(); for (int i = 0; i < partition.getPartitionKeysCount(); i++) { PartitionKeyProto partitionKey = partition.getPartitionKeys(i); pstmt4.setInt(1, tableId); pstmt4.setString(2, partition.getPartitionName()); pstmt4.setInt(3, tableId); pstmt4.setString(4, partitionKey.getColumnName());
existingPartitionPath = new Path(existingPartition.getPath()); existingPartitionNames.add(existingPartition.getPartitionName()); if (!fs.exists(existingPartitionPath) && LOG.isDebugEnabled()) { LOG.debug("Partitions missing from Filesystem:" + existingPartition.getPartitionName()); if (!existingPartitionNames.contains(targetPartition.getPartitionName())) { if (LOG.isDebugEnabled()) { LOG.debug("Partitions not in CatalogStore:" + targetPartition.getPartitionName()); LOG.debug("Repair: Added partition to CatalogStore " + tableName + ":" + targetPartition.getPartitionName());
existingPartitionPath = new Path(existingPartition.getPath()); existingPartitionNames.add(existingPartition.getPartitionName()); if (!fs.exists(existingPartitionPath) && LOG.isDebugEnabled()) { LOG.debug("Partitions missing from Filesystem:" + existingPartition.getPartitionName()); if (!existingPartitionNames.contains(targetPartition.getPartitionName())) { if (LOG.isDebugEnabled()) { LOG.debug("Partitions not in CatalogStore:" + targetPartition.getPartitionName()); LOG.debug("Repair: Added partition to CatalogStore " + tableName + ":" + targetPartition.getPartitionName());
PartitionDescProto.Builder builder = PartitionDescProto.newBuilder();
org.apache.tajo.catalog.proto.CatalogProtos.PartitionDescProto.Builder subBuilder = null; if (((bitField0_ & 0x00000002) == 0x00000002)) { subBuilder = partition_.toBuilder();
break; case ADD_PARTITION: partitionName = alterTableDescProto.getPartitionDesc().getPartitionName(); partitionDesc = getPartition(databaseName, tableName, partitionName); if(partitionDesc != null) { break; case DROP_PARTITION: partitionName = alterTableDescProto.getPartitionDesc().getPartitionName(); partitionDesc = getPartition(databaseName, tableName, partitionName); if(partitionDesc == null) {
break; case ADD_PARTITION: partitionName = alterTableDescProto.getPartitionDesc().getPartitionName(); try { break; case DROP_PARTITION: partitionName = alterTableDescProto.getPartitionDesc().getPartitionName(); partitionDesc = getPartition(databaseName, tableName, partitionName); if (partitionDesc == null) { throw new UndefinedPartitionException(partitionName); dropPartition(partitionDesc.getId()); break; case SET_PROPERTY:
break; case ADD_PARTITION: partitionName = alterTableDescProto.getPartitionDesc().getPartitionName(); try { break; case DROP_PARTITION: partitionName = alterTableDescProto.getPartitionDesc().getPartitionName(); partitionDesc = getPartition(databaseName, tableName, partitionName); if (partitionDesc == null) { throw new UndefinedPartitionException(partitionName); dropPartition(partitionDesc.getId()); break; case SET_PROPERTY:
org.apache.tajo.catalog.proto.CatalogProtos.PartitionDescProto.Builder subBuilder = null; if (((bitField0_ & 0x00000002) == 0x00000002)) { subBuilder = partition_.toBuilder();
assertTrue(partitionDescProto.getPath().indexOf(tableName + "/" + partitionName.toString()) > 0); partitionPath = new Path(partitionDescProto.getPath()); ContentSummary cs = fs.getContentSummary(partitionPath); assertEquals(cs.getLength(), partitionDescProto.getNumBytes()); rowCount++;
if (hasPartitionDesc()) { result = result && getPartitionDesc() .equals(other.getPartitionDesc());
if (!getPartitions(i).isInitialized()) { memoizedIsInitialized = 0; return false;
pstmt1.setString(2, partition.getPartitionName()); pstmt1.setString(3, partition.getPath()); pstmt1.setLong(4, partition.getNumBytes()); pstmt1.executeUpdate(); for (int i = 0; i < partition.getPartitionKeysCount(); i++) { PartitionKeyProto partitionKey = partition.getPartitionKeys(i); pstmt2.setInt(1, tableId); pstmt2.setString(2, partition.getPartitionName()); pstmt2.setInt(3, tableId); pstmt2.setString(4, partitionKey.getColumnName());
if (!getPartitions(i).isInitialized()) { memoizedIsInitialized = 0; return false;
assertTrue(eachPartition.getNumBytes() > 0L);
client = clientPool.getClient(); for (CatalogProtos.PartitionDescProto partitionDescProto : partitions) { existingPartition = getPartition(databaseName, tableName, partitionDescProto.getPartitionName()); for(CatalogProtos.PartitionKeyProto keyProto : partitionDescProto.getPartitionKeysList()) { values.add(keyProto.getPartitionValue()); sd.setLocation(partitionDescProto.getPath()); partition.setSd(sd);