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

Support reading from/writing to Iceberg table after partition field dropped #8730

Merged

Conversation

findepi
Copy link
Member

@findepi findepi commented Jul 30, 2021

Before the change, Trino was not able to read from an Iceberg v1 table
in which a partitioning field was removed via Spark. In v1 tables,
removed partitioning fields are replaced with void transformation to
keep field ordinal numbers unchanged, and void transformation was not
supported.

fixes #8284

@findepi
Copy link
Member Author

findepi commented Jul 30, 2021

cc @alexjo2144 @homar

row("a", "varchar"),
row("b", "varchar"),
// A/B is now partitioning column in the first partitioning spec, and non-partitioning in new one
// TODO (https://github.com/trinodb/trino/issues/8729): $partitions table (as every other table) cannot have duplicate column names
Copy link
Member Author

Choose a reason for hiding this comment

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

Copy link
Member

@hashhar hashhar left a comment

Choose a reason for hiding this comment

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

LGTM % @alexjo2144's comments.

Before the change, Trino was not able to read from an Iceberg v1 table
in which a partitioning field was removed via Spark. In v1 tables,
removed partitioning fields are replaced with `void` transformation to
keep field ordinal numbers unchanged, and `void` transformation was not
supported.
In v1 tables, removed partitioning fields are replaced with `void`
transformation to keep field ordinal numbers unchanged, and `void`
transformation was not supported when writing. This commit adds support
for writing with `void` transformation and, implicitly, for creating
tables with such transformation.
@findepi findepi force-pushed the findepi/read-iceberg-dropped-partition branch from e2dd784 to 4f62c46 Compare August 2, 2021 07:54
@findepi findepi changed the title Fix reading from Iceberg table after partition field dropped Support reading from/writing to Iceberg table after partition field dropped Aug 2, 2021
@findepi findepi merged commit 4bb71c5 into trinodb:master Aug 2, 2021
@findepi findepi deleted the findepi/read-iceberg-dropped-partition branch August 2, 2021 09:14
@findepi findepi added this to the 361 milestone Aug 2, 2021
@findepi findepi mentioned this pull request Aug 2, 2021
10 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

Trino cannot read an Iceberg table that has dropped a partition field
4 participants