Xiao Li created SPARK-62365:
-------------------------------
Summary: Centralize argument-count error documentation references
and strengthen SQLSTATE checks
Key: SPARK-62365
URL: https://issues.apache.org/jira/browse/SPARK-62365
Project: Spark
Issue Type: Improvement
Components: SQL
Affects Versions: 4.3.0
Reporter: Xiao Li
{\{WRONG_NUM_ARGS.WITHOUT_SUGGESTION}} points users to the SQL functions
reference through the \{{<docroot>}} message parameter. Tests that check this
error refer to the documentation root in two different ways: some hardcode
\{{"https://spark.apache.org/docs/latest"}}, others use \{{SPARK_DOC_ROOT}}.
Many argument-count tests also skip the SQLSTATE check entirely; some pass
\{{sqlState = None}} explicitly. A regression in the SQLSTATE mapping for this
error would therefore not be caught.
This ticket proposes to:
* Add \{{QueryCompilationErrors.sqlFunctionsDocumentationRoot}}, which returns
\{{https://spark.apache.org/docs/latest}}, and use it when constructing
\{{WRONG_NUM_ARGS.WITHOUT_SUGGESTION}}.
* In test expectations, replace the repeated documentation-root literals and
\{{SPARK_DOC_ROOT}} with the shared helper, so the tests match what the error
factory produces.
* Add explicit SQLSTATE \{{42605}} assertions to argument-count error tests.
This includes replacing \{{sqlState = None}} in the DataFrame tests for
\{{coalesce}}, \{{hash}}, \{{xxhash64}}, \{{greatest}} and \{{least}}.
The changes cover Catalyst expression and type-checking tests, SQL/DataFrame
function tests, UDF tests, procedure tests, collation tests and Hive UDAF tests.
SQLSTATE \{{42605}} already exists in the error catalog for
\{{WRONG_NUM_ARGS}}. These changes only add missing test assertions and do not
introduce a new SQLSTATE. In standard builds the rendered error message does
not change.
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]