From 5cc59979a6d302db08accdc31232d6f7d9ca3d25 Mon Sep 17 00:00:00 2001 From: morrySnow <101034200+morrySnow@users.noreply.github.com> Date: Tue, 13 Aug 2024 19:29:13 +0800 Subject: [PATCH] [opt](set operation) INTERSECT should evaluated before others (#39095) pick from master #39095 this is a behaviour change PR. set operation INTERSECT should evaluated before others. In Doris history, all set operators have same priority. This PR change Nereids, let it be same with MySQL. --- .../src/main/antlr4/org/apache/doris/nereids/DorisParser.g4 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fe/fe-core/src/main/antlr4/org/apache/doris/nereids/DorisParser.g4 b/fe/fe-core/src/main/antlr4/org/apache/doris/nereids/DorisParser.g4 index 7b56e1479c4089..5ea1ce2c2e587b 100644 --- a/fe/fe-core/src/main/antlr4/org/apache/doris/nereids/DorisParser.g4 +++ b/fe/fe-core/src/main/antlr4/org/apache/doris/nereids/DorisParser.g4 @@ -347,7 +347,8 @@ query queryTerm : queryPrimary #queryTermDefault - | left=queryTerm operator=(UNION | EXCEPT | MINUS | INTERSECT) + | left=queryTerm operator=INTERSECT setQuantifier? right=queryTerm #setOperation + | left=queryTerm operator=(UNION | EXCEPT | MINUS) setQuantifier? right=queryTerm #setOperation ;