kasakrisz commented on code in PR #3724:
URL: https://github.com/apache/hive/pull/3724#discussion_r1016148487
##########
iceberg/iceberg-handler/src/main/java/org/apache/iceberg/mr/hive/HiveIcebergQueryLifeTimeHook.java:
##########
@@ -58,6 +69,11 @@ public void afterExecution(QueryLifeTimeHookContext ctx,
boolean hasError) {
}
private void checkAndRollbackIcebergCTAS(QueryLifeTimeHookContext ctx) {
+ if (!(HiveOperation.CREATETABLE_AS_SELECT.getOperationName().equals(
Review Comment:
Yes, that is the case.
Unfortunately the table is created without this patch too which is a side
affect of executing an explain statement.
The create is called from `HiveIcebergSerDe` init and this happening at
compile time during FileSinkDesc generation.
https://github.com/apache/hive/blob/63b6134b97036d6d31924ad0ec323fca2016dace/iceberg/iceberg-handler/src/main/java/org/apache/iceberg/mr/hive/HiveIcebergSerDe.java#L129
Later the Iceberg `Table` object is also required when it's properties are
added to the job configs when augmenting the FileSinkOperator plan
https://github.com/apache/hive/blob/63b6134b97036d6d31924ad0ec323fca2016dace/ql/src/java/org/apache/hadoop/hive/ql/exec/FileSinkOperator.java#L1611
https://github.com/apache/hive/blob/63b6134b97036d6d31924ad0ec323fca2016dace/iceberg/iceberg-handler/src/main/java/org/apache/iceberg/mr/hive/HiveIcebergStorageHandler.java#L796
The goal of this patch is to clean up this table after executing the
statement.
--
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]