Skip to content

[SPARK-34385][SQL] Unwrap SparkUpgradeException in v2 Parquet datasource#31497

Closed
MaxGekk wants to merge 2 commits intoapache:masterfrom
MaxGekk:parquet-spark-upgrade-exception
Closed

[SPARK-34385][SQL] Unwrap SparkUpgradeException in v2 Parquet datasource#31497
MaxGekk wants to merge 2 commits intoapache:masterfrom
MaxGekk:parquet-spark-upgrade-exception

Conversation

@MaxGekk
Copy link
Member

@MaxGekk MaxGekk commented Feb 6, 2021

What changes were proposed in this pull request?

Unwrap SparkUpgradeException from ParquetDecodingException in v2 FilePartitionReader in the same way as v1 implementation does:

case e: ParquetDecodingException =>
if (e.getCause.isInstanceOf[SparkUpgradeException]) {
throw e.getCause
} else if (e.getMessage.contains("Can not read value at")) {

Why are the changes needed?

  1. To be compatible with v1 implementation of the Parquet datasource.
  2. To improve UX with Spark SQL by making SparkUpgradeException more visible.

Does this PR introduce any user-facing change?

Yes, it can.

How was this patch tested?

By running the affected test suites:

$ build/sbt "sql/test:testOnly *ParquetRebaseDatetimeV1Suite"
$ build/sbt "sql/test:testOnly *ParquetRebaseDatetimeV2Suite"

@github-actions github-actions bot added the SQL label Feb 6, 2021
@SparkQA
Copy link

SparkQA commented Feb 6, 2021

Kubernetes integration test starting
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/39538/

@SparkQA
Copy link

SparkQA commented Feb 6, 2021

Kubernetes integration test status success
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/39538/

case e: ParquetDecodingException =>
if (e.getMessage.contains("Can not read value at")) {
if (e.getCause.isInstanceOf[SparkUpgradeException]) {
throw e.getCause

Choose a reason for hiding this comment

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

If this is user-facing is it possible that it returns null? If it returns null message won't be helpful.

Copy link
Member Author

Choose a reason for hiding this comment

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

@SparkQA
Copy link

SparkQA commented Feb 6, 2021

Test build #134955 has finished for PR 31497 at commit 09d454a.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

Copy link

@Archish27 Archish27 left a comment

Choose a reason for hiding this comment

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

LGTM! 🚀

Copy link
Member

@dongjoon-hyun dongjoon-hyun left a comment

Choose a reason for hiding this comment

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

+1, LGTM. Thank you, @MaxGekk and all.
Merged to master.

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.

5 participants