Skip to content

Commit 3d1f8d2

Browse files
authored
Don't throw VerificationException on illegal state (#118826) (#119014)
If we end up here, we need to know this - and we won't know it if we return a 400 to the user. This should be a 500.
1 parent 5b9cb89 commit 3d1f8d2

File tree

1 file changed

+3
-9
lines changed
  • x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/analysis

1 file changed

+3
-9
lines changed

x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/analysis/Analyzer.java

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -691,15 +691,9 @@ private List<Attribute> resolveUsingColumns(List<Attribute> cols, List<Attribute
691691
resolvedCol = ucol.withUnresolvedMessage(message.replace(match, match + " in " + side + " side of join"));
692692
}
693693
resolved.add(resolvedCol);
694-
}
695-
// columns are expected to be unresolved - if that's not the case return an error
696-
else {
697-
return singletonList(
698-
new UnresolvedAttribute(
699-
col.source(),
700-
col.name(),
701-
"Surprised to discover column [ " + col.name() + "] already resolved"
702-
)
694+
} else {
695+
throw new IllegalStateException(
696+
"Surprised to discover column [ " + col.name() + "] already resolved when resolving JOIN keys"
703697
);
704698
}
705699
}

0 commit comments

Comments
 (0)