clintropolis commented on a change in pull request #8566: Upgrade Calcite to 
1.21
URL: https://github.com/apache/incubator-druid/pull/8566#discussion_r332785592
 
 

 ##########
 File path: 
sql/src/main/java/org/apache/druid/sql/calcite/planner/DruidPlanner.java
 ##########
 @@ -232,6 +256,37 @@ public void cleanup(EnumeratorIterator iterFromMake)
     }
   }
 
+  @Nullable
+  private RelNode possiblyWrapRootWithOuterLimitFromContext(
+      RelRoot root
+  )
+  {
+    Object outerLimitObj = 
plannerContext.getQueryContext().get(PlannerContext.CTX_SQL_OUTER_LIMIT);
+    if (outerLimitObj == null) {
+      return null;
+    }
+    Long outerLimit = DimensionHandlerUtils.convertObjectToLong(outerLimitObj, 
true);
+    if (outerLimit == null) {
+      return null;
+    }
+
+    return LogicalSort.create(
+        root.rel,
+        root.collation,
+        makeDecimalLiteral(0),
 
 Review comment:
   why decimal instead of like bigint or... something?

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to