mihaibudiu commented on code in PR #4388:
URL: https://github.com/apache/calcite/pull/4388#discussion_r2094671067


##########
core/src/main/java/org/apache/calcite/sql/validate/SqlValidatorImpl.java:
##########
@@ -5874,6 +5874,11 @@ private void validateSnapshot(
         throw newValidationError(period,
             
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.

Review Comment:
   is SYSTEM_TIME even defined for a query?
   Or just for a table?
   If not, maybe the query should be rejected.



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