Airblader commented on a change in pull request #17483:
URL: https://github.com/apache/flink/pull/17483#discussion_r729124623



##########
File path: 
flink-table/flink-table-planner/src/main/scala/org/apache/flink/table/planner/codegen/GenerateUtils.scala
##########
@@ -504,6 +504,19 @@ object GenerateUtils {
     GeneratedExpression(resultTerm, NEVER_NULL, resultCode, resultType)
   }
 
+  def generateRowKind(ctx: CodeGeneratorContext): GeneratedExpression = {
+    val resultType = new VarCharType(2)
+    val resultTypeTerm = primitiveTypeTermForType(resultType)
+    val resultTerm = ctx.addReusableLocalVariable(resultTypeTerm, "rowKind")
+    val resultCode =
+      s"""
+         |$resultTerm = 
org.apache.flink.table.data.binary.BinaryStringData.fromString(
+         |$DEFAULT_INPUT1_TERM.getRowKind().shortString());
+         |""".stripMargin.trim
+    // the proctime has been materialized, so it's TIMESTAMP now, not 
PROCTIME_INDICATOR

Review comment:
       This comment makes no sense. Copy paste?

##########
File path: 
flink-table/flink-table-planner/src/main/scala/org/apache/flink/table/planner/codegen/calls/StringCallGen.scala
##########
@@ -223,6 +222,9 @@ object StringCallGen {
           isCharacterString(operands(2).resultType) =>
         methodGen(BuiltInMethods.CONVERT_TZ)
 
+      case 
org.apache.flink.table.planner.functions.sql.FlinkSqlOperatorTable.ROW_KIND =>

Review comment:
       Please import `ROW_KIND` to shorten this.




-- 
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: issues-unsubscr...@flink.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to