Skip to content

[SQL] Produce a runtime error for NULL map keys - #8191

Draft
mihaibudiu wants to merge 1 commit into
mainfrom
null-map-keys
Draft

mihaibudiu wants to merge 1 commit into
mainfrom
null-map-keys

Conversation

@mihaibudiu

Copy link
Copy Markdown
Contributor

This is a breaking change: attempting to insert a NULL key into a MAP produces a runtime error. Previously it was allowed.
(There's a compile-time error if we can detect this at compile-time).
m[NULL] always evaluates to NULL, like it used to.

Note that even prior to this change declared MAP<K, V> types did not support nullable keys. As a consequence, the "forbidden" map values could not be present in tables.
One could however create at runtime MAP values with NULL keys. It was however impossible to retrieve the associated value, since m[NULL] already evaluates to NULL.

This brings the semantics in line with many other SQL engines, such as DuckDB, Spark, Clickhouse, Postgres, Presto, etc.
Also, Arrow cannot represent nullable keys in MAP types.

Checklist

  • Unit tests added/updated
  • Documentation updated
  • Changelog updated

Breaking Changes?

Mark if you think the answer is yes for any of these components:

  • Feldera SQL (Syntax, Semantics)

Signed-off-by: Mihai Budiu <mbudiu@feldera.com>
@blp blp added the SQL compiler Related to the SQL compiler label Dec 3, 2026
@mihaibudiu

Copy link
Copy Markdown
Contributor Author

We will merge this about a month after #8250 has been released to give customers time to adapt
I will keep it as draft until then

@mihaibudiu
mihaibudiu marked this pull request as draft December 5, 2026 04:29

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

SQL compiler Related to the SQL compiler

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants