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

[#1154] fix(trino-connector): Fix the issue with joins causing errors in PostgreSQL. #1177

Merged
merged 2 commits into from
Dec 18, 2023

Conversation

diqiu50
Copy link
Contributor

@diqiu50 diqiu50 commented Dec 18, 2023

What changes were proposed in this pull request?

Fix the issue with joins causing errors in PostgreSQL.
Error message is "Cannot cast com.datastrato.gravitino.trino.connector.GravitinoColumnHandle to io.trino.plugin.jdbc.JdbcColumnHandle"

Why are the changes needed?

Fix: #1154

Does this PR introduce any user-facing change?

NO

How was this patch tested?

UT

return internalSplitManager.getSplits(
gravitinoTransactionHandle.getInternalTransactionHandle(),
session,
gravitinoTableHandle.getInternalTableHandle(),
dynamicFilter,
DynamicFilter.EMPTY,
Copy link
Contributor

Choose a reason for hiding this comment

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

When will we use a non-null dynamicFilter?

Can you explain the real cause of the problem more clearly?

Copy link
Contributor Author

@diqiu50 diqiu50 Dec 18, 2023

Choose a reason for hiding this comment

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

In the current implementation of dynamicFilter, it includes ColumnHandle, and this columnhandle is currently GravitinoColumnHandle. When it's passed to the following internal connector, such as PG, it will throw an error. The PG connector only accepts JDBCColumnHandle. Here, we pass DynamicFilter.EMPTY, which can temporarily solve this problem.

@qqqttt123 qqqttt123 added branch-0.3 need backport Issues that need to backport to another branch labels Dec 18, 2023
Copy link
Contributor

@jerryshao jerryshao left a comment

Choose a reason for hiding this comment

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

LGTM.

@jerryshao jerryshao closed this Dec 18, 2023
@jerryshao jerryshao reopened this Dec 18, 2023
@diqiu50 diqiu50 self-assigned this Dec 18, 2023
@diqiu50 diqiu50 merged commit 20558b6 into apache:main Dec 18, 2023
9 checks passed
github-actions bot pushed a commit that referenced this pull request Dec 18, 2023
… in PostgreSQL. (#1177)

### What changes were proposed in this pull request?

Fix the issue with joins causing errors in PostgreSQL.
Error message is "Cannot cast
com.datastrato.gravitino.trino.connector.GravitinoColumnHandle to
io.trino.plugin.jdbc.JdbcColumnHandle"

### Why are the changes needed?

Fix: #1154

### Does this PR introduce _any_ user-facing change?

NO

### How was this patch tested?

UT
@diqiu50 diqiu50 deleted the bug-1154 branch December 22, 2023 09:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
branch-0.3 need backport Issues that need to backport to another branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug report] Exception with Postgres join in playground
4 participants