lihaosky commented on code in PR #27039:
URL: https://github.com/apache/flink/pull/27039#discussion_r2434432930


##########
flink-table/flink-table-planner/src/main/java/org/apache/calcite/sql/validate/SqlValidatorImpl.java:
##########
@@ -2614,6 +2618,27 @@ private SqlNode registerFrom(
                         scopes.put(node, getSelectScope(call1.operand(0)));
                         return newNode;
                     }
+
+                    // Related to CALCITE-4077
+                    // ----- FLINK MODIFICATION BEGIN -----
+                    FlinkSqlCallBinding binding =
+                            new FlinkSqlCallBinding(this, getEmptyScope(), 
call1);
+                    if (op instanceof SqlVectorSearchTableFunction
+                            && binding.operand(0)
+                                    .isA(
+                                            new HashSet<>(
+                                                    
Collections.singletonList(SqlKind.SELECT)))) {
+                        boolean queryColumnIsNotLiteral =
+                                binding.operand(2).getKind() != 
SqlKind.LITERAL;
+                        if (!queryColumnIsNotLiteral && !lateral) {

Review Comment:
   Got it. I guess it's more clear to have something like 
https://github.com/apache/flink/pull/26553/files#diff-19970e8600e459e820e1310beed925a10450f695698257d85648e8114b5e5aaeR92
 to indicate it's not invalid case.



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