You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by "MaxGekk (via GitHub)" <gi...@apache.org> on 2024/09/10 16:14:43 UTC
Re: [PR] [SPARK-49398][SQL] Improve the error for parameters in the query of CACHE TABLE and CREATE VIEW [spark]
MaxGekk commented on code in PR #48055:
URL: https://github.com/apache/spark/pull/48055#discussion_r1752270062
##########
sql/core/src/test/scala/org/apache/spark/sql/ParametersSuite.scala:
##########
@@ -715,4 +715,30 @@ class ParametersSuite extends QueryTest with SharedSparkSession with PlanTest {
spark.sessionState.analyzer.executeAndCheck(analyzedPlan, df.queryExecution.tracker)
checkAnswer(df, Row(11))
}
+
+ test("SPARK-49398: Cache Table with parameter markers in select query should throw " +
+ "UNSUPPORTED_FEATURE.PARAMETER_MARKER_IN_UNEXPECTED_STATEMENT") {
+ val sqlText = "CACHE TABLE CacheTable as SELECT 1 + :param1"
+ checkError(
+ exception = intercept[AnalysisException] {
+ spark.sql(sqlText, Map("param1" -> "1")).show()
+ },
+ errorClass = "UNSUPPORTED_FEATURE.PARAMETER_MARKER_IN_UNEXPECTED_STATEMENT",
Review Comment:
@dongjoon-hyun @HyukjinKwon @cloud-fan FYI, after the commit https://github.com/apache/spark/commit/0fd91c7805b8ad7e7f88665ecc59091d969499b5 be careful merging PRs that use `checkError`. They might need to rebase on the recent master, and rename `errorClass`.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org