Added a fallback mechanism for the reading metadata#1588
Merged
Conversation
…MariaDB driver, improve fallback mechanisms for unsupported JDBC metadata methods, and update relevant tests.
Collaborator
Author
|
@copilot make a review of fallback mechanism from the point of supporting some JDBC sources which are not supported yet |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR enhances JDBC metadata reading robustness by adding comprehensive fallback mechanisms for drivers that don't fully implement JDBC metadata methods (e.g., Apache Hive), and fixes MariaDB-specific type mapping issues for BIGINT and unsigned integer types.
Key Changes:
- Added graceful fallbacks in
getTableColumnsMetadata()for all ResultSetMetaData methods that may throw SQLFeatureNotSupportedException - Fixed MariaDB type mappings to ensure BIGINT and unsigned integers always map to Long type, addressing driver inconsistencies
- Improved test robustness with proper resource cleanup using
.use {}blocks and consistent table naming
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
dataframe-jdbc/src/main/kotlin/org/jetbrains/kotlinx/dataframe/io/db/DbType.kt |
Added comprehensive exception handling fallbacks for JDBC metadata retrieval methods (catalog, schema, column names, types, nullability) and updated documentation to reflect fallback behavior |
dataframe-jdbc/src/main/kotlin/org/jetbrains/kotlinx/dataframe/io/db/MariaDb.kt |
Added explicit type mapping rules for BIGINT and unsigned integer types (INTEGER UNSIGNED, INT UNSIGNED) to consistently map to Long, fixing driver-reported type inconsistencies |
dataframe-jdbc/src/test/kotlin/org/jetbrains/kotlinx/dataframe/io/local/mariadbTest.kt |
Updated test assertion to expect ByteArray instead of Blob for TINYBLOB columns, aligning with corrected type mapping |
dataframe-jdbc/src/test/kotlin/org/jetbrains/kotlinx/dataframe/io/commonTestScenarios.kt |
Refactored test to use constant for table name, added proper cleanup with DROP TABLE IF EXISTS, and improved resource management with .use {} blocks |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
dataframe-jdbc/src/main/kotlin/org/jetbrains/kotlinx/dataframe/io/db/DbType.kt
Outdated
Show resolved
Hide resolved
dataframe-jdbc/src/test/kotlin/org/jetbrains/kotlinx/dataframe/io/commonTestScenarios.kt
Outdated
Show resolved
Hide resolved
koperagen
reviewed
Nov 26, 2025
dataframe-jdbc/src/main/kotlin/org/jetbrains/kotlinx/dataframe/io/db/DbType.kt
Outdated
Show resolved
Hide resolved
koperagen
reviewed
Nov 26, 2025
dataframe-jdbc/src/main/kotlin/org/jetbrains/kotlinx/dataframe/io/db/MariaDb.kt
Outdated
Show resolved
Hide resolved
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.
Fixes #1220 + some discovered bugs regarding type mappings