fix: handle decimal types inside struct/map in UC type parser#76
Open
ablanchard wants to merge 5 commits intoduckdb:mainfrom
Open
fix: handle decimal types inside struct/map in UC type parser#76ablanchard wants to merge 5 commits intoduckdb:mainfrom
ablanchard wants to merge 5 commits intoduckdb:mainfrom
Conversation
The comma-splitting logic in struct and map type parsing only tracked angle bracket nesting (<>), not parenthesis nesting (). This caused types like struct<price:decimal(38,18),name:string> to be incorrectly split on the comma inside decimal(38,18). Add parenthesis tracking to nested separator logic in both parsers.
Verify that array columns containing decimal types are parsed correctly by the array type parser, which doesn't split on commas.
Clarified comment to specify that nested parentheses are also ignored while finding the next separator.
Verify that map columns with decimal value types are parsed correctly by the map type parser after the parenthesis nesting fix.
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.
Hello, thanks for this extension.
I was poking around with our production table to see if our queries on databricks runtimes can run on duckDB.
Summary
I have the error
Not implemented Error: Tried to fallback to unknown type for 'decimal(38'when requesting any table. Even table without adecimal(38,18)type.I am running this extension and the
deltaextension from master with duckDBv1.5.0Root cause
When requesting a table, it will get all the tables in the schema and it happen that one of our table have a column of the type
struct<effective_price:decimal(38,9),unit:string>.This type is making the struct parser in
UCUtils::TypeToLogicalTypeto fail. When encountering a type likedecimal(38,18)nested inside a struct or map, the parser would treat the comma between38and18as a field separator because it only tracked<>nesting depth, not()nesting depth.Fix
The fix adds
(and)to the nesting depth tracking in both parsers.I have also added a test case for this type parsing covering a
decimalinside struct, map and array.This PR was generated with Claude Opus 4.6