github-advanced-security[bot] commented on code in PR #18191:
URL: https://github.com/apache/druid/pull/18191#discussion_r2180570566


##########
extensions-core/multi-stage-query/src/main/java/org/apache/druid/msq/logical/DruidLogicalToQueryDefinitionTranslator.java:
##########
@@ -122,16 +124,21 @@
   {
     if (stack.getNode() instanceof DruidSort) {
       DruidSort sort = (DruidSort) stack.getNode();
-      if (sort.hasLimitOrOffset()) {
-        throw DruidException.defensive("Sort with limit or offset is not 
supported in MSQ logical stage builder");
-      }
       List<OrderByColumnSpec> orderBySpecs = 
DruidQuery.buildOrderByColumnSpecs(inputStage.getLogicalRowSignature(), sort);
       List<KeyColumn> keyColumns = Lists.transform(orderBySpecs, 
KeyColumn::fromOrderByColumnSpec);
-      return new SortStage(inputStage, keyColumns);
+      SortStage sortStage = new SortStage(inputStage, keyColumns);
+
+      if (sort.hasLimitOrOffset()) {
+        OffsetLimit offsetLimit = sort.getOffsetLimit();

Review Comment:
   ## Unread local variable
   
   Variable 'OffsetLimit offsetLimit' is never read.
   
   [Show more 
details](https://github.com/apache/druid/security/code-scanning/9326)



-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


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

Reply via email to