-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
Fix JdbcRecordCursor.isNull for types mapped to slice #5711
Conversation
This fixes an issue when the postgresql plugin is used to connect to cockroachdb: https://go.crdb.dev/issue-v/40195/v20.1
Is that link right? I don't see how it relates to this issue. |
I'm not sure this is the correct fix. There are various types mapped to |
// JDBC is kind of dumb: we need to read the field and then ask | ||
// if it was null, which means we are wasting effort here. | ||
// We could save the result of the field access if it matters. | ||
resultSet.getString(columnIndex); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do not see a reason why resultSet.getString() should be better than resultSet.getObject().
The code is redundant and can easily be accidentally removed with a refactor.
Can we have a test for this?
Also, if this is cockrach specific behavior, the correct approach is to provide SliceReadFunction
and implement isNull
for that case.
@elonazoulay would it be possible to have a real cockroachdb connector? |
It seems it should be pretty straightforward to test too, given https://www.testcontainers.org/modules/databases/cockroachdb/ exists. |
@findepi, yes! We were thinking to add time travel as well, so queries via the presto connector minimize contention with operational queries: https://www.cockroachlabs.com/docs/stable/as-of-system-time.html |
👋 @elonazoulay - this PR has become inactive. If you're still interested in working on it, please let us know, and we can try to get reviewers to help with that. Also I started a cockroachdb connector PR, but it became stale. Anyone interested can take it over or start again. See https://github.com/simpligility/trino/tree/cockroachdb and #13771 and #8317 We're working on closing out old and inactive PRs, so if you're too busy or this has too many merge conflicts to be worth picking back up, we'll be making another pass to close it out in a few weeks. |
This fixes an issue when the postgresql plugin is
used to connect to cockroachdb: https://go.crdb.dev/issue-v/40195/v20.1