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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]