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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

ssheikin
Copy link
Contributor

Description

Based and requires #21607

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
Co-authored-by: Semion Paramonow <semion.paramonow@starburstdata.com>
@ssheikin ssheikin force-pushed the ssheikin/95/trino/cast-pushdown branch from d4f22da to edc25bf Compare May 14, 2024 10:33
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.

None yet

2 participants