luoyuxia commented on code in PR #21609:
URL: https://github.com/apache/flink/pull/21609#discussion_r1066727574
##########
flink-table/flink-table-planner/src/main/scala/org/apache/flink/table/planner/codegen/GenerateUtils.scala:
##########
@@ -304,9 +304,10 @@ object GenerateUtils {
// as they're not cheap to construct. For the other types, the return
term is directly
// the literal value
case CHAR | VARCHAR =>
- val str = literalValue.asInstanceOf[BinaryStringData]
- val field =
ctx.addReusableEscapedStringConstant(EncodingUtils.escapeJava(str.toString))
- generateNonNullLiteral(literalType, field, str)
+ val escapedValue =
+
EncodingUtils.escapeJava(literalValue.asInstanceOf[BinaryStringData].toString)
Review Comment:
Actually, I think just revert it may bring regression for after revert, it
will call method `StringData.fromString` which is not cheap to construct just
as said the above comments.
But to fix it, I propose a change [in here
](https://github.com/apache/flink/pull/21084/files#diff-0669c65cfa2a6fb7624b2140773f2d5edc2bd5a956fa81abaecfe65cbbaff739R55),
which I think it may avoid regression as well as fixing this issue.
--
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]