Skip to content

Allow updating reader_version and writer_version properties for Delta tables#16165

Merged
ebyhr merged 4 commits intotrinodb:masterfrom
krvikash:support-readVersion-and-writeVersion-in-delta
Feb 23, 2023
Merged

Allow updating reader_version and writer_version properties for Delta tables#16165
ebyhr merged 4 commits intotrinodb:masterfrom
krvikash:support-readVersion-and-writeVersion-in-delta

Conversation

@krvikash
Copy link
Copy Markdown
Contributor

@krvikash krvikash commented Feb 18, 2023

Description

Fixes #15932

Release notes

(X) Release notes are required, with the following suggested text:

# Delta Lake
* Allow updating `reader_version` and `writer_version` table properties. ({issue}`16165`)

@cla-bot cla-bot bot added the cla-signed label Feb 18, 2023
@krvikash krvikash changed the title Support read version and write version in delta Allow setting reader_version and writer_version properties with CREATE TABLE and ALTER TABLE in Delta table Feb 18, 2023
@krvikash krvikash changed the title Allow setting reader_version and writer_version properties with CREATE TABLE and ALTER TABLE in Delta table Allow setting reader_version and writer_version properties in Delta table Feb 18, 2023
@krvikash krvikash added the delta-lake Delta Lake connector label Feb 18, 2023
@krvikash krvikash force-pushed the support-readVersion-and-writeVersion-in-delta branch from d128e82 to 8f7c145 Compare February 18, 2023 09:21
@krvikash krvikash marked this pull request as ready for review February 18, 2023 09:22
@krvikash krvikash force-pushed the support-readVersion-and-writeVersion-in-delta branch from 8f7c145 to 1a0ad16 Compare February 18, 2023 12:47
@krvikash krvikash changed the title Allow setting reader_version and writer_version properties in Delta table Allow updating reader_version and writer_version properties for Delta tables Feb 20, 2023
Copy link
Copy Markdown
Member

@homar homar left a comment

Choose a reason for hiding this comment

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

As @findinpath wrote, I think some tests could be splitted apart from that looks very good to me

@krvikash krvikash force-pushed the support-readVersion-and-writeVersion-in-delta branch from 1a0ad16 to 6206c66 Compare February 20, 2023 17:41
@krvikash
Copy link
Copy Markdown
Contributor Author

Thanks @findinpath | @homar for the review. Addressed review comments.

@ebyhr
Copy link
Copy Markdown
Member

ebyhr commented Feb 21, 2023

@krvikash Could you rebase to resolve conflicts?

@krvikash krvikash force-pushed the support-readVersion-and-writeVersion-in-delta branch from 6206c66 to 69f1bc2 Compare February 21, 2023 05:41
@krvikash
Copy link
Copy Markdown
Contributor Author

Rebased with master and resolve conflicts.

@krvikash krvikash force-pushed the support-readVersion-and-writeVersion-in-delta branch 3 times, most recently from 529f058 to 18570c8 Compare February 21, 2023 15:07
@krvikash
Copy link
Copy Markdown
Contributor Author

Thanks, @ebyhr for the review. I have addressed the comments.

Copy link
Copy Markdown
Member

@alexjo2144 alexjo2144 left a comment

Choose a reason for hiding this comment

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

Overall, looks pretty good. Couple small things and behavior questions

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I don't think we should do this. If the user sets the writer version to 2, when they do a show create table it should say 2.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

If the user sets the writer version to less than 4 and cdf is enabled then it will throw an exception.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Got it, I see what you're doing now 👍

Copy link
Copy Markdown
Member

@alexjo2144 alexjo2144 Feb 21, 2023

Choose a reason for hiding this comment

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

Though, if some has set writer version to 5 explicitly, this will set it to 4. I think you only want to do this if writerVersion hasn't been set explicitly

I know you can't set it to 5 yet, but you will be able to soon.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I think you only want to do this if writerVersion hasn't been set explicitly

Addressed.

Comment on lines 289 to 291
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This could be follow-up in a separate PR, but I think we want to remove these constants and add default reader/writer versions as config properties in DeltaLakeConfig.

If you're going to enable CDF on every table you make, you'd want to have v4 be the default.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Follow up PR: #16208

@krvikash krvikash force-pushed the support-readVersion-and-writeVersion-in-delta branch from 18570c8 to e210fa3 Compare February 21, 2023 17:57
@krvikash
Copy link
Copy Markdown
Contributor Author

Thanks, @alexjo2144 for the review. Addressed comments.

Copy link
Copy Markdown
Member

@alexjo2144 alexjo2144 left a comment

Choose a reason for hiding this comment

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

@krvikash krvikash force-pushed the support-readVersion-and-writeVersion-in-delta branch 2 times, most recently from 3622e94 to ce40c8a Compare February 21, 2023 20:57
@krvikash krvikash force-pushed the support-readVersion-and-writeVersion-in-delta branch 2 times, most recently from 2a9161f to be93e8c Compare February 22, 2023 06:26
@krvikash
Copy link
Copy Markdown
Contributor Author

Addressed comments.

@krvikash krvikash force-pushed the support-readVersion-and-writeVersion-in-delta branch from be93e8c to 853b8e6 Compare February 22, 2023 06:47
@ebyhr
Copy link
Copy Markdown
Member

ebyhr commented Feb 22, 2023

Could you fix error-prone failure?

Error:  /home/runner/work/trino/trino/plugin/trino-delta-lake/src/main/java/io/trino/plugin/deltalake/DeltaLakeMetadata.java:[1228,20] [UnusedVariable] The parameter 'nodeVersion' is never read.
Error:      (see https://errorprone.info/bugpattern/UnusedVariable)
Error:    Did you mean 'session,'?
Error:  /home/runner/work/trino/trino/plugin/trino-delta-lake/src/main/java/io/trino/plugin/deltalake/DeltaLakeMetadata.java:[1229,20] [UnusedVariable] The parameter 'nodeId' is never read.
Error:      (see https://errorprone.info/bugpattern/UnusedVariable)
Error:    Did you mean 'nodeVersion,'?

@krvikash krvikash force-pushed the support-readVersion-and-writeVersion-in-delta branch from 853b8e6 to 2630c3b Compare February 22, 2023 09:13
@krvikash
Copy link
Copy Markdown
Contributor Author

Fixed CI failure.

@ebyhr
Copy link
Copy Markdown
Member

ebyhr commented Feb 22, 2023

/test-with-secrets sha=2630c3b47f47bf4b5193e3cb72e8f1d51de1445d

@trinodb trinodb deleted a comment from github-actions bot Feb 22, 2023
@github-actions
Copy link
Copy Markdown

The CI workflow run with tests that require additional secrets finished as failure: https://github.com/trinodb/trino/actions/runs/4242355164

@krvikash krvikash force-pushed the support-readVersion-and-writeVersion-in-delta branch from 2630c3b to 082a0c2 Compare February 22, 2023 20:45
@krvikash
Copy link
Copy Markdown
Contributor Author

Fixed product test:

io.trino.tests.product.deltalake.TestDeltaLakeDatabricksCheckpointsCompatibility.testTrinoUsesCheckpointInterval (Groups: profile_specific_tests, delta-lake-databricks) took 4.6 seconds

@ebyhr
Copy link
Copy Markdown
Member

ebyhr commented Feb 22, 2023

/test-with-secrets sha=082a0c2caba8e5ef24eda0a3615b591a07b8f0cc

@github-actions
Copy link
Copy Markdown

The CI workflow run with tests that require additional secrets finished as failure: https://github.com/trinodb/trino/actions/runs/4249084669

@ebyhr ebyhr merged commit 6496778 into trinodb:master Feb 23, 2023
@ebyhr ebyhr mentioned this pull request Feb 23, 2023
@krvikash krvikash deleted the support-readVersion-and-writeVersion-in-delta branch February 23, 2023 11:49
@github-actions github-actions bot added this to the 408 milestone Feb 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Development

Successfully merging this pull request may close these issues.

Support changing Delta table protocol versions

5 participants