Fix OPTIMIZE failing with uppercase Iceberg column names#28888
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 |
61d60cd to
1aca866
Compare
|
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 |
1aca866 to
989dfa3
Compare
|
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 |
|
@kinolaev Thanks for detecting this bug quickly. Have you already submitted CLA? |
|
Yes, around 16:30 utc |
989dfa3 to
c28b14b
Compare
|
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 |
|
IMO, update the Instead can we consider update |
c28b14b to
59a99dc
Compare
|
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 |
IcebergMetadata.getColumnHandles() stored data column handles with original-case keys from the Iceberg schema, but ColumnMetadata lowercases all names in its constructor. When getColumnHandlesForOptimize() (introduced in 480) looked up columns by their ColumnMetadata names, the case-insensitive lookup failed for tables with uppercase column names. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Signed-off-by: Sergei Nikolaev <kinolaev@gmail.com>
59a99dc to
ac34cb6
Compare
|
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 |
|
Perhaps, the default implementation of SPI has the same problem: # spark
CREATE TABLE test (X int) USING delta LOCATION 's3://test-bucket/test';
INSERT INTO test VALUES 1;
INSERT INTO test VALUES 2;
# trino
ALTER TABLE test EXECUTE optimize;
No handle found for column 'x' in table execute |
@ebyhr can you please file an issue? |
Description
IcebergMetadata.getColumnHandles() stored data column handles with original-case keys from the Iceberg schema, but ColumnMetadata lowercases all names in its constructor. When getColumnHandlesForOptimize() (introduced in 480) looked up columns by their ColumnMetadata names, the case-insensitive lookup failed for tables with uppercase column names.
The fix lowercases the key in getColumnHandles() to match the convention already enforced by MetadataManager at the engine boundary, and to match what ColumnMetadata.getName() returns.
Release notes