Skip to content

[SPARK-38743][SQL] Test the error class: MISSING_STATIC_PARTITION_COLUMN#54692

Open
deepujain wants to merge 1 commit into
apache:masterfrom
deepujain:SPARK-38743-missing-static-partition-column-test
Open

[SPARK-38743][SQL] Test the error class: MISSING_STATIC_PARTITION_COLUMN#54692
deepujain wants to merge 1 commit into
apache:masterfrom
deepujain:SPARK-38743-missing-static-partition-column-test

Conversation

@deepujain

Copy link
Copy Markdown

Summary

Adds test coverage and standard error class for the MISSING_STATIC_PARTITION_COLUMN case in QueryCompilationErrors. When an INSERT or DELETE specifies a static partition column name that is not found in the target table's output, Spark now throws an AnalysisException with error class MISSING_STATIC_PARTITION_COLUMN and sqlState 42703, instead of a generic internal error.

Change

  • error-conditions.json: Added MISSING_STATIC_PARTITION_COLUMN with message "Static partition column is not found in the table." and sqlState 42703.
  • QueryCompilationErrors.scala: Updated missingStaticPartitionColumn(staticName) to throw AnalysisException with error class MISSING_STATIC_PARTITION_COLUMN and messageParameters = Map("staticName" -> toSQLId(staticName)) instead of SparkException.internalError.
  • QueryCompilationErrorsSuite.scala: Added test SPARK-38743: MISSING_STATIC_PARTITION_COLUMN that asserts error class, sqlState, and message parameters for the exception from QueryCompilationErrors.missingStaticPartitionColumn("p").

Tests

New test in QueryCompilationErrorsSuite covers the error class, sqlState, and message parameters as required by the JIRA.

Fixes SPARK-38743

JIRA assignee for credit: deepujain

@deepujain deepujain force-pushed the SPARK-38743-missing-static-partition-column-test branch from ecbe82e to 30e8a2a Compare March 12, 2026 04:58
@deepujain

Copy link
Copy Markdown
Author

Rebased on master. Ran QueryCompilationErrorsSuite (SPARK-38743) locally passed. Ready for CI.

@deepujain deepujain force-pushed the SPARK-38743-missing-static-partition-column-test branch from 30e8a2a to 576a4cf Compare May 27, 2026 20:02
@deepujain

Copy link
Copy Markdown
Author

Rebased on current master. Ran ./build/sbt "sql/testOnly org.apache.spark.sql.errors.QueryCompilationErrorsSuite -- -z SPARK-38743" - passed. Ready for CI.

@deepujain deepujain force-pushed the SPARK-38743-missing-static-partition-column-test branch from 576a4cf to 8f21bab Compare June 26, 2026 15:53
@deepujain

Copy link
Copy Markdown
Author

Rebased this on current master. I reran ./build/sbt "sql/testOnly org.apache.spark.sql.errors.QueryCompilationErrorsSuite -- -z SPARK-38743" locally; it passed. Ready for CI.

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.

1 participant