-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
Fix Hive-to-Iceberg table migration errors caused by special characters. #25106
base: master
Are you sure you want to change the base?
Conversation
Thank you for your pull request and welcome to the Trino community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. Continue to work with us on the review and improvements in this PR, and submit the signed CLA to cla@trino.io. Photos, scans, or digitally-signed PDF files are all suitable. Processing may take a few days. The CLA needs to be on file before we merge your changes. For more information, see https://github.com/trinodb/cla |
Thank you for your pull request and welcome to the Trino community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. Continue to work with us on the review and improvements in this PR, and submit the signed CLA to cla@trino.io. Photos, scans, or digitally-signed PDF files are all suitable. Processing may take a few days. The CLA needs to be on file before we merge your changes. For more information, see https://github.com/trinodb/cla |
@@ -294,20 +294,22 @@ public void testMigratePartitionedTable() | |||
String hiveTableName = "hive.tpch." + tableName; | |||
String icebergTableName = "iceberg.tpch." + tableName; | |||
|
|||
assertUpdate("CREATE TABLE " + hiveTableName + " WITH (partitioned_by = ARRAY['part_col']) AS SELECT 1 id, 'part1' part_col", 1); | |||
assertUpdate("CREATE TABLE " + hiveTableName + " " + |
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.
Could you extract into a separate test case? e.g. testMigratePartitionedTableWithSpecialCharacter
Also, could add a similar test to TestIcebergAddFilesProcedure
?
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.
I’ve implemented the suggested changes. Please review again.
2. add testAddFilesSpecialCharPartitionColumnDefinitions
Thank you for your pull request and welcome to the Trino community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. Continue to work with us on the review and improvements in this PR, and submit the signed CLA to cla@trino.io. Photos, scans, or digitally-signed PDF files are all suitable. Processing may take a few days. The CLA needs to be on file before we merge your changes. For more information, see https://github.com/trinodb/cla |
@twowind Please ping me once your CLA is registered. |
Description
This PR fixes a bug where
iceberg.system.migrate
fails when a Hive table's partition key contains special characters (e.g.,@
). The failure happens because the migration process incorrectly applies Iceberg’s partition parsing rules to Hive tables, leading to anInvalid partition field declaration
error.Error Example:
When running:
If the Hive table has a partition key with special characters, the migration fails with: