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 #3745

Merged

Conversation

kasakrisz
Copy link
Contributor

@kasakrisz kasakrisz commented Nov 9, 2022

What changes were proposed in this pull request?

  • Pass a flag to jobConfig to indicate if we are in an explain command and do not create Iceberg tables in case of explain ctas.
  • Add the newly created table path to the ctas property and use this value when overlaying jobProperties in IcebergStorageHandler

Why are the changes needed?

Explain command should not make changes in the catalog.

Does this PR introduce any user-facing change?

No.

How was this patch tested?

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

@kasakrisz kasakrisz force-pushed the HIVE-26628-master-explain-iceberg-ctas-v3-expl branch from f328f1c to 33a1ec6 Compare November 15, 2022 07:59
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.

LGTM +1, pending tests

@sonarcloud
Copy link

sonarcloud bot commented Nov 15, 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 2 Code Smells

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

Comment on lines +271 to +288
Table Parameters:
COLUMN_STATS_ACCURATE {\"BASIC_STATS\":\"true\",\"COLUMN_STATS\":{\"a\":\"true\",\"b\":\"true\",\"c\":\"true\"}}
EXTERNAL TRUE
bucketing_version -1
engine.hive.enabled true
iceberg.orc.files.only true
metadata_location hdfs://### HDFS PATH ###
numFiles 2
numRows 2
previous_metadata_location hdfs://### HDFS PATH ###
serialization.format 1
storage_handler org.apache.iceberg.mr.hive.HiveIcebergStorageHandler
table_type ICEBERG
totalSize 812
#### A masked pattern was here ####
uuid #Masked#
write.format.default orc

Copy link
Member

Choose a reason for hiding this comment

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

@kasakrisz / @deniskuzZ The table created was a v2 table but here the property is missing & we need to set merge-on-read also for any v2 table, those properties also seems missing. Can you folks check

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@ayushtkn
Thanks for the notice.
I try to fix this in a follow-up patch focusing on the way ctas plan is generated and the statement is executed.
https://issues.apache.org/jira/browse/HIVE-26771

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants