You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "fsk119 (via GitHub)" <gi...@apache.org> on 2024/02/01 02:37:16 UTC

Re: [PR] [FLINK-34312][table] Improve the handling of default node types for named parameters [flink]

fsk119 commented on code in PR #24235:
URL: https://github.com/apache/flink/pull/24235#discussion_r1473714147


##########
flink-table/flink-table-planner/src/main/java/org/apache/flink/table/planner/functions/inference/OperatorBindingCallContext.java:
##########
@@ -59,7 +59,7 @@ public OperatorBindingCallContext(
                 sqlOperatorBinding.getOperator().getNameAsId().toString(),
                 sqlOperatorBinding.getGroupCount() > 0);
 
-        this.binding = new OperatorBindingDecorator(sqlOperatorBinding);
+        this.binding = sqlOperatorBinding;

Review Comment:
   nit: sqlOperatorBinding -> binding



##########
flink-table/flink-table-planner/src/main/java/org/apache/flink/table/planner/calcite/FlinkSqlCallBinding.java:
##########
@@ -77,20 +76,15 @@ public List<SqlNode> operands() {
 
     @Override
     public RelDataType getOperandType(int ordinal) {
-        return isNamedArgument() && !argumentTypes.isEmpty()
+        return isNamedArgument()
                 ? ((SqlOperandMetadata) getCall().getOperator().getOperandTypeChecker())
                         .paramTypes(typeFactory)
                         .get(ordinal)
                 : super.getOperandType(ordinal);
     }
 
     public boolean isNamedArgument() {
-        for (SqlNode operand : getCall().getOperandList()) {
-            if (operand != null && operand.getKind() == SqlKind.ARGUMENT_ASSIGNMENT) {
-                return !getArgumentTypes().isEmpty();
-            }
-        }
-        return false;
+        return !argumentTypes.isEmpty();

Review Comment:
   If the arugment types is empty, it means the function's parameter is fixed comparing to var-length parameters. At this point, I think it's better to align the concepts with calcite. What about isFixedParameters here and rename argumentTypes to fixedArgumentTypes? 



-- 
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-unsubscribe@flink.apache.org

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