Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CALCITE-6522] MAP_KEYS and MAP_VALUES function should throw if a key value is null #3909

Merged
merged 1 commit into from
Sep 21, 2024

Conversation

caicancai
Copy link
Member

@caicancai caicancai commented Aug 8, 2024

@caicancai
Copy link
Member Author

caicancai commented Aug 8, 2024

cala> val df = spark.sql("select map_values(map(cast(null as int),0, 'foo', 1))");
df: org.apache.spark.sql.DataFrame = [map_values(map(CAST(NULL AS INT), 0, foo, 1)): array<int>]

scala> df.show()
org.apache.spark.SparkRuntimeException: [NULL_MAP_KEY] Cannot use null as map key.
at org.apache.spark.sql.errors.QueryExecutionErrors$.nullAsMapKeyNotAllowedError(QueryExecutionErrors.scala:445)

From the spark log, the error is reported at runtime, not parameter verification.
Similar to the previous 6400

@julianhyde
Copy link
Contributor

There's a tab or multiple spaces in the jira case summary, commit message, PR summary. Please fix.

@caicancai
Copy link
Member Author

There's a tab or multiple spaces in the jira case summary, commit message, PR summary. Please fix.

done

Copy link

sonarcloud bot commented Aug 15, 2024

@mihaibudiu
Copy link
Contributor

There's error-prone error which has to be fixed.

@caicancai
Copy link
Member Author

@mihaibudiu @julianhyde Sorry for the late fix, I'm on vacation and have time to fix this PR.
Can you review this PR for me if you have time?

@caicancai
Copy link
Member Author

caicancai commented Sep 19, 2024

@mihaibudiu I squashed the commit and this problem may be solved in 1.38

Copy link

sonarcloud bot commented Sep 19, 2024

@mihaibudiu mihaibudiu merged commit 3cb9fc6 into apache:main Sep 21, 2024
19 checks passed
@caicancai caicancai deleted the 6522 branch September 21, 2024 12:17
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.

3 participants