Skip to content

Refactor testTimestampCoercion in Delta Lake connector #25676

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

danpro1011
Copy link

Description

Refactors the testTimestampCoercion* methods in TestDeltaLakeConnectorTest to use the shared TypeCoercionTestSetup record, improving consistency with Iceberg connector tests. It also includes a test case for coercion involving nested types such as array(array(...)), as requested.

Additional context and related issues

Follows the approach used in Iceberg’s BaseIcebergConnectorTest.
Improves clarity and maintainability of timestamp coercion tests for the Delta Lake connector.

Release notes

(x) This is not user-visible or is docs only, and no release notes are required.

@cla-bot cla-bot bot added the cla-signed label Apr 25, 2025
@github-actions github-actions bot added the delta-lake Delta Lake connector label Apr 25, 2025
@danpro1011 danpro1011 changed the title Refactor testTimestampCoercion in Delta Lake connector (#22042) Refactor testTimestampCoercion in Delta Lake connector Apr 25, 2025
('url5', 'domain2', 500),
('url6', 'domain4', 2)
""");
"""
Copy link
Member

Choose a reason for hiding this comment

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

Please revert unrelated changes. Same for other places.

Copy link
Author

Choose a reason for hiding this comment

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

I've reverted the formatting changes and ensured the diff is now clean. Let me know if you see anything else I should update. Thanks!

@danpro1011 danpro1011 force-pushed the refactor-timestamp-tests branch from 82f009a to 4b4fef1 Compare April 25, 2025 23:24
@danpro1011 danpro1011 force-pushed the refactor-timestamp-tests branch from 4b4fef1 to a7568e4 Compare April 25, 2025 23:27
{
return typeCoercionTimestamp().stream()
.filter(setup -> !isNestedType(setup.newColumnType()))
.collect(toList());
Copy link
Contributor

Choose a reason for hiding this comment

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

Use toImmutableList()

for (TypeCoercionTestSetup setup : typeCoercionTimestampProvider()) {
try (TestTable testTable = newTrinoTable(
"test_timestamp_coercion_on_create_table",
"(ts %s)".formatted(setup.newColumnType))) {
Copy link
Contributor

Choose a reason for hiding this comment

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

We are testing coercion here, so the create type shouldn't same as the insert type

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla-signed delta-lake Delta Lake connector
Development

Successfully merging this pull request may close these issues.

3 participants