Skip to content

Commit

Permalink
Match can't be used after STATS .. BY until filters can be pushed dow…
Browse files Browse the repository at this point in the history
…n below STATS
  • Loading branch information
carlosdelest committed Nov 12, 2024
1 parent be43c97 commit 994268b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -688,7 +688,7 @@ private static void checkFullTextQueryFunctions(LogicalPlan plan, Set<Failure> f
plan,
condition,
Match.class,
lp -> (lp instanceof Limit == false),
lp -> (lp instanceof Limit == false) && (lp instanceof Aggregate == false),
m -> "[" + m.functionName() + "] " + m.functionType(),
failures
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1155,6 +1155,10 @@ public void testMatchFunctionNotAllowedAfterCommands() throws Exception {
"1:24: [MATCH] function cannot be used after LIMIT",
error("from test | limit 10 | where match(first_name, \"Anna\")")
);
assertEquals(
"1:47: [MATCH] function cannot be used after STATS",
error("from test | STATS c = AVG(salary) BY gender | where match(gender, \"F\")")
);
}

public void testMatchFunctionAndOperatorHaveCorrectErrorMessages() throws Exception {
Expand Down

0 comments on commit 994268b

Please sign in to comment.