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

Pushdown CAST in JOIN criteria for PostgreSql #21939

Closed

Conversation

ssheikin
Copy link
Contributor

@ssheikin ssheikin commented May 11, 2024

To be revisited after #22728 is merged

Description

Based and requires #21607
Similar to #22728

Additional context and related issues

Release notes

( ) This is not user-visible or is docs only, and no release notes are required.
( ) Release notes are required. Please propose a release note for me.
( ) Release notes are required, with the following suggested text:

# Section
* Fix some things. ({issue}`issuenumber`)

@@ -1013,6 +1012,66 @@ public void testInPredicatePushdown()
}
}

@Test
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Add case sensitive tests

@ssheikin ssheikin force-pushed the ssheikin/95/trino/cast-pushdown branch from 2b19480 to 07e7da2 Compare May 13, 2024 11:59
Comment on lines +1075 to +1073
assertThatThrownBy(() -> getQueryRunner().execute(session, "SELECT a.a2, b.b2 FROM %s a JOIN %s b ON CAST(a.a1 AS %s) = b.b1".formatted(tableA.getName(), tableB.getName(), testCaseMoney.castType())));
// the best we can do - cast right side to a trino type, to which is resolved left side. After pushdown, trino type is mapped to native type
assertThat(query(session, "SELECT a.a2, b.b2 FROM %s a JOIN %s b ON CAST(a.a1 AS %s) = CAST(b.b1 AS %s)".formatted(tableA.getName(), tableB.getName(), testCaseMoney.castType(), testCaseMoney.castType())))
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is a breaking change, so has to be covered by config/session property toggle.
@Praveen2112

@ssheikin ssheikin force-pushed the ssheikin/95/trino/cast-pushdown branch from 07e7da2 to d4f22da Compare May 13, 2024 12:07
@ssheikin ssheikin requested a review from wendigo May 13, 2024 12:16
SemionPar and others added 2 commits May 14, 2024 10:22
Extend rule to support join pushdown in cases where join conditions
contain Calls causing Project nodes to appear over scans.

Fix failing tests
@ssheikin ssheikin force-pushed the ssheikin/95/trino/cast-pushdown branch from d4f22da to edc25bf Compare May 14, 2024 10:33
Copy link

github-actions bot commented Jun 4, 2024

This pull request has gone a while without any activity. Tagging the Trino developer relations team: @bitsondatadev @colebow @mosabua

@github-actions github-actions bot added the stale label Jun 4, 2024
@mosabua
Copy link
Member

mosabua commented Jun 4, 2024

I am adding the stale-ignore label under the assumption that @ssheikin and others are still collaborating on this and will bring it to completion.

@mosabua mosabua added stale-ignore Use this label on PRs that should be ignored by the stale bot so they are not flagged or closed. and removed stale labels Jun 4, 2024
@ssheikin
Copy link
Contributor Author

ssheikin commented Jul 2, 2024

To revisit after #21607 is merged

@ssheikin ssheikin closed this Jul 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla-signed stale-ignore Use this label on PRs that should be ignored by the stale bot so they are not flagged or closed.
Development

Successfully merging this pull request may close these issues.

3 participants