You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hive.apache.org by GitBox <gi...@apache.org> on 2019/03/05 22:34:49 UTC

[GitHub] [hive] jcamachor commented on a change in pull request #557: HIVE-21338 Remove order by and limit for aggregates

jcamachor commented on a change in pull request #557: HIVE-21338 Remove order by and limit for aggregates
URL: https://github.com/apache/hive/pull/557#discussion_r262705631
 
 

 ##########
 File path: ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/HiveRelOptUtil.java
 ##########
 @@ -1047,4 +1052,37 @@ public static String toJsonString(final RelNode rel) {
     return planWriter.asString();
   }
 
+
+  /**
+   * Utility method to answer if given a rel plan it will produce at most
+   *  one row.
+   */
+  public static boolean produceAtmostOneRow(RelNode rel) {
+    if(rel instanceof HepRelVertex) {
+      rel = ((HepRelVertex)rel).getCurrentRel();
+    }
+    if(rel instanceof HiveProject) {
+      if(((HiveProject)rel).hasWindowingExpr()) {
 
 Review comment:
   This check does not seem to be needed since the window expression will not alter the number of rows output by the Project.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services