Enhance ComplexDataTypeParser with formatting methods for complex types when param is disabled (string handling)#839
Merged
Conversation
- Added `formatComplexTypeString` method to standardize JSON string representation for complex types when support is disabled.
- Introduced `formatMapString` method to convert map JSON strings into a consistent {key:value} format.
- Updated `ArrowStreamResult` to utilize the new formatting methods for handling complex types when complex datatype support is disabled.
|
Please ensure that the NEXT_CHANGELOG.md file is updated with any relevant changes. |
…ap metadata handling - Changed the initialization of the key-value array in the formatMapString method to use a dynamic array instead of a fixed size. - Removed commented-out code for clarity and improved readability.
jayantsing-db
approved these changes
May 28, 2025
jayantsing-db
left a comment
Collaborator
There was a problem hiding this comment.
Looks good to me. Some minor comments
| } | ||
|
|
||
| try { | ||
| if (complexType.equals(DatabricksTypeUtil.MAP)) { |
Collaborator
There was a problem hiding this comment.
not for this PR but could there be other types where we need to format them in a different format than JSON?
Collaborator
|
qq: if we don't support complex types (flag is false) why do we have exceptions for few complex types? is it because the other driver does support complex types partially? |
gopalldb
reviewed
May 29, 2025
gopalldb
reviewed
May 29, 2025
gopalldb
reviewed
May 29, 2025
samikshya-db
approved these changes
May 29, 2025
samikshya-db
left a comment
Collaborator
There was a problem hiding this comment.
Nit : error handling as J suggested. LGTM otherwise Thanks!
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.
formatComplexTypeStringmethod to standardize JSON string representation for complex types when support is disabled.formatMapStringmethod to convert map JSON strings into a consistent {key:value} format.ArrowStreamResultto utilize the new formatting methods for handling complex types when complex datatype support is disabled.When a string is present it adds quotes, and when a non-string is present it doesn't add quotes
Currently, values we receive from the server are fine for structs and arrays but not for maps (in compliance with existing driver)
This does not support nested conversion. For high fidelity complex types, users must use complex types jdbc connection param
Description
Testing
unit test
Additional Notes to the Reviewer