godfreyhe commented on a change in pull request #17845:
URL: https://github.com/apache/flink/pull/17845#discussion_r773901184



##########
File path: 
flink-table/flink-table-planner/src/main/java/org/apache/calcite/sql/validate/SqlValidatorImpl.java
##########
@@ -4711,6 +4711,11 @@ private void validateSnapshot(SqlNode node, 
SqlValidatorScope scope, SqlValidato
                         Static.RESOURCE.illegalExpressionForTemporal(
                                 dataType.getSqlTypeName().getName()));
             }
+            if (ns instanceof IdentifierNamespace && ns.resolve() instanceof 
WithItemNamespace) {
+                // If the snapshot is used over a CTE, then we don't have a 
concrete underlying
+                // table to operate on. This will be rechecked later in the 
planner rules.
+                return;

Review comment:
       @YuvalItzchakov do you want to add null check ?




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