-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Add Delta Lake $properties system table #17592
Conversation
plugin/trino-delta-lake/src/main/java/io/trino/plugin/deltalake/DeltaLakeMetadata.java
Show resolved
Hide resolved
plugin/trino-delta-lake/src/main/java/io/trino/plugin/deltalake/DeltaLakePropertiesTable.java
Outdated
Show resolved
Hide resolved
...n/java/io/trino/tests/product/deltalake/TestDeltaLakeDatabricksCreateTableCompatibility.java
Outdated
Show resolved
Hide resolved
plugin/trino-delta-lake/src/main/java/io/trino/plugin/deltalake/DeltaLakePropertiesTable.java
Outdated
Show resolved
Hide resolved
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.
Please fix the commit granularity. https://github.com/trinodb/trino/blob/master/.github/DEVELOPMENT.md#git-merge-strategy
...no-product-tests/src/main/java/io/trino/tests/product/deltalake/util/DeltaLakeTestUtils.java
Outdated
Show resolved
Hide resolved
plugin/trino-delta-lake/src/test/java/io/trino/plugin/deltalake/TestDeltaLakeSystemTables.java
Outdated
Show resolved
Hide resolved
plugin/trino-delta-lake/src/main/java/io/trino/plugin/deltalake/DeltaLakePropertiesTable.java
Outdated
Show resolved
Hide resolved
7c36524
to
e5b8e68
Compare
The failing product test seems to be unrelated. The test
|
...no-product-tests/src/main/java/io/trino/tests/product/deltalake/util/DeltaLakeTestUtils.java
Outdated
Show resolved
Hide resolved
Please check CI failure. |
c443e16
to
a9112b2
Compare
@ebyhr CI is green for this PR again. Would you have time for another review? |
...no-product-tests/src/main/java/io/trino/tests/product/deltalake/util/DeltaLakeTestUtils.java
Outdated
Show resolved
Hide resolved
``$properties`` table | ||
~~~~~~~~~~~~~~~~~~~~~ | ||
|
||
The ``$properties`` table provides access to general information about Delta |
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'd recommend keeping things simple and mention that the table gives access to the properties names and values of the Delta Lake table. See https://trino.io/docs/current/connector/hive.html#metadata-tables
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 changed the wording slightly to distinguish between table configuration (minReaderVersion, etc.), table features (items of the features field of protocol entries), and table properties (custom properties). Arguably this is an implementation detail of Delta. Open to other ways to phrase this.
plugin/trino-delta-lake/src/test/java/io/trino/plugin/deltalake/TestDeltaLakeSystemTables.java
Outdated
Show resolved
Hide resolved
...rc/main/java/io/trino/tests/product/deltalake/TestDeltaLakeTablePropertiesCompatibility.java
Outdated
Show resolved
Hide resolved
a9112b2
to
8cd28fd
Compare
@@ -877,6 +877,24 @@ public void testViewReferencingHiveAndDeltaTable(boolean legacyHiveViewTranslati | |||
} | |||
} | |||
|
|||
@Test(groups = {DELTA_LAKE_DATABRICKS, DELTA_LAKE_OSS, PROFILE_SPECIFIC_TESTS}) | |||
@Flaky(issue = DATABRICKS_COMMUNICATION_FAILURE_ISSUE, match = DATABRICKS_COMMUNICATION_FAILURE_MATCH) | |||
public void testDeltaToHivePropertiesRedirect() |
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.
This functionality has worked also before this PR.
We should be testing the other way around
test_redirect_to_delta_properties
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.
Modified both tests to verify redirection to the Delta table $properties table.
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.
LGTM % comment
It is worth showcasing that the |
8cd28fd
to
d20f38a
Compare
ImmutableList.<ColumnMetadata>builder() | ||
.add(new ColumnMetadata("key", VARCHAR)) | ||
.add(new ColumnMetadata("value", VARCHAR)) | ||
.build()); |
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.
Let's move this list of ColumnMetadata
to the constant.
import java.util.List; | ||
|
||
import static io.trino.tempto.assertions.QueryAssert.Row.row; | ||
import static io.trino.tempto.assertions.QueryAssert.assertThat; |
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.
This method is deprecated. Please use AssertJ's assertThat
.
b7c19d8
to
d29c4e4
Compare
plugin/trino-delta-lake/src/main/java/io/trino/plugin/deltalake/DeltaLakePropertiesTable.java
Outdated
Show resolved
Hide resolved
...rc/main/java/io/trino/tests/product/deltalake/TestDeltaLakeTablePropertiesCompatibility.java
Outdated
Show resolved
Hide resolved
d29c4e4
to
184162c
Compare
/test-with-secrets sha=184162cedd6b5ca986deca803ee472f5c1d35222 |
The CI workflow run with tests that require additional secrets finished as failure: https://github.com/trinodb/trino/actions/runs/5400162270 |
Please fix CI failure with secrets. |
This is some matrix of failures to fix: suite-delta-lake-databricks73
suite-delta-lake-databricks91
suite-delta-lake-databricks104
suite-delta-lake-databricks113
|
@ebyhr I'm leaning towards excluding version 73, 91, 104 and 113 from the new product tests? I'll make this change. We could potentially refactor the tests to test less, or be version specific. |
184162c
to
b00b09f
Compare
Update 05.07.2023
On a second thought, the change makes sense. We're testing actually Trino for accuracy and not Databricks |
@ebyhr can you please trigger the build with secrets? |
/test-with-secrets sha=b00b09f7dc6b2cd0818696bb8f9ad19ea419fe06 |
The CI workflow run with tests that require additional secrets has been started: https://github.com/trinodb/trino/actions/runs/5470965065 |
@ebyhr could you please do another check whether this PR is good to land? |
...rc/main/java/io/trino/tests/product/deltalake/TestDeltaLakeTablePropertiesCompatibility.java
Outdated
Show resolved
Hide resolved
...rc/main/java/io/trino/tests/product/deltalake/TestDeltaLakeTablePropertiesCompatibility.java
Outdated
Show resolved
Hide resolved
plugin/trino-delta-lake/src/main/java/io/trino/plugin/deltalake/DeltaLakeTableHandle.java
Outdated
Show resolved
Hide resolved
b00b09f
to
214d759
Compare
plugin/trino-delta-lake/src/main/java/io/trino/plugin/deltalake/DeltaLakeMetadata.java
Outdated
Show resolved
Hide resolved
plugin/trino-delta-lake/src/main/java/io/trino/plugin/deltalake/DeltaLakeMetadata.java
Show resolved
Hide resolved
214d759
to
9f1b159
Compare
/test-with-secrets sha=9f1b159d2c75485d8dfe81cfe1a895db7c3cef34 |
The CI workflow run with tests that require additional secrets finished as failure: https://github.com/trinodb/trino/actions/runs/5584978296 |
9f1b159
to
3c61b82
Compare
Description
Adds a
$properties
system table for Delta Lake, similar to what exists for Iceberg.The main motivation for adding the
$properties
system table is to be able to testextra_properties
which will be added as part of #17428Fixes #17294
Release notes
(x) Release notes are required, with the following suggested text: