Skip to content

Conversation

@MaxGekk
Copy link
Member

@MaxGekk MaxGekk commented Dec 28, 2023

What changes were proposed in this pull request?

In the PR, I propose to handle NPE and asserts from eagerly executed commands, and convert them to internal errors.

Why are the changes needed?

To unify the approach for errors raised by Spark SQL.

Does this PR introduce any user-facing change?

Yes.

Before the changes:

Cannot invoke "org.apache.spark.sql.connector.read.colstats.ColumnStatistics.min()" because the return value of "scala.Option.get()" is null
java.lang.NullPointerException: Cannot invoke "org.apache.spark.sql.connector.read.colstats.ColumnStatistics.min()" because the return value of "scala.Option.get()" is null
	at org.apache.spark.sql.execution.datasources.v2.DescribeColumnExec.run(DescribeColumnExec.scala:63)

After:

org.apache.spark.SparkException: [INTERNAL_ERROR] Eagerly executed command failed. You hit a bug in Spark or the Spark plugins you use. Please, report this bug to the corresponding communities or vendors, and provide the full stack trace. SQLSTATE: XX000
	at org.apache.spark.SparkException$.internalError(SparkException.scala:107)
...
Caused by: java.lang.NullPointerException: Cannot invoke "org.apache.spark.sql.connector.read.colstats.ColumnStatistics.min()" because the return value of "scala.Option.get()" is null
	at org.apache.spark.sql.execution.datasources.v2.DescribeColumnExec.run(DescribeColumnExec.scala:63)

How was this patch tested?

Manually, by running the test from another PR: #44524

Was this patch authored or co-authored using generative AI tooling?

No.

@github-actions github-actions bot added the SQL label Dec 28, 2023
@MaxGekk MaxGekk changed the title [WIP][SQL] Convert NPE and asserts from commands to internal errors [WIP][SPARK-46537][SQL] Convert NPE and asserts from commands to internal errors Dec 28, 2023
@MaxGekk MaxGekk requested a review from cloud-fan December 28, 2023 11:45
@MaxGekk MaxGekk changed the title [WIP][SPARK-46537][SQL] Convert NPE and asserts from commands to internal errors [SPARK-46537][SQL] Convert NPE and asserts from commands to internal errors Dec 28, 2023
@MaxGekk MaxGekk marked this pull request as ready for review December 28, 2023 11:46
@MaxGekk
Copy link
Member Author

MaxGekk commented Dec 28, 2023

@yaooqinn @LuciferYang @cloud-fan This PR fixes the issue: #44524 (comment) . Thanks to @Zouxxyy for the test.

Copy link
Member

@yaooqinn yaooqinn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@MaxGekk
Copy link
Member Author

MaxGekk commented Dec 28, 2023

The failure of Run / Run Spark on Kubernetes Integration test is not related to the changes, I do believe.

Merging to master. Thank you, @yaooqinn and @cloud-fan for review.

@MaxGekk MaxGekk closed this in 5db6824 Dec 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants