godfreyhe commented on a change in pull request #14315: URL: https://github.com/apache/flink/pull/14315#discussion_r539814663
########## File path: flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/planner/plan/nodes/FlinkRelNode.scala ########## @@ -89,19 +89,31 @@ trait FlinkRelNode extends RelNode { val ops = c.getOperands.map( getExpressionString(_, inFields, localExprsTable, expressionFormat)) c.getOperator match { - case _ : SqlAsOperator => ops.head + case _: SqlAsOperator => ops.head case _ => - expressionFormat match { - case ExpressionFormat.Infix if ops.size() == 1 => - val operand = ops.head - c.getKind match { - case IS_FALSE | IS_NOT_FALSE | IS_TRUE | IS_NOT_TRUE | IS_UNKNOWN | IS_NULL | - IS_NOT_NULL => s"$operand $op" - case _ => s"$op($operand)" - } - case ExpressionFormat.Infix => s"(${ops.mkString(s" $op ")})" - case ExpressionFormat.PostFix => s"(${ops.mkString(", ")})$op" - case ExpressionFormat.Prefix => s"$op(${ops.mkString(", ")})" + if (ops.size() == 1) { + val operand = ops.head + c.getKind match { + case IS_FALSE | IS_NOT_FALSE | IS_TRUE | IS_NOT_TRUE | IS_UNKNOWN + | IS_NULL | IS_NOT_NULL => s"$operand $op" + case _ => s"$op($operand)" + } + } else { + c.getKind match { + case TIMES | DIVIDE | PLUS | MINUS Review comment: The udfs should be prefix format. `my_add(a, b)` for prefix format is easier readable than `a my_add b` for infix format. ---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: us...@infra.apache.org