Skip to content

fix: handle decimal types inside struct/map in UC type parser#76

Open
ablanchard wants to merge 5 commits intoduckdb:mainfrom
ablanchard:fix/decimal-type-in-struct-map
Open

fix: handle decimal types inside struct/map in UC type parser#76
ablanchard wants to merge 5 commits intoduckdb:mainfrom
ablanchard:fix/decimal-type-in-struct-map

Conversation

@ablanchard
Copy link
Copy Markdown

@ablanchard ablanchard commented Mar 16, 2026

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 a decimal(38,18) type.
I am running this extension and the delta extension from master with duckDB v1.5.0

Root 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::TypeToLogicalType to fail. When encountering a type like decimal(38,18) nested inside a struct or map, the parser would treat the comma between 38 and 18 as 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 decimal inside struct, map and array.

This PR was generated with Claude Opus 4.6

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant