[ 
https://issues.apache.org/jira/browse/DRILL-6474?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16508282#comment-16508282
 ] 

ASF GitHub Bot commented on DRILL-6474:
---------------------------------------

ilooner commented on a change in pull request #1313: DRILL-6474: Don't use TopN 
when order by and offset are used without a limit specified.
URL: https://github.com/apache/drill/pull/1313#discussion_r194461574
 
 

 ##########
 File path: 
exec/java-exec/src/test/java/org/apache/drill/exec/physical/impl/limit/TestLimitPlanning.java
 ##########
 @@ -0,0 +1,32 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.drill.exec.physical.impl.limit;
+
+import org.apache.drill.PlanTestBase;
+import org.junit.Test;
+
+public class TestLimitPlanning extends PlanTestBase {
+
+  // DRILL-6474
+  @Test
+  public void dontPushdownIntoTopNWhenNoLimit() throws Exception {
+    String query = "select full_name from cp.`employee.json` order by 
full_name offset 10";
+
+    PlanTestBase.testPlanMatchingPatterns(query, new String[]{}, new 
String[]{".*TopN\\(.*"});
 
 Review comment:
   Done

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


> Queries with ORDER BY and OFFSET (w/o LIMIT) do not return any rows
> -------------------------------------------------------------------
>
>                 Key: DRILL-6474
>                 URL: https://issues.apache.org/jira/browse/DRILL-6474
>             Project: Apache Drill
>          Issue Type: Bug
>            Reporter: Timothy Farkas
>            Assignee: Timothy Farkas
>            Priority: Major
>             Fix For: 1.14.0
>
>
> This is easily reproduced with the following test
> {code}
>     final ClusterFixtureBuilder builder = new 
> ClusterFixtureBuilder(baseDirTestWatcher);
>     try (ClusterFixture clusterFixture = builder.build();
>          ClientFixture clientFixture = clusterFixture.clientFixture()) {
>       clientFixture.testBuilder()
>         .sqlQuery("select name_s10 from `mock`.`employees_100000` order by 
> name_s10 offset 100")
>         .expectsNumRecords(99900)
>         .build()
>         .run();
>     }
> {code}
> That fails with
> java.lang.AssertionError: 
> Expected :99900
> Actual   :0



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to