SNOW-3725168: Handle VECTOR type in isCaseSensitive and getColumnClassName#2685
SNOW-3725168: Handle VECTOR type in isCaseSensitive and getColumnClassName#2685AndreiRudkouski wants to merge 1 commit into
Conversation
|
I have read the CLA Document and I hereby sign the CLA You can retrigger this bot by commenting recheck in this Pull Request. Posted by the CLA Assistant Lite bot. |
There was a problem hiding this comment.
Pull request overview
Adds proper JDBC metadata handling for Snowflake VECTOR columns so metadata queries don’t misreport capabilities or throw for unsupported type codes.
Changes:
- Treat
VECTORasVARCHARforResultSetMetaData.isCaseSensitive(...)to align with how structured/string-represented types are handled. - Treat
VECTORasVARCHARforResultSetMetaData.getColumnClassName(...)to avoidSQLFeatureNotSupportedExceptionfromSnowflakeTypeUtil.javaTypeToClassName(...). - Add/extend integration tests to assert
VECTORcolumn type, class name, and case-sensitivity behavior.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/test/java/net/snowflake/client/internal/jdbc/ResultSetLatestIT.java | Adds coverage asserting VECTOR metadata (getColumnType, getColumnClassName, isCaseSensitive). |
| src/main/java/net/snowflake/client/internal/jdbc/SnowflakeResultSetMetaDataV1.java | Maps VECTOR to Types.VARCHAR for case-sensitivity and Java class name resolution. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Overview
SNOW-3725168
Pre-review self checklist
masterbranchmvn -P check-style validate)mvn verifyand inspecttarget/japicmp/japicmp.html)SNOW-XXXX:External contributors - please answer these questions before submitting a pull request. Thanks!
What GitHub issue is this PR addressing? Make sure that there is an accompanying issue to your PR.
Issue: SNOW-3725168: [Bug] Vector type (50003) causes SQLFeatureNotSupportedException in ResultSetMetaData #2684
Fill out the following pre-review checklist:
@SnowflakeJdbcInternalApi(note that public/protected methods/fields in classes marked with this annotation are already internal)Please describe how your code solves the related issue.
This PR resolves the issue where the Snowflake
VECTORdata type was not correctly mapped to a standard JDBC type, causing external tools and ORMs to fail when retrieving vector columns.Solution:
The fix correctly maps
SnowflakeType.EXTRA_TYPES_VECTORtojava.sql.Types.VARCHAR.Since the driver internally already extracts
VECTORdata as a JSON string viagetString(columnIndex), mapping it toVARCHARensures maximum compatibility with standard JDBC clients without breaking internal driver logic.