Skip to content

Test Trino/Spark compatibility for storage formats#8751

Merged
findepi merged 7 commits intotrinodb:masterfrom
findepi:findepi/test-trino-spark-compatibility-for-storage-formats-f3f073
Aug 24, 2021
Merged

Test Trino/Spark compatibility for storage formats#8751
findepi merged 7 commits intotrinodb:masterfrom
findepi:findepi/test-trino-spark-compatibility-for-storage-formats-f3f073

Conversation

@findepi
Copy link
Copy Markdown
Member

@findepi findepi commented Aug 2, 2021

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

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.

Nits/suggesions, but looks good to me

Comment on lines 22 to 25
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.

Style suggestion, maybe specify Trino support using a constructor argument, like AVRO(false) ?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

thought about that, but that would be much more code to write. i chose simpler version

@phd3
Copy link
Copy Markdown
Member

phd3 commented Aug 2, 2021

CI hit #8719

Copy link
Copy Markdown
Member

@phd3 phd3 left a comment

Choose a reason for hiding this comment

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

@findepi you beat me to it, I had made the same changes locally to address #7180 (comment) 😁

LGTM % @alexjo2144's comments

@phd3 phd3 mentioned this pull request Aug 2, 2021
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 is overkill. Iceberg by specification only has three formats. Hard-code this test to Avro and don't clutter TestingIcebergStorageFormat with supported/unsupported. This will make it easy to remove when we support Avro (which should be soon).

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This is specifically to self-test the unsupportedStorageFormats, otherwise we may easily forget to update the @DataProviders here when adding AVRO support.

Copy link
Copy Markdown
Member

@electrum electrum Aug 3, 2021

Choose a reason for hiding this comment

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

You could solve this by adding a single TODO comment to this test to remove this test and update TestingStorageFormat when Avro is added. This test will fail at that point. No need to complicate all the code.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

No need to complicate all the code.

the only "complexity" is here, and i don't quite understand why we're calling this a complexity at all.

i specifically named the other factory method "storageFormats", so that no change is needed when we add Avro support and can remove "unsupportedStorageFormats".

@findepi findepi force-pushed the findepi/test-trino-spark-compatibility-for-storage-formats-f3f073 branch 2 times, most recently from 23d621a to 2cb2a6d Compare August 3, 2021 08:46
@findepi
Copy link
Copy Markdown
Member Author

findepi commented Aug 3, 2021

thanks for review.

AC, and also added test coverage for decimal (both directions), and timestamp with time zone (Trino writing, Spark reading; the other direction was already tested).

@findepi findepi force-pushed the findepi/test-trino-spark-compatibility-for-storage-formats-f3f073 branch from 2cb2a6d to e4d2e78 Compare August 3, 2021 20:48
@findepi findepi force-pushed the findepi/test-trino-spark-compatibility-for-storage-formats-f3f073 branch from e4d2e78 to 31318da Compare August 23, 2021 13:49
@findepi
Copy link
Copy Markdown
Member Author

findepi commented Aug 23, 2021

Rebased. All comments have been addressed. Will merge once the tests pass.

We already have Spark compatibility tests for Hive and Iceberg
connectors, so distinguished test class names will be helpful.
Iceberg `timestamptz` is mapped to `timestamp with time zone` in Trino
and to `timestamp` in Spark.

We already have a test writing Spark `timestamp` and reading in Trino.
This commit adds a test writing `timestamp with time zone` in Trino, and
reading in Spark.
@findepi findepi force-pushed the findepi/test-trino-spark-compatibility-for-storage-formats-f3f073 branch from 31318da to 9d4f434 Compare August 24, 2021 07:09
@findepi findepi merged commit 38991af into trinodb:master Aug 24, 2021
@findepi findepi deleted the findepi/test-trino-spark-compatibility-for-storage-formats-f3f073 branch August 24, 2021 09:40
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.

4 participants