Skip to content

Commit

Permalink
[CALCITE-6157] SqlValidatorImpl breaks join condition when inlining t…
Browse files Browse the repository at this point in the history
…able alias
  • Loading branch information
CoKueb committed Feb 14, 2024
1 parent c774c31 commit 7340bd0
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2276,6 +2276,12 @@ protected void registerNamespace(
if (namespace == null) {
namespaces.put(requireNonNull(ns.getNode()), ns);
namespace = ns;
} else {
// due to the identity map, it is possible that the namespace returned by the map is different from the namespace to register
// this can lead to bugs during runtime therefore we throw an exception here
if (ns.getEnclosingNode() != namespace.getEnclosingNode()) {
throw new RuntimeException("Namespace returned by identity hashmap has different enclosing node. Namespace to register: " + ns.getEnclosingNode() + ", Namespace returned by map: " + namespace.getEnclosingNode());
}
}
if (usingScope != null) {
assert alias != null : "Registering namespace " + ns + ", into scope " + usingScope
Expand Down

0 comments on commit 7340bd0

Please sign in to comment.