Adds fallback for complex types [ES-1469237]#834
Merged
Merged
Conversation
…ve unused constants
…ts for validation
…n messages for disabled support - Introduced a private method `isComplexType` to streamline complex type checks. - Updated exception messages in `getArray`, `getMap`, and `getStruct` methods to provide clearer guidance on enabling complex datatype support. - Added unit tests to verify exception handling when complex datatype support is disabled.
gopalldb
reviewed
May 27, 2025
gopalldb
reviewed
May 27, 2025
gopalldb
reviewed
May 27, 2025
gopalldb
reviewed
May 27, 2025
…QLException - Updated methods getArray, getStruct, and getMap to throw DatabricksSQLException with specific error codes when complex datatype support is disabled. - Enhanced logging for error conditions to improve debugging and user guidance. - Adjusted unit tests to verify the new exception types and error codes.
gopalldb
reviewed
May 27, 2025
gopalldb
reviewed
May 27, 2025
…en complex datatype support is disabled. - Improved clarity in handling complex types by logging the conversion to STRING when necessary.
gopalldb
approved these changes
May 27, 2025
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
Added a static isComplexType utility method to DatabricksResultSet and ArrowStreamResult to consistently identify complex data types (ARRAY, MAP, STRUCT)
Updated the getObject method to use this utility method for identifying complex types and treat them as strings when complex datatype support is disabled.
This change fixes a NullPointerException that occurred when handling complex data types (ARRAY, MAP, STRUCT) with complex datatype support disabled. The issue appeared in workflows where:
The NPE occurred because the code was trying to call toString() on a null object when handling complex types with support disabled.
Testing
Added comprehensive unit tests to verify error handling when complex datatypes are accessed without enabling support
We conducted memory testing comparing our implementation with both the original code and the Databricks JDBC driver v2.7.3:
Test results showed comparable memory usage across both drivers
Using large arrays (100KB+) and multiple rows (50+) did not reveal memory inefficiencies
Additional Notes to the Reviewer
NO_CHANGELOG=true (This is a bug fix that addresses an internal error without changing the external API.)