New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
HIVE-26628: Iceberg table is created when running explain ctas command #3724
HIVE-26628: Iceberg table is created when running explain ctas command #3724
Conversation
aa4fd3a
to
aa10e9c
Compare
74af372
to
23290a9
Compare
ba5be03
to
0c33df8
Compare
0c33df8
to
3074490
Compare
Kudos, SonarCloud Quality Gate passed! |
@@ -58,6 +69,11 @@ public void afterExecution(QueryLifeTimeHookContext ctx, boolean hasError) { | |||
} | |||
|
|||
private void checkAndRollbackIcebergCTAS(QueryLifeTimeHookContext ctx) { | |||
if (!(HiveOperation.CREATETABLE_AS_SELECT.getOperationName().equals( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hi, are we actually creating and dropping the table in case of Iceberg EXPLAIN CTAS
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
hive/iceberg/iceberg-handler/src/main/java/org/apache/iceberg/mr/hive/HiveIcebergSerDe.java
Line 129 in 63b6134
createTableForCTAS(configuration, serDeProperties); |
Later the Iceberg Table
object is also required when it's properties are added to the job configs when augmenting the FileSinkOperator plan
public void augmentPlan() { |
hive/iceberg/iceberg-handler/src/main/java/org/apache/iceberg/mr/hive/HiveIcebergStorageHandler.java
Line 796 in 63b6134
Table table = IcebergTableUtil.getTable(configuration, props); |
The goal of this patch is to clean up this table after executing the statement.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
question
not merging, issue is fixed by #3745 |
What changes were proposed in this pull request?
Drop Iceberg table after compiling an explain create table as a select command if the table did not exist before executing the statement.
Why are the changes needed?
Explain command should not execute any part of the command.
Does this PR introduce any user-facing change?
No.
How was this patch tested?