Skip to content
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

Conversation

kasakrisz
Copy link
Contributor

@kasakrisz kasakrisz commented Nov 2, 2022

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?

mvn test -Dtest=TestIcebergCliDriver -Dqfile=ctas_iceberg_partitioned_orc.q -pl itests/qtest-iceberg -Piceberg -Pitests -Drat.skip

@kasakrisz kasakrisz force-pushed the HIVE-26628-master-explain-iceberg-ctas-v4-drop branch from 74af372 to 23290a9 Compare November 3, 2022 08:06
@kasakrisz kasakrisz self-assigned this Nov 3, 2022
@kasakrisz kasakrisz force-pushed the HIVE-26628-master-explain-iceberg-ctas-v4-drop branch 2 times, most recently from ba5be03 to 0c33df8 Compare November 3, 2022 13:36
@kasakrisz kasakrisz force-pushed the HIVE-26628-master-explain-iceberg-ctas-v4-drop branch from 0c33df8 to 3074490 Compare November 3, 2022 13:38
@sonarcloud
Copy link

sonarcloud bot commented Nov 4, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

@@ -58,6 +69,11 @@ public void afterExecution(QueryLifeTimeHookContext ctx, boolean hasError) {
}

private void checkAndRollbackIcebergCTAS(QueryLifeTimeHookContext ctx) {
if (!(HiveOperation.CREATETABLE_AS_SELECT.getOperationName().equals(
Copy link
Member

@deniskuzZ deniskuzZ Nov 7, 2022

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?

Copy link
Contributor Author

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.

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


Table table = IcebergTableUtil.getTable(configuration, props);

The goal of this patch is to clean up this table after executing the statement.

Copy link
Member

@deniskuzZ deniskuzZ left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

question

@kasakrisz
Copy link
Contributor Author

kasakrisz commented Nov 15, 2022

not merging, issue is fixed by #3745

@kasakrisz kasakrisz closed this Nov 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants