deniskuzZ commented on code in PR #5223:
URL: https://github.com/apache/hive/pull/5223#discussion_r2298148830


##########
iceberg/iceberg-handler/src/main/java/org/apache/iceberg/mr/hive/HiveIcebergMetaHook.java:
##########
@@ -1223,7 +1225,25 @@ public void 
preDropPartitions(org.apache.hadoop.hive.metastore.api.Table hmsTabl
     } catch (IOException e) {
       throw new MetaException(String.format("Error while fetching the 
partitions due to: %s", e));
     }
-    context.putToProperties(ThriftHiveMetaStoreClient.SKIP_DROP_PARTITION, 
"true");
+    context.putToProperties(BaseMetaStoreClient.SKIP_DROP_PARTITION, "true");
+  }
+
+  @Override
+  public void preDropPartitions(org.apache.hadoop.hive.metastore.api.Table 
hmsTable,
+                                EnvironmentContext context,
+                                RequestPartsSpec partsSpec) throws 
MetaException {
+    if (partsSpec.isSetExprs()) {
+      List<DropPartitionsExpr> exprs = partsSpec.getExprs();
+      List<org.apache.commons.lang3.tuple.Pair<Integer, byte[]>> partExprs = 
Lists.newArrayList();
+      for (DropPartitionsExpr expr : exprs) {
+        partExprs.add(
+            org.apache.commons.lang3.tuple.Pair.of(expr.getPartArchiveLevel(), 
expr.getExpr()));
+      }
+      preDropPartitions(hmsTable, context, partExprs);
+    } else if (partsSpec.isSetNames()) {
+      preTruncateTable(hmsTable, context, partsSpec.getNames());
+      context.putToProperties(BaseMetaStoreClient.SKIP_DROP_PARTITION, "true");

Review Comment:
   i think it's safe to make it private since MetaHook is internal thing and we 
changed the client to use a new hook method



-- 
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: gitbox-unsubscr...@hive.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscr...@hive.apache.org
For additional commands, e-mail: gitbox-h...@hive.apache.org

Reply via email to