difin commented on code in PR #5248:
URL: https://github.com/apache/hive/pull/5248#discussion_r1649452468
##########
ql/src/java/org/apache/hadoop/hive/ql/metadata/HiveStorageHandler.java:
##########
@@ -741,8 +742,14 @@ default List<String> showPartitions(DDLOperationContext
context,
throw new UnsupportedOperationException("Storage handler does not support
show partitions command");
}
- default void validatePartSpec(org.apache.hadoop.hive.ql.metadata.Table
hmsTable, Map<String, String> partitionSpec)
- throws SemanticException {
+ /**
+ * Validates that the provided partitionSpec is a valid according to the
current table partitioning.
+ * @param hmsTable {@link org.apache.hadoop.hive.ql.metadata.Table} table
metadata stored in Hive Metastore
+ * @param partitionSpec Map of Strings {@link java.util.Map} partition
specification
+ * @param conf Configuration
+ */
+ default void validatePartSpec(org.apache.hadoop.hive.ql.metadata.Table
hmsTable, Map<String, String> partitionSpec,
Review Comment:
Sounds good, re-implemented with the defaults.
##########
iceberg/iceberg-handler/src/main/java/org/apache/iceberg/mr/hive/HiveIcebergStorageHandler.java:
##########
@@ -1923,13 +1926,22 @@ public Optional<ErrorMsg> isEligibleForCompaction(
public List<Partition>
getPartitions(org.apache.hadoop.hive.ql.metadata.Table table,
Map<String, String> partitionSpec) throws SemanticException {
return getPartitionNames(table, partitionSpec).stream()
- .map(partName -> new DummyPartition(table, partName,
partitionSpec)).collect(Collectors.toList());
+ .map(partName -> {
+ Map<String, String> partSpecMap = Maps.newLinkedHashMap();
+ Warehouse.makeSpecFromName(partSpecMap, new Path(partName), null);
+ return new DummyPartition(table, partName, partSpecMap);
+ }).collect(Collectors.toList());
}
@Override
public Partition getPartition(org.apache.hadoop.hive.ql.metadata.Table table,
+ Map<String, String> partitionSpec, Configuration config) throws
SemanticException {
Review Comment:
not relevant anymore, passing RewritePolicy now as you suggested.
##########
iceberg/iceberg-handler/src/main/java/org/apache/iceberg/mr/hive/HiveIcebergStorageHandler.java:
##########
@@ -1811,16 +1808,28 @@ private List<String> getPartitions(DDLOperationContext
context, Configuration jo
String[] row =
fetcher.convert(currSerDe.deserialize(value),
currSerDe.getObjectInspector())
.toString().split("\t");
- parts.add(HiveTableUtil.getParseData(row[PART_IDX], row[SPEC_IDX],
mapper, tbl.spec().specId()));
+ parts.add(HiveTableUtil.getParseData(row[IcebergTableUtil.PART_IDX],
row[IcebergTableUtil.SPEC_IDX],
+ mapper, tbl.spec().specId()));
}
}
Collections.sort(parts);
return parts;
}
@Override
- public void validatePartSpec(org.apache.hadoop.hive.ql.metadata.Table
hmsTable, Map<String, String> partitionSpec)
- throws SemanticException {
+ public void validatePartSpec(org.apache.hadoop.hive.ql.metadata.Table
hmsTable, Map<String, String> partitionSpec,
+ Configuration config) throws SemanticException {
Review Comment:
not relevant anymore, passing RewritePolicy now as you suggested.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]