You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Type coercion fails for MAP literals with NULL values across a VALUES list #23474
A MAP {'key': NULL} literal in a VALUES list fails type coercion when other rows in the same list have a concrete value type. The bare NULL gets inferred as Null type instead of being coerced to the value type of the surrounding rows.
Surfaced while writing sqllogictest coverage in #23406 for #15428. Broader context: NULL literal type inference across a VALUES list works for scalar types (e.g. VALUES (1), (NULL) coerces NULL to Int64), but the same inference does not extend into the value type of a Map literal. An explicit CAST(NULL AS BIGINT) is currently required as a workaround, which is what map.slt uses.
To Reproduce
Run against DataFusion main (also reproduces on DataFusion CLI v54.0.0):
Actual error:
Error during planning: Inconsistent data type across values list at row 1 column 0. Was Map("entries": non-null Struct("key": non-null Utf8, "value": Int64), unsorted) but found Map("entries": non-null Struct("key": non-null Utf8, "value": Null), unsorted)
The bare NULL in MAP {'k1': NULL} should be coerced to the value type of the other rows in the VALUES list (Int64 in this case), so the CREATE TABLE succeeds with a Map(Utf8, Int64) column type where the second row has a NULL value.
Activity
Udaytaneja commentedon Jul 11, 2026
Hi mantainers , I'd like to work on this . Please assign this to me.
PG1204 commentedon Jul 11, 2026
Hi @Udaytaneja , since this is a direct follow up of #23406 which I worked on, is it alright with you if I take this one?
Udaytaneja commentedon Jul 11, 2026
Please if possible assign this to me , actually I was a bit interested in this one .
PG1204 commentedon Jul 11, 2026
Maybe you can take on another issue for now, or if this issue ends having a follow up, then you can take the next one? I shall tag you in it.
Udaytaneja commentedon Jul 11, 2026
Okk , but do tag me in the next one please
PG1204 commentedon Jul 11, 2026
take
test: assert coerced Map value type is Int64 for the apache#23474 rep…
fix: support type coercion for MAP literals with NULL values in VALUE…
fix: support type coercion for MAP literals with NULL values in VALUE…