julianhyde commented on code in PR #3201:
URL: https://github.com/apache/calcite/pull/3201#discussion_r1194355537


##########
core/src/main/java/org/apache/calcite/sql/validate/IdentifierNamespace.java:
##########
@@ -258,6 +258,9 @@ public SqlIdentifier getId() {
   }
 
   @Override public @Nullable SqlValidatorTable getTable() {
+    if (resolvedNamespace == null) {
+      validator.validateNamespace(this, validator.unknownType);
+    }
     return resolvedNamespace == null ? null : resolve().getTable();

Review Comment:
   I had the same thought.  And when I removed the `resolvedNamespace == null` 
check, 4 tests in `SqlAdvisorTest` broke. 
   
   We seem to be violating the efforts of `AbstractNamespace.validate` to 
ensure that a particular namespace aren't under validation more than once, and 
that after validation has finished, `IdentifierNamespace.resolvedNamespace` is 
correctly set.



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