Skip to content

[SPARK-38719][SQL] Test the error class: CANNOT_CAST_DATATYPE - #54694

Open
deepujain wants to merge 1 commit into
apache:masterfrom
deepujain:SPARK-38719-cannot-cast-datatype-test
Open

[SPARK-38719][SQL] Test the error class: CANNOT_CAST_DATATYPE#54694
deepujain wants to merge 1 commit into
apache:masterfrom
deepujain:SPARK-38719-cannot-cast-datatype-test

Conversation

@deepujain

@deepujain deepujain commented Mar 9, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds coverage for the CANNOT_CAST_DATATYPE error class in QueryExecutionErrors. The test exercises the null-type cast helper and verifies the error class, SQLSTATE, and message parameters.

Change

  • QueryExecutionErrorsSuite.scala: Added SPARK-38719: CANNOT_CAST_DATATYPE, covering QueryExecutionErrors.cannotCastFromNullTypeError(IntegerType) and asserting sourceType, targetType, and sqlState 42846.

Tests

Ran ./build/sbt "sql/testOnly org.apache.spark.sql.errors.QueryExecutionErrorsSuite -- -z SPARK-38719" - passed.

Fixes SPARK-38719

JIRA assignee for credit: deepujain

@deepujain
deepujain force-pushed the SPARK-38719-cannot-cast-datatype-test branch from cdffecf to 375bf74 Compare March 12, 2026 04:51
@deepujain

Copy link
Copy Markdown
Contributor Author

Rebased on master. Ran sql/testOnly org.apache.spark.sql.errors.QueryExecutionErrorsSuite SPARK-38719 locally passed. Ready for CI.

@deepujain
deepujain force-pushed the SPARK-38719-cannot-cast-datatype-test branch from 375bf74 to 1728033 Compare May 27, 2026 20:02
@deepujain

Copy link
Copy Markdown
Contributor Author

Rebased on current master and fixed the PR description so it now matches SPARK-38719. Ran ./build/sbt "sql/testOnly org.apache.spark.sql.errors.QueryExecutionErrorsSuite -- -z SPARK-38719" - passed. Ready for CI.

@deepujain
deepujain force-pushed the SPARK-38719-cannot-cast-datatype-test branch from 1728033 to 9805234 Compare June 26, 2026 15:46
@deepujain

Copy link
Copy Markdown
Contributor Author

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

@deepujain
deepujain force-pushed the SPARK-38719-cannot-cast-datatype-test branch from 9805234 to 161bfee Compare July 2, 2026 09:17
@deepujain

Copy link
Copy Markdown
Contributor Author

Rebased this on current master and resolved the import conflict in QueryExecutionErrorsSuite. I reran ./build/sbt "sql/testOnly org.apache.spark.sql.errors.QueryExecutionErrorsSuite -- -z SPARK-38719" locally; it passed. Ready for CI.

@deepujain
deepujain force-pushed the SPARK-38719-cannot-cast-datatype-test branch from 161bfee to f1151d0 Compare July 3, 2026 01:39
@deepujain

Copy link
Copy Markdown
Contributor Author

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

@deepujain
deepujain force-pushed the SPARK-38719-cannot-cast-datatype-test branch from f1151d0 to d319803 Compare July 6, 2026 10:48
@deepujain

Copy link
Copy Markdown
Contributor Author

Rebased again on current master to refresh the red fork Build check. I reran ./build/sbt "sql/testOnly org.apache.spark.sql.errors.QueryExecutionErrorsSuite -- -z SPARK-38719" locally; it passed. CI has restarted on the new head.

@deepujain
deepujain force-pushed the SPARK-38719-cannot-cast-datatype-test branch from d319803 to ee55a19 Compare July 7, 2026 06:36
@deepujain

Copy link
Copy Markdown
Contributor Author

Rebased again on current master to pick up the upstream fix for the ./dev/lint-scala line-length failure. I reran ./build/sbt "sql/testOnly org.apache.spark.sql.errors.QueryExecutionErrorsSuite -- -z SPARK-38719" and ./dev/lint-scala locally; both passed. CI has restarted on the new head.

@deepujain
deepujain force-pushed the SPARK-38719-cannot-cast-datatype-test branch from ee55a19 to 97a6200 Compare July 9, 2026 07:13
@deepujain

Copy link
Copy Markdown
Contributor Author

Rebased on current master again. I reran ./build/sbt "sql/testOnly org.apache.spark.sql.errors.QueryExecutionErrorsSuite -- -z SPARK-38719" locally; it passed. CI has restarted on the new head.

@deepujain
deepujain force-pushed the SPARK-38719-cannot-cast-datatype-test branch from 97a6200 to b03aa9e Compare July 9, 2026 09:21
@deepujain

Copy link
Copy Markdown
Contributor Author

Refreshed the branch after the GitHub runner shut down the sql - extended tests job. This was a no-source-change amend, so the Spark diff is unchanged; earlier today I ran ./build/sbt "sql/testOnly org.apache.spark.sql.errors.QueryExecutionErrorsSuite -- -z SPARK-38719" locally and it passed. CI is starting again on the new head.

@deepujain
deepujain force-pushed the SPARK-38719-cannot-cast-datatype-test branch from b03aa9e to f932c49 Compare July 9, 2026 23:51
@deepujain

Copy link
Copy Markdown
Contributor Author

Rebased on current master after the Docker integration job from yesterday was cancelled. I reran ./build/sbt "sql/testOnly org.apache.spark.sql.errors.QueryExecutionErrorsSuite -- -z SPARK-38719" locally on the rebased head; it passed. CI has restarted on the new head.

@deepujain
deepujain force-pushed the SPARK-38719-cannot-cast-datatype-test branch from f932c49 to cb94d36 Compare July 10, 2026 03:07
@deepujain

Copy link
Copy Markdown
Contributor Author

Rebased on current master again after master moved to the parser-based SQL splitter change. I reran ./build/sbt "sql/testOnly org.apache.spark.sql.errors.QueryExecutionErrorsSuite -- -z SPARK-38719" locally on the rebased head; it passed. CI has restarted on the new head.

@deepujain
deepujain force-pushed the SPARK-38719-cannot-cast-datatype-test branch from cb94d36 to dd7aaf1 Compare July 11, 2026 03:48
@deepujain

Copy link
Copy Markdown
Contributor Author

Rebased on current master after the latest Python Arrow change landed. I reran ./build/sbt "sql/testOnly org.apache.spark.sql.errors.QueryExecutionErrorsSuite -- -z SPARK-38719" locally on the rebased head; it passed. Ready for CI.

@deepujain
deepujain force-pushed the SPARK-38719-cannot-cast-datatype-test branch from dd7aaf1 to d598c94 Compare July 12, 2026 16:44
@deepujain

Copy link
Copy Markdown
Contributor Author

Rebased on current master after SPARK-58064 landed. I reran ./build/sbt "sql/testOnly org.apache.spark.sql.errors.QueryExecutionErrorsSuite -- -z SPARK-38719" locally on the rebased head; it passed. Ready for CI.

@deepujain
deepujain force-pushed the SPARK-38719-cannot-cast-datatype-test branch from d598c94 to 31a1619 Compare July 13, 2026 00:34
@deepujain

Copy link
Copy Markdown
Contributor Author

Rebased on current master after SPARK-57884 landed. I reran ./build/sbt "sql/testOnly org.apache.spark.sql.errors.QueryExecutionErrorsSuite -- -z SPARK-38719" locally on the rebased head; it passed. Ready for CI.

@deepujain
deepujain force-pushed the SPARK-38719-cannot-cast-datatype-test branch from 31a1619 to 5a4fa7d Compare July 14, 2026 09:15
@deepujain

Copy link
Copy Markdown
Contributor Author

Rebased on current master after SPARK-58104 landed. I reran ./build/sbt "sql/testOnly org.apache.spark.sql.errors.QueryExecutionErrorsSuite -- -z SPARK-38719" locally on the rebased head; it passed. Ready for CI.

@deepujain

Copy link
Copy Markdown
Contributor Author

Rebased on current master after SPARK-58341 landed. I reran ./build/sbt "sql/testOnly org.apache.spark.sql.errors.QueryExecutionErrorsSuite -- -z SPARK-38719" locally on the rebased head; it passed. Ready for CI.

@deepujain
deepujain force-pushed the SPARK-38719-cannot-cast-datatype-test branch from ac370a3 to 08c04e0 Compare July 26, 2026 12:45
@deepujain

Copy link
Copy Markdown
Contributor Author

Rebased on current master after SPARK-58192 landed. I reran ./build/sbt "sql/testOnly org.apache.spark.sql.errors.QueryExecutionErrorsSuite -- -z SPARK-38719" locally on the rebased head; it passed. Ready for CI.

@deepujain
deepujain force-pushed the SPARK-38719-cannot-cast-datatype-test branch from 08c04e0 to 7ae879c Compare July 29, 2026 06:18
@deepujain

Copy link
Copy Markdown
Contributor Author

Rebased on current master after SPARK-58321 landed. I reran ./build/sbt "sql/testOnly org.apache.spark.sql.errors.QueryExecutionErrorsSuite -- -z SPARK-38719" locally on the rebased head; it passed. Ready for CI.

@deepujain
deepujain force-pushed the SPARK-38719-cannot-cast-datatype-test branch from 7ae879c to 8c50479 Compare August 4, 2026 07:53
@deepujain

Copy link
Copy Markdown
Contributor Author

Rebased on current master after SPARK-58535 landed. I reran ./build/sbt "sql/testOnly org.apache.spark.sql.errors.QueryExecutionErrorsSuite -- -z SPARK-38719" locally on the rebased head; it passed. Ready for CI.

@deepujain
deepujain force-pushed the SPARK-38719-cannot-cast-datatype-test branch from 8c50479 to 272e2b5 Compare August 4, 2026 13:01
@deepujain

Copy link
Copy Markdown
Contributor Author

Rebased on current master after SPARK-58546 landed. I reran ./build/sbt "sql/testOnly org.apache.spark.sql.errors.QueryExecutionErrorsSuite -- -z SPARK-38719" locally on the rebased head; it passed. Ready for CI.

@deepujain
deepujain force-pushed the SPARK-38719-cannot-cast-datatype-test branch from 272e2b5 to 6c4a322 Compare August 4, 2026 18:32
@deepujain

Copy link
Copy Markdown
Contributor Author

Rebased on current master after SPARK-58435 landed. I reran ./build/sbt "sql/testOnly org.apache.spark.sql.errors.QueryExecutionErrorsSuite -- -z SPARK-38719" locally on the rebased head; it passed. Ready for CI.

@deepujain
deepujain force-pushed the SPARK-38719-cannot-cast-datatype-test branch from 6c4a322 to 3974cf9 Compare August 5, 2026 05:28
@deepujain

Copy link
Copy Markdown
Contributor Author

Rebased on current master after SPARK-58548 landed. I reran ./build/sbt "sql/testOnly org.apache.spark.sql.errors.QueryExecutionErrorsSuite -- -z SPARK-38719" locally on the rebased head; it passed. Ready for CI.

@deepujain
deepujain force-pushed the SPARK-38719-cannot-cast-datatype-test branch from 3974cf9 to 9b3a967 Compare August 6, 2026 09:03
@deepujain

Copy link
Copy Markdown
Contributor Author

Rebased on current master after SPARK-58501 landed. I reran ./build/sbt "sql/testOnly org.apache.spark.sql.errors.QueryExecutionErrorsSuite -- -z SPARK-38719" locally on the rebased head; it passed. Ready for CI.

@deepujain
deepujain force-pushed the SPARK-38719-cannot-cast-datatype-test branch from 9b3a967 to 80f9785 Compare August 7, 2026 12:45
@deepujain

Copy link
Copy Markdown
Contributor Author

Rebased on current master after SPARK-58174 landed. I reran ./build/sbt "sql/testOnly org.apache.spark.sql.errors.QueryExecutionErrorsSuite -- -z SPARK-38719" locally on the rebased head; it passed. Ready for CI.

@deepujain
deepujain force-pushed the SPARK-38719-cannot-cast-datatype-test branch from 80f9785 to 37b7ebf Compare August 9, 2026 04:51
@deepujain

Copy link
Copy Markdown
Contributor Author

Rebased on current master after SPARK-45900 landed. I reran ./build/sbt "sql/testOnly org.apache.spark.sql.errors.QueryExecutionErrorsSuite -- -z SPARK-38719" locally on the rebased head; it passed. Ready for CI.

@deepujain
deepujain force-pushed the SPARK-38719-cannot-cast-datatype-test branch from 37b7ebf to 7082e09 Compare August 9, 2026 14:02
@deepujain

Copy link
Copy Markdown
Contributor Author

Rebased on current master after SPARK-58549 landed. I reran ./build/sbt "sql/testOnly org.apache.spark.sql.errors.QueryExecutionErrorsSuite -- -z SPARK-38719" locally on the rebased head; it passed. Ready for CI.

@deepujain
deepujain force-pushed the SPARK-38719-cannot-cast-datatype-test branch from 7082e09 to 361ba70 Compare August 10, 2026 05:12
@deepujain

Copy link
Copy Markdown
Contributor Author

Rebased on current master after SPARK-58674 landed. I reran ./build/sbt "sql/testOnly org.apache.spark.sql.errors.QueryExecutionErrorsSuite -- -z SPARK-38719" locally on the rebased head; it passed. Ready for CI.

@deepujain
deepujain force-pushed the SPARK-38719-cannot-cast-datatype-test branch from 361ba70 to ee6b6aa Compare August 11, 2026 04:50
@deepujain

Copy link
Copy Markdown
Contributor Author

Rebased on current master after SPARK-58232 landed. I reran ./build/sbt "sql/testOnly org.apache.spark.sql.errors.QueryExecutionErrorsSuite -- -z SPARK-38719" locally on the rebased head; it passed. Ready for CI.

@deepujain
deepujain force-pushed the SPARK-38719-cannot-cast-datatype-test branch from ee6b6aa to 28412a1 Compare August 11, 2026 14:42
@deepujain

Copy link
Copy Markdown
Contributor Author

Rebased on current master to refresh the stale pending Build check. I reran JAVA_HOME=/opt/homebrew/opt/openjdk@17/libexec/openjdk.jdk/Contents/Home PATH="/opt/homebrew/opt/openjdk@17/libexec/openjdk.jdk/Contents/Home/bin:$PATH" SBT_OPTS="-Dspark.driver.bindAddress=127.0.0.1 -Dspark.driver.host=127.0.0.1" ./build/sbt "sql/testOnly org.apache.spark.sql.errors.QueryExecutionErrorsSuite -- -z SPARK-38719" locally; it passed. CI has restarted on the new head.

@deepujain
deepujain force-pushed the SPARK-38719-cannot-cast-datatype-test branch from 28412a1 to e00e8b8 Compare August 11, 2026 14:51
@deepujain

Copy link
Copy Markdown
Contributor Author

Spark master moved again during the sweep, so I rebased once more. I reran JAVA_HOME=/opt/homebrew/opt/openjdk@17/libexec/openjdk.jdk/Contents/Home PATH="/opt/homebrew/opt/openjdk@17/libexec/openjdk.jdk/Contents/Home/bin:$PATH" SBT_OPTS="-Dspark.driver.bindAddress=127.0.0.1 -Dspark.driver.host=127.0.0.1" ./build/sbt "sql/testOnly org.apache.spark.sql.errors.QueryExecutionErrorsSuite -- -z SPARK-38719" locally; it passed. CI has restarted on the latest head.

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