deniskuzZ commented on code in PR #3849:
URL: https://github.com/apache/hive/pull/3849#discussion_r1060552941
##########
iceberg/iceberg-handler/src/main/java/org/apache/iceberg/mr/hive/HiveIcebergStorageHandler.java:
##########
@@ -683,6 +699,86 @@ public List<FieldSchema>
sortColumns(org.apache.hadoop.hive.ql.metadata.Table hm
s.transform().toString(), s.direction().name(),
s.nullOrder().name()))).collect(Collectors.toList());
}
+ @Override
+ public List<String> getIcebergPartitions(Configuration config,
+ org.apache.hadoop.hive.ql.metadata.Table partitionMetadataTable) {
+ Path path = new
Path(partitionMetadataTable.getParameters().get("metadata_location"));
+ List<String> parts = new ArrayList<String>();
+ JobConf job = getJobConfForPartitionTable(config, path,
partitionMetadataTable);
+
+ try {
+ Class<? extends InputFormat> formatter =
partitionMetadataTable.getInputFormatClass();
+ InputFormat inputFormat =
FetchOperator.getInputFormatFromCache(formatter, job);
+ InputSplit[] splits = inputFormat.getSplits(job, 1);
+ try (RecordReader<WritableComparable, Writable> reader =
inputFormat.getRecordReader(splits[0], job,
+ Reporter.NULL)) {
+ parts = getParts(job, reader, partitionMetadataTable);
+ }
+ return parts;
+ } catch (Exception e) {
+ LOG.warn("Warn:", e);
Review Comment:
why do we need extra "Warn" ?
--
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]