panbingkun commented on code in PR #46880:
URL: https://github.com/apache/spark/pull/46880#discussion_r1741369002
##########
sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/expressions/StringExpressionsSuite.scala:
##########
@@ -1987,7 +1987,7 @@ class StringExpressionsSuite extends SparkFunSuite with
ExpressionEvalHelper {
// Test escaping of arguments
GenerateUnsafeProjection.generate(
- Sentences(Literal("\"quote"), Literal("\"quote"), Literal("\"quote")) ::
Nil)
+ Sentences(Literal("\"quote"), Literal("\"quote"),
Literal("\"quote")).replacement :: Nil)
Review Comment:
We have to test `Sentences.replacement`, otherwise:
```
[INTERNAL_ERROR] Cannot generate code for expression: sentences("quote,
"quote, "quote) SQLSTATE: XX000
org.apache.spark.SparkException: [INTERNAL_ERROR] Cannot generate code for
expression: sentences("quote, "quote, "quote) SQLSTATE: XX000
at
org.apache.spark.SparkException$.internalError(SparkException.scala:92)
at
org.apache.spark.SparkException$.internalError(SparkException.scala:96)
at
org.apache.spark.sql.errors.QueryExecutionErrors$.cannotGenerateCodeForExpressionError(QueryExecutionErrors.scala:69)
at
org.apache.spark.sql.catalyst.expressions.RuntimeReplaceable.doGenCode(Expression.scala:426)
at
org.apache.spark.sql.catalyst.expressions.RuntimeReplaceable.doGenCode$(Expression.scala:425)
at
org.apache.spark.sql.catalyst.expressions.Sentences.doGenCode(stringExpressions.scala:3361)
at
org.apache.spark.sql.catalyst.expressions.Expression.$anonfun$genCode$3(Expression.scala:207)
```
--
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]