aturoczy commented on code in PR #4346:
URL: https://github.com/apache/hive/pull/4346#discussion_r1200078734


##########
iceberg/iceberg-handler/src/main/java/org/apache/iceberg/mr/hive/HiveIcebergStorageHandler.java:
##########
@@ -1391,4 +1403,64 @@ Boolean hasAppendsOnly(Iterable<Snapshot> snapshots, 
SnapshotContext since) {
 
     return null;
   }
+
+  @Override
+  public List<String> showPartitions(DDLOperationContext context, 
org.apache.hadoop.hive.ql.metadata.Table hmstbl) {
+    Configuration confs = context.getConf();
+    Path path = new Path(hmstbl.getParameters().get("metadata_location"));
+    List<String> parts = Lists.newArrayList();
+    JobConf job = HiveTableUtil.getJobConf(confs, path, hmstbl);
+    Class<? extends InputFormat> formatter = hmstbl.getInputFormatClass();
+
+    try {
+      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(context, job, reader, hmstbl);
+      }
+      return parts;
+    } catch (Exception e) {
+      LOG.warn("Warn:", e);

Review Comment:
   After warn needs a space, also it would be nice if it would describe. Which 
exception would you like to catch, to catch everything is by default not the 
best practice. (OK just for warning could be fine, but it is more elegant to 
provide practical messages) 



-- 
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]

Reply via email to