godfreyhe commented on a change in pull request #17845: URL: https://github.com/apache/flink/pull/17845#discussion_r772888377
########## 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 Y I think you can throw `CalciteContextException` directly, just call `newValidationError()` -- 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-unsubscr...@flink.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org