This is an automated email from the ASF dual-hosted git repository.

rameshkumar pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/hive.git


The following commit(s) were added to refs/heads/master by this push:
     new 3af6fcadf7b HIVE-28321 Support select alias in the having clause for 
CBO (Ramesh Kumar, reviewed by Soumyakanti Das, Stamatis Zampetakis)
3af6fcadf7b is described below

commit 3af6fcadf7bc58e8f601c091ee6f1bfd50848231
Author: Ramesh Kumar <[email protected]>
AuthorDate: Tue Jul 30 11:16:13 2024 -0700

    HIVE-28321 Support select alias in the having clause for CBO (Ramesh Kumar, 
reviewed by Soumyakanti Das, Stamatis Zampetakis)
---
 .../src/test/queries/clientpositive/having.q       |  1 +
 .../hadoop/hive/ql/parse/CalcitePlanner.java       | 63 ++-----------------
 .../apache/hadoop/hive/ql/parse/RowResolver.java   | 15 +++++
 .../hadoop/hive/ql/parse/SemanticAnalyzer.java     |  6 +-
 .../clientpositive/groupby_grouping_window.q       |  1 +
 ql/src/test/queries/clientpositive/having.q        |  6 +-
 .../clientpositive/limit_pushdown_negative.q       |  1 +
 ql/src/test/queries/clientpositive/prepare_plan.q  |  1 +
 .../vector_groupby_grouping_window.q               |  1 +
 .../llap/groupby_grouping_window.q.out             |  2 +-
 .../test/results/clientpositive/llap/having.q.out  | 27 +++++++++
 .../results/clientpositive/llap/prepare_plan.q.out | 70 +++++++++++-----------
 .../llap/vector_groupby_grouping_window.q.out      |  2 +-
 13 files changed, 94 insertions(+), 102 deletions(-)

diff --git a/itests/hive-blobstore/src/test/queries/clientpositive/having.q 
b/itests/hive-blobstore/src/test/queries/clientpositive/having.q
index 68ccff73720..fb40c95ff5c 100644
--- a/itests/hive-blobstore/src/test/queries/clientpositive/having.q
+++ b/itests/hive-blobstore/src/test/queries/clientpositive/having.q
@@ -1,4 +1,5 @@
 -- Test HAVING clause
+set hive.cbo.fallback.strategy=NEVER;
 
 DROP TABLE having_blobstore_test;
 CREATE TABLE having_blobstore_test(a int, b int, c string)
diff --git a/ql/src/java/org/apache/hadoop/hive/ql/parse/CalcitePlanner.java 
b/ql/src/java/org/apache/hadoop/hive/ql/parse/CalcitePlanner.java
index e4bd4bfcb0f..6a55ee9147e 100644
--- a/ql/src/java/org/apache/hadoop/hive/ql/parse/CalcitePlanner.java
+++ b/ql/src/java/org/apache/hadoop/hive/ql/parse/CalcitePlanner.java
@@ -5161,7 +5161,10 @@ public class CalcitePlanner extends SemanticAnalyzer {
               UnsupportedFeature.Having_clause_without_any_groupby);
         }
         ASTNode targetNode = (ASTNode) havingClause.getChild(0);
-        validateNoHavingReferenceToAlias(qb, targetNode);
+        QBParseInfo qbPI = qb.getParseInfo();
+        Map<ASTNode, String> exprToAlias = qbPI.getAllExprToColumnAlias();
+        RowResolver inputRR = relToHiveRR.get(srcRel);
+        inputRR.putAll(exprToAlias);
         if (!qbp.getDestToGroupBy().isEmpty()) {
           final boolean cubeRollupGrpSetPresent = 
(!qbp.getDestRollups().isEmpty()
                   || !qbp.getDestGroupingSets().isEmpty() || 
!qbp.getDestCubes().isEmpty());
@@ -5188,64 +5191,6 @@ public class CalcitePlanner extends SemanticAnalyzer {
       return genFilterRelNode(qb, targetNode, srcRel, null, null, true);
     }
 
-    /*
-     * Bail if having clause uses Select Expression aliases for Aggregation
-     * expressions. We could do what Hive does. But this is non standard
-     * behavior. Making sure this doesn't cause issues when translating through
-     * Calcite is not worth it.
-     */
-    private void validateNoHavingReferenceToAlias(QB qb, ASTNode havingExpr)
-        throws CalciteSemanticException {
-
-      QBParseInfo qbPI = qb.getParseInfo();
-      Map<ASTNode, String> exprToAlias = qbPI.getAllExprToColumnAlias();
-      /*
-       * a mouthful, but safe: - a QB is guaranteed to have at least 1
-       * destination - we don't support multi insert, so picking the first 
dest.
-       */
-      Set<String> aggExprs = 
qbPI.getDestToAggregationExprs().values().iterator().next().keySet();
-
-      for (Map.Entry<ASTNode, String> selExpr : exprToAlias.entrySet()) {
-        ASTNode selAST = selExpr.getKey();
-        if (!aggExprs.contains(selAST.toStringTree().toLowerCase())) {
-          continue;
-        }
-        final String aliasToCheck = selExpr.getValue();
-        final Set<Object> aliasReferences = new HashSet<Object>();
-        TreeVisitorAction action = new TreeVisitorAction() {
-
-          @Override
-          public Object pre(Object t) {
-            if (ParseDriver.adaptor.getType(t) == HiveParser.TOK_TABLE_OR_COL) 
{
-              Object c = ParseDriver.adaptor.getChild(t, 0);
-              if (c != null && ParseDriver.adaptor.getType(c) == 
HiveParser.Identifier
-                  && ParseDriver.adaptor.getText(c).equals(aliasToCheck)) {
-                aliasReferences.add(t);
-              }
-            }
-            return t;
-          }
-
-          @Override
-          public Object post(Object t) {
-            return t;
-          }
-        };
-        new TreeVisitor(ParseDriver.adaptor).visit(havingExpr, action);
-
-        if (aliasReferences.size() > 0) {
-          String havingClause = ctx.getTokenRewriteStream().toString(
-              havingExpr.getTokenStartIndex(), havingExpr.getTokenStopIndex());
-          String msg = String.format("Encountered Select alias '%s' in having 
clause '%s'"
-              + " This non standard behavior is not supported with cbo on."
-              + " Turn off cbo for these queries.", aliasToCheck, 
havingClause);
-          LOG.debug(msg);
-          throw new CalciteSemanticException(msg, 
UnsupportedFeature.Select_alias_in_having_clause);
-        }
-      }
-
-    }
-
     private ImmutableMap<String, Integer> 
buildHiveToCalciteColumnMap(RowResolver rr) {
       ImmutableMap.Builder<String, Integer> b = new 
ImmutableMap.Builder<String, Integer>();
       for (ColumnInfo ci : rr.getRowSchema().getSignature()) {
diff --git a/ql/src/java/org/apache/hadoop/hive/ql/parse/RowResolver.java 
b/ql/src/java/org/apache/hadoop/hive/ql/parse/RowResolver.java
index dec7c57bc65..8dd50b594ca 100644
--- a/ql/src/java/org/apache/hadoop/hive/ql/parse/RowResolver.java
+++ b/ql/src/java/org/apache/hadoop/hive/ql/parse/RowResolver.java
@@ -125,6 +125,21 @@ public class RowResolver implements Serializable{
     return false;
   }
 
+  /**
+   * Puts a resolver entry corresponding to the expression and its
+   * column alias which is used for alias recognition in the latter constructs
+   * @param exprToColumnAlias
+   *          The map containing the expression to alias mapping
+   * @throws SemanticException
+   */
+  public void putAll(Map<ASTNode, String> exprToColumnAlias) throws 
SemanticException {
+    for (ASTNode astNode : exprToColumnAlias.keySet()) {
+      if (getExpression(astNode) != null) {
+        put("", exprToColumnAlias.get(astNode), getExpression(astNode));
+      }
+    }
+  }
+
   private void keepAmbiguousInfo(String col_alias, String tab_alias) {
     // we keep track of duplicate <tab alias, col alias> so that get can check
     // for ambiguity
diff --git a/ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzer.java 
b/ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzer.java
index 44e04e6c635..3ee45588c27 100644
--- a/ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzer.java
+++ b/ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzer.java
@@ -3489,11 +3489,7 @@ public class SemanticAnalyzer extends 
BaseSemanticAnalyzer {
     OpParseContext inputCtx = opParseCtx.get(input);
     RowResolver inputRR = inputCtx.getRowResolver();
     Map<ASTNode, String> exprToColumnAlias = 
qb.getParseInfo().getAllExprToColumnAlias();
-    for (ASTNode astNode : exprToColumnAlias.keySet()) {
-      if (inputRR.getExpression(astNode) != null) {
-        inputRR.put("", exprToColumnAlias.get(astNode), 
inputRR.getExpression(astNode));
-      }
-    }
+    inputRR.putAll(exprToColumnAlias);
     ASTNode condn = (ASTNode) havingExpr.getChild(0);
 
     if (!isCBOExecuted() && !qb.getParseInfo().getDestToGroupBy().isEmpty()) {
diff --git a/ql/src/test/queries/clientpositive/groupby_grouping_window.q 
b/ql/src/test/queries/clientpositive/groupby_grouping_window.q
index 7ec8752fbdc..1141b3e3163 100644
--- a/ql/src/test/queries/clientpositive/groupby_grouping_window.q
+++ b/ql/src/test/queries/clientpositive/groupby_grouping_window.q
@@ -1,4 +1,5 @@
 --! qt:dataset:src
+set hive.cbo.fallback.strategy=NEVER;
 create table t_n33(category int, live int, comments int);
 insert into table t_n33 select key, 0, 2 from src tablesample(3 rows);
 
diff --git a/ql/src/test/queries/clientpositive/having.q 
b/ql/src/test/queries/clientpositive/having.q
index d23f2d0f647..a55f7df19ec 100644
--- a/ql/src/test/queries/clientpositive/having.q
+++ b/ql/src/test/queries/clientpositive/having.q
@@ -1,6 +1,7 @@
 --! qt:dataset:src
 set hive.mapred.mode=nonstrict;
 set hive.explain.user=false;
+set hive.cbo.fallback.strategy=NEVER;
 -- SORT_QUERY_RESULTS
 EXPLAIN SELECT count(value) AS c FROM src GROUP BY key HAVING c > 3;
 SELECT count(value) AS c FROM src GROUP BY key HAVING c > 3;
@@ -18,4 +19,7 @@ EXPLAIN SELECT key, max(value) FROM src GROUP BY key HAVING 
max(value) > "val_25
 SELECT key, max(value) FROM src GROUP BY key HAVING max(value) > "val_255";
 
 EXPLAIN SELECT key, COUNT(value) FROM src GROUP BY key HAVING count(value) >= 
4;
-SELECT key, COUNT(value) FROM src GROUP BY key HAVING count(value) >= 4;
\ No newline at end of file
+SELECT key, COUNT(value) FROM src GROUP BY key HAVING count(value) >= 4;
+
+EXPLAIN CBO SELECT count(value) as c, max(key) as m from src GROUP BY key 
HAVING c > 3 and m > 400;
+SELECT count(value) as c, max(key) as m from src GROUP BY key HAVING c > 3 and 
m > 400;
diff --git a/ql/src/test/queries/clientpositive/limit_pushdown_negative.q 
b/ql/src/test/queries/clientpositive/limit_pushdown_negative.q
index 48f0c2af52b..c41be2860ad 100644
--- a/ql/src/test/queries/clientpositive/limit_pushdown_negative.q
+++ b/ql/src/test/queries/clientpositive/limit_pushdown_negative.q
@@ -1,6 +1,7 @@
 --! qt:dataset:src
 set hive.mapred.mode=nonstrict;
 set hive.limit.pushdown.memory.usage=0.3f;
+set hive.cbo.fallback.strategy=NEVER;
 
 -- negative, RS + join
 explain select * from src a join src b on a.key=b.key limit 20;
diff --git a/ql/src/test/queries/clientpositive/prepare_plan.q 
b/ql/src/test/queries/clientpositive/prepare_plan.q
index 5b727d415d9..c39ec866cfd 100644
--- a/ql/src/test/queries/clientpositive/prepare_plan.q
+++ b/ql/src/test/queries/clientpositive/prepare_plan.q
@@ -3,6 +3,7 @@
 --SORT_QUERY_RESULTS
 
 set hive.explain.user=false;
+set hive.cbo.fallback.strategy=NEVER;
 
 -- single param
 explain extended prepare pcount from select count(*) from src where key > ?;
diff --git 
a/ql/src/test/queries/clientpositive/vector_groupby_grouping_window.q 
b/ql/src/test/queries/clientpositive/vector_groupby_grouping_window.q
index 78f16234313..2c21601bad0 100644
--- a/ql/src/test/queries/clientpositive/vector_groupby_grouping_window.q
+++ b/ql/src/test/queries/clientpositive/vector_groupby_grouping_window.q
@@ -5,6 +5,7 @@ SET hive.vectorized.execution.reduce.enabled=true;
 set hive.vectorized.execution.ptf.enabled=true;
 set hive.fetch.task.conversion=none;
 set hive.cli.print.header=true;
+set hive.cbo.fallback.strategy=NEVER;
 
 create table t_n15(category int, live int, comments int) stored as orc;
 insert into table t_n15 select key, 0, 2 from src tablesample(3 rows);
diff --git 
a/ql/src/test/results/clientpositive/llap/groupby_grouping_window.q.out 
b/ql/src/test/results/clientpositive/llap/groupby_grouping_window.q.out
index 91b011b0988..7ea552290bc 100644
--- a/ql/src/test/results/clientpositive/llap/groupby_grouping_window.q.out
+++ b/ql/src/test/results/clientpositive/llap/groupby_grouping_window.q.out
@@ -60,7 +60,7 @@ STAGE PLANS:
                     Group By Operator
                       aggregations: max(live), max(comments)
                       keys: category (type: int), 0L (type: bigint)
-                      grouping sets: 1, 0
+                      grouping sets: 0, 1
                       minReductionHashAggr: 0.4
                       mode: hash
                       outputColumnNames: _col0, _col1, _col2, _col3
diff --git a/ql/src/test/results/clientpositive/llap/having.q.out 
b/ql/src/test/results/clientpositive/llap/having.q.out
index 8d124e3e0c1..73f0b68a8c5 100644
--- a/ql/src/test/results/clientpositive/llap/having.q.out
+++ b/ql/src/test/results/clientpositive/llap/having.q.out
@@ -1336,3 +1336,30 @@ POSTHOOK: Input: default@src
 468    4
 469    5
 489    4
+PREHOOK: query: EXPLAIN CBO SELECT count(value) as c, max(key) as m from src 
GROUP BY key HAVING c > 3 and m > 400
+PREHOOK: type: QUERY
+PREHOOK: Input: default@src
+#### A masked pattern was here ####
+POSTHOOK: query: EXPLAIN CBO SELECT count(value) as c, max(key) as m from src 
GROUP BY key HAVING c > 3 and m > 400
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@src
+#### A masked pattern was here ####
+CBO PLAN:
+HiveProject(c=[$1], m=[$2])
+  HiveFilter(condition=[AND(>($1, 3), >(CAST($2):DOUBLE, 400))])
+    HiveAggregate(group=[{0}], agg#0=[count($1)], agg#1=[max($0)])
+      HiveTableScan(table=[[default, src]], table:alias=[src])
+
+PREHOOK: query: SELECT count(value) as c, max(key) as m from src GROUP BY key 
HAVING c > 3 and m > 400
+PREHOOK: type: QUERY
+PREHOOK: Input: default@src
+#### A masked pattern was here ####
+POSTHOOK: query: SELECT count(value) as c, max(key) as m from src GROUP BY key 
HAVING c > 3 and m > 400
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@src
+#### A masked pattern was here ####
+4      406
+4      468
+4      489
+5      401
+5      469
diff --git a/ql/src/test/results/clientpositive/llap/prepare_plan.q.out 
b/ql/src/test/results/clientpositive/llap/prepare_plan.q.out
index d20ade93f20..6d1a0e180c7 100644
--- a/ql/src/test/results/clientpositive/llap/prepare_plan.q.out
+++ b/ql/src/test/results/clientpositive/llap/prepare_plan.q.out
@@ -400,49 +400,49 @@ STAGE PLANS:
             Map Operator Tree:
                 TableScan
                   alias: alltypesorc
-                  filterExpr: ((cint <= $1) and (cbigint <= $2) and (cfloat <> 
$3)) (type: boolean)
+                  filterExpr: ((cint <= UDFToInteger($1)) and (cbigint <= 
UDFToLong($2)) and (cfloat <> UDFToFloat($3))) (type: boolean)
                   Statistics: Num rows: 12288 Data size: 183480 Basic stats: 
COMPLETE Column stats: COMPLETE
                   Filter Operator
-                    predicate: ((cint <= $1) and (cbigint <= $2) and (cfloat 
<> $3)) (type: boolean)
+                    predicate: ((cint <= UDFToInteger($1)) and (cbigint <= 
UDFToLong($2)) and (cfloat <> UDFToFloat($3))) (type: boolean)
                     Statistics: Num rows: 1365 Data size: 20400 Basic stats: 
COMPLETE Column stats: COMPLETE
                     Select Operator
                       expressions: ctinyint (type: tinyint)
                       outputColumnNames: ctinyint
                       Statistics: Num rows: 1365 Data size: 20400 Basic stats: 
COMPLETE Column stats: COMPLETE
                       Group By Operator
-                        aggregations: avg(ctinyint)
+                        aggregations: sum(ctinyint), count(ctinyint)
                         keys: ctinyint (type: tinyint)
                         minReductionHashAggr: 0.9062271
                         mode: hash
-                        outputColumnNames: _col0, _col1
-                        Statistics: Num rows: 128 Data size: 10116 Basic 
stats: COMPLETE Column stats: COMPLETE
+                        outputColumnNames: _col0, _col1, _col2
+                        Statistics: Num rows: 128 Data size: 2436 Basic stats: 
COMPLETE Column stats: COMPLETE
                         Reduce Output Operator
                           key expressions: _col0 (type: tinyint)
                           null sort order: z
                           sort order: +
                           Map-reduce partition columns: _col0 (type: tinyint)
-                          Statistics: Num rows: 128 Data size: 10116 Basic 
stats: COMPLETE Column stats: COMPLETE
-                          value expressions: _col1 (type: 
struct<count:bigint,sum:double,input:tinyint>)
+                          Statistics: Num rows: 128 Data size: 2436 Basic 
stats: COMPLETE Column stats: COMPLETE
+                          value expressions: _col1 (type: bigint), _col2 
(type: bigint)
             Execution mode: llap
             LLAP IO: all inputs
         Reducer 2 
             Execution mode: llap
             Reduce Operator Tree:
               Group By Operator
-                aggregations: avg(VALUE._col0)
+                aggregations: sum(VALUE._col0), count(VALUE._col1)
                 keys: KEY._col0 (type: tinyint)
                 mode: mergepartial
-                outputColumnNames: _col0, _col1
-                Statistics: Num rows: 128 Data size: 1412 Basic stats: 
COMPLETE Column stats: COMPLETE
+                outputColumnNames: _col0, _col1, _col2
+                Statistics: Num rows: 128 Data size: 2436 Basic stats: 
COMPLETE Column stats: COMPLETE
                 Select Operator
-                  expressions: _col1 (type: double)
-                  outputColumnNames: _col1
-                  Statistics: Num rows: 128 Data size: 1024 Basic stats: 
COMPLETE Column stats: COMPLETE
+                  expressions: _col1 (type: bigint), _col2 (type: bigint)
+                  outputColumnNames: _col1, _col2
+                  Statistics: Num rows: 128 Data size: 2048 Basic stats: 
COMPLETE Column stats: COMPLETE
                   Filter Operator
-                    predicate: (_col1 < $4) (type: boolean)
-                    Statistics: Num rows: 42 Data size: 336 Basic stats: 
COMPLETE Column stats: COMPLETE
+                    predicate: ((UDFToDouble(_col1) / _col2) < 
UDFToDouble($4)) (type: boolean)
+                    Statistics: Num rows: 42 Data size: 672 Basic stats: 
COMPLETE Column stats: COMPLETE
                     Select Operator
-                      expressions: _col1 (type: double)
+                      expressions: (UDFToDouble(_col1) / _col2) (type: double)
                       outputColumnNames: _col0
                       Statistics: Num rows: 42 Data size: 336 Basic stats: 
COMPLETE Column stats: COMPLETE
                       File Output Operator
@@ -485,49 +485,49 @@ STAGE PLANS:
             Map Operator Tree:
                 TableScan
                   alias: alltypesorc
-                  filterExpr: ((cint <= 100) and (cbigint <= 5000000) and 
(cfloat <> 0.023)) (type: boolean)
+                  filterExpr: ((cint <= UDFToInteger(100)) and (cbigint <= 
UDFToLong(5000000)) and (cfloat <> UDFToFloat(0.023))) (type: boolean)
                   Statistics: Num rows: 12288 Data size: 183480 Basic stats: 
COMPLETE Column stats: COMPLETE
                   Filter Operator
-                    predicate: ((cint <= 100) and (cbigint <= 5000000) and 
(cfloat <> 0.023)) (type: boolean)
-                    Statistics: Num rows: 3080 Data size: 46000 Basic stats: 
COMPLETE Column stats: COMPLETE
+                    predicate: ((cint <= UDFToInteger(100)) and (cbigint <= 
UDFToLong(5000000)) and (cfloat <> UDFToFloat(0.023))) (type: boolean)
+                    Statistics: Num rows: 1365 Data size: 20400 Basic stats: 
COMPLETE Column stats: COMPLETE
                     Select Operator
                       expressions: ctinyint (type: tinyint)
                       outputColumnNames: ctinyint
-                      Statistics: Num rows: 3080 Data size: 46000 Basic stats: 
COMPLETE Column stats: COMPLETE
+                      Statistics: Num rows: 1365 Data size: 20400 Basic stats: 
COMPLETE Column stats: COMPLETE
                       Group By Operator
-                        aggregations: avg(ctinyint)
+                        aggregations: sum(ctinyint), count(ctinyint)
                         keys: ctinyint (type: tinyint)
-                        minReductionHashAggr: 0.95844156
+                        minReductionHashAggr: 0.9062271
                         mode: hash
-                        outputColumnNames: _col0, _col1
-                        Statistics: Num rows: 128 Data size: 10116 Basic 
stats: COMPLETE Column stats: COMPLETE
+                        outputColumnNames: _col0, _col1, _col2
+                        Statistics: Num rows: 128 Data size: 2436 Basic stats: 
COMPLETE Column stats: COMPLETE
                         Reduce Output Operator
                           key expressions: _col0 (type: tinyint)
                           null sort order: z
                           sort order: +
                           Map-reduce partition columns: _col0 (type: tinyint)
-                          Statistics: Num rows: 128 Data size: 10116 Basic 
stats: COMPLETE Column stats: COMPLETE
-                          value expressions: _col1 (type: 
struct<count:bigint,sum:double,input:tinyint>)
+                          Statistics: Num rows: 128 Data size: 2436 Basic 
stats: COMPLETE Column stats: COMPLETE
+                          value expressions: _col1 (type: bigint), _col2 
(type: bigint)
             Execution mode: vectorized, llap
             LLAP IO: all inputs
         Reducer 4 
             Execution mode: vectorized, llap
             Reduce Operator Tree:
               Group By Operator
-                aggregations: avg(VALUE._col0)
+                aggregations: sum(VALUE._col0), count(VALUE._col1)
                 keys: KEY._col0 (type: tinyint)
                 mode: mergepartial
-                outputColumnNames: _col0, _col1
-                Statistics: Num rows: 128 Data size: 1412 Basic stats: 
COMPLETE Column stats: COMPLETE
+                outputColumnNames: _col0, _col1, _col2
+                Statistics: Num rows: 128 Data size: 2436 Basic stats: 
COMPLETE Column stats: COMPLETE
                 Select Operator
-                  expressions: _col1 (type: double)
-                  outputColumnNames: _col1
-                  Statistics: Num rows: 128 Data size: 1024 Basic stats: 
COMPLETE Column stats: COMPLETE
+                  expressions: _col1 (type: bigint), _col2 (type: bigint)
+                  outputColumnNames: _col1, _col2
+                  Statistics: Num rows: 128 Data size: 2048 Basic stats: 
COMPLETE Column stats: COMPLETE
                   Filter Operator
-                    predicate: (_col1 < 0) (type: boolean)
-                    Statistics: Num rows: 42 Data size: 336 Basic stats: 
COMPLETE Column stats: COMPLETE
+                    predicate: ((UDFToDouble(_col1) / _col2) < UDFToDouble(0)) 
(type: boolean)
+                    Statistics: Num rows: 42 Data size: 672 Basic stats: 
COMPLETE Column stats: COMPLETE
                     Select Operator
-                      expressions: _col1 (type: double)
+                      expressions: (UDFToDouble(_col1) / _col2) (type: double)
                       outputColumnNames: _col0
                       Statistics: Num rows: 42 Data size: 336 Basic stats: 
COMPLETE Column stats: COMPLETE
                       File Output Operator
diff --git 
a/ql/src/test/results/clientpositive/llap/vector_groupby_grouping_window.q.out 
b/ql/src/test/results/clientpositive/llap/vector_groupby_grouping_window.q.out
index 8dea65dc199..18220057367 100644
--- 
a/ql/src/test/results/clientpositive/llap/vector_groupby_grouping_window.q.out
+++ 
b/ql/src/test/results/clientpositive/llap/vector_groupby_grouping_window.q.out
@@ -81,7 +81,7 @@ STAGE PLANS:
                           vectorProcessingMode: HASH
                           projectedOutputColumnNums: [0, 1]
                       keys: category (type: int), 0L (type: bigint)
-                      grouping sets: 1, 0
+                      grouping sets: 0, 1
                       minReductionHashAggr: 0.4
                       mode: hash
                       outputColumnNames: _col0, _col1, _col2, _col3

Reply via email to