Skip to content

Commit 19bc9f9

Browse files
committed
Fix comparison between expressions and attributes
1 parent efb8a96 commit 19bc9f9

File tree

1 file changed

+3
-1
lines changed
  • x-pack/plugin/sql/src/main/java/org/elasticsearch/xpack/sql/analysis/analyzer

1 file changed

+3
-1
lines changed

x-pack/plugin/sql/src/main/java/org/elasticsearch/xpack/sql/analysis/analyzer/Verifier.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,9 @@ private static boolean checkGroupByOrder(LogicalPlan p, Set<Failure> localFailur
243243
return;
244244
}
245245

246-
if (Expressions.anyMatch(a.groupings(), e::semanticEquals)) {
246+
// make sure to compare attributes directly
247+
if (Expressions.anyMatch(a.groupings(),
248+
g -> e.semanticEquals(e instanceof Attribute ? Expressions.attribute(g) : g))) {
247249
return;
248250
}
249251

0 commit comments

Comments
 (0)