pstmt2.setInt(3, tableId); pstmt2.setString(4, partitionKey.getColumnName()); pstmt2.setString(5, partitionKey.getPartitionValue()); pstmt2.addBatch(); pstmt2.clearParameters();
pstmt2.setInt(3, tableId); pstmt2.setString(4, partitionKey.getColumnName()); pstmt2.setString(5, partitionKey.getPartitionValue()); pstmt2.addBatch(); pstmt2.clearParameters();
@java.lang.Override public int hashCode() { if (memoizedHashCode != 0) { return memoizedHashCode; } int hash = 41; hash = (19 * hash) + getDescriptorForType().hashCode(); if (hasColumnName()) { hash = (37 * hash) + COLUMNNAME_FIELD_NUMBER; hash = (53 * hash) + getColumnName().hashCode(); } if (hasParentColumnName()) { hash = (37 * hash) + PARENTCOLUMNNAME_FIELD_NUMBER; hash = (53 * hash) + getParentColumnName().hashCode(); } if (hasPartitionValue()) { hash = (37 * hash) + PARTITIONVALUE_FIELD_NUMBER; hash = (53 * hash) + getPartitionValue().hashCode(); } hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; }
pstmt4.setInt(3, tableId); pstmt4.setString(4, partitionKey.getColumnName()); pstmt4.setString(5, partitionKey.getPartitionValue());
pstmt4.setInt(3, tableId); pstmt4.setString(4, partitionKey.getColumnName()); pstmt4.setString(5, partitionKey.getPartitionValue());
values.add(keyProto.getPartitionValue());
private void addPartition(String databaseName, String tableName, CatalogProtos.PartitionDescProto partitionDescProto) { HiveCatalogStoreClientPool.HiveCatalogStoreClient client = null; try { client = clientPool.getClient(); Partition partition = new Partition(); partition.setDbName(databaseName); partition.setTableName(tableName); Map<String, String> params = new HashMap<>(); params.put(StatsSetupConst.TOTAL_SIZE, Long.toString(partitionDescProto.getNumBytes())); partition.setParameters(params); List<String> values = Lists.newArrayList(); for(CatalogProtos.PartitionKeyProto keyProto : partitionDescProto.getPartitionKeysList()) { values.add(keyProto.getPartitionValue()); } partition.setValues(values); Table table = client.getHiveClient().getTable(databaseName, tableName); StorageDescriptor sd = table.getSd(); sd.setLocation(partitionDescProto.getPath()); partition.setSd(sd); client.getHiveClient().add_partition(partition); } catch (Exception e) { throw new TajoInternalError(e); } finally { if (client != null) { client.release(); } } }
@java.lang.Override public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } if (!(obj instanceof org.apache.tajo.catalog.proto.CatalogProtos.PartitionKeyProto)) { return super.equals(obj); } org.apache.tajo.catalog.proto.CatalogProtos.PartitionKeyProto other = (org.apache.tajo.catalog.proto.CatalogProtos.PartitionKeyProto) obj; boolean result = true; result = result && (hasColumnName() == other.hasColumnName()); if (hasColumnName()) { result = result && getColumnName() .equals(other.getColumnName()); } result = result && (hasParentColumnName() == other.hasParentColumnName()); if (hasParentColumnName()) { result = result && getParentColumnName() .equals(other.getParentColumnName()); } result = result && (hasPartitionValue() == other.hasPartitionValue()); if (hasPartitionValue()) { result = result && getPartitionValue() .equals(other.getPartitionValue()); } result = result && getUnknownFields().equals(other.getUnknownFields()); return result; }
assertEquals(partitions.get(0).getPartitionName(), "col3=1/col4=2"); assertEquals(partitions.get(0).getPartitionKeysList().get(0).getColumnName(), "col3"); assertEquals(partitions.get(0).getPartitionKeysList().get(0).getPartitionValue(), "1"); assertEquals(partitions.get(0).getPartitionKeysList().get(1).getColumnName(), "col4"); assertEquals(partitions.get(0).getPartitionKeysList().get(1).getPartitionValue(), "2");
private void dropPartition(String databaseName, String tableName, CatalogProtos.PartitionDescProto partitionDescProto) { HiveCatalogStoreClientPool.HiveCatalogStoreClient client = null; try { client = clientPool.getClient(); List<String> values = Lists.newArrayList(); for(CatalogProtos.PartitionKeyProto keyProto : partitionDescProto.getPartitionKeysList()) { values.add(keyProto.getPartitionValue()); } client.getHiveClient().dropPartition(databaseName, tableName, values, true); } catch (Exception e) { throw new TajoInternalError(e); } finally { if (client != null) { client.release(); } } }
/** * <code>required string partitionValue = 3;</code> */ public Builder clearPartitionValue() { bitField0_ = (bitField0_ & ~0x00000004); partitionValue_ = getDefaultInstance().getPartitionValue(); onChanged(); return this; } /**