Handle binary varying type for newer redshift driver#25488
Merged
agrawalreetika merged 1 commit intoprestodb:masterfrom Jul 8, 2025
Merged
Handle binary varying type for newer redshift driver#25488agrawalreetika merged 1 commit intoprestodb:masterfrom
agrawalreetika merged 1 commit intoprestodb:masterfrom
Conversation
infvg
approved these changes
Jul 3, 2025
bddbdc8 to
bdad685
Compare
agrawalreetika
previously approved these changes
Jul 3, 2025
Contributor
Author
|
@tdcmeehan can you please review and the merge this PR? |
tdcmeehan
requested changes
Jul 7, 2025
| { | ||
| String typeName = typeHandle.getJdbcTypeName(); | ||
|
|
||
| if (typeName.equalsIgnoreCase("binary varying")) { |
Contributor
There was a problem hiding this comment.
Can you add a comment explaining that this is dependent on the version of the driver, as is included in this PR?
Contributor
Author
There was a problem hiding this comment.
@tdcmeehan 1 line comment added.
or do you want me to add comment in Javadoc-style format
/**
* Maps Redshift VARBYTE columns to Presto VARBINARY.
* <p>
* Redshift JDBC driver version ≥ 2.1.0.32 reports VARBYTE as JDBC type 1111 (Types.OTHER)
* with type name "binary varying", whereas older versions (e.g., 2.1.0.28) report it
* as type -4 (Types.LONGVARBINARY) with type name "varbyte".
* This mapping ensures compatibility with newer driver versions.
*/
f314b4f to
7e0ae2d
Compare
tdcmeehan
approved these changes
Jul 8, 2025
7e0ae2d to
e036ddc
Compare
agrawalreetika
approved these changes
Jul 8, 2025
7 tasks
6 tasks
This was referenced Jul 24, 2025
6 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Newer redshift drivers uses Types.OTHER (1111) to represent VARBYTE and describes it as "
binary varying"Motivation and Context
create table redshift.test.redtest4 (varbincolumn varbinary);
The Redshift JDBC driver returns the JDBC type for VARBYTE columns as:
JdbcTypeHandle{jdbcType=1111, jdbcTypeName=binary varying, columnSize=2147483647, decimalDigits=0}
This type is not recognized by Presto's default jdbcTypeToPrestoType() mapping,
resulting in the column being ignored as unsupported during DESCRIBE or INSERT queries
DESCRIBE redshift.test.redtest1; output is:
SHOW CREATE TABLE redshift.test.redtest1; output is:
INSERT query output is:
Impact
Test Plan
Contributor checklist
Release Notes
Please follow release notes guidelines and fill in the release notes below.