snuyanzin commented on code in PR #27983:
URL: https://github.com/apache/flink/pull/27983#discussion_r3116938173


##########
flink-table/flink-table-planner/src/main/scala/org/apache/flink/table/planner/codegen/calls/ScalarOperatorGens.scala:
##########
@@ -1740,16 +1740,17 @@ object ScalarOperatorGens {
       resultTerm: String,
       nullTerm: String,
       tmpValue: String): String = {
+    val escapedFieldName = EncodingUtils.escapeJava(fieldName)
     s"""
        |  if ($variantTerm.isObject()){
-       |    $variantTypeTerm $tmpValue = $variantTerm.getField("$fieldName");
+       |    $variantTypeTerm $tmpValue = 
$variantTerm.getField("$escapedFieldName");
        |    if ($tmpValue == null) {
        |      $nullTerm = true;
        |    } else {
        |      $resultTerm = $tmpValue;
        |    }
        |  } else {
-       |    throw new org.apache.flink.table.api.TableRuntimeException("String 
key access on variant requires an object variant, but a non-object variant was 
provided.");
+       |    throw new ${className[TableRuntimeException]}("String key access 
on variant requires an object variant, but a non-object variant was provided.");

Review Comment:
   should we do same for other occurrences (may be at least in this class)
   in this class we have 3



-- 
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]

Reply via email to