Home | About | Sematext search-lucene.com search-hadoop.com
 Search Hadoop and all its subprojects:

Switch to Threaded View
Drill, mail # dev - Review Request 14027: Adding Limit operator end to end


Copy link to this message
-
Re: Review Request 14027: Adding Limit operator end to end
Steven Phillips 2013-09-26, 00:00

-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/14027/#review26399
-----------------------------------------------------------
I haven't looked at the code much, but I did check-out your code and try some queries. I see that if I do an ORDER BY followed by LIMIT, the ORDER BY is ignored. It doesn't show up in the Logical Plan. For example, this query:

SELECT _MAP['N_NAME'] AS name FROM "/tpc-h/nation" ORDER BY _MAP['N_NAME'] DESC LIMIT 5;

generates this Logical Plan:

Logical {
  head : {
    type : "APACHE_DRILL_LOGICAL",
    version : 1,
    generator : {
      type : "optiq",
      info : "na"
    }
  },
  storage : {
    parquet-local : {
      type : "parquet",
      dfsName : "file:///"
    }
  },
  query : [ {
    op : "scan",
    @id : 1,
    memo : "initial_scan",
    storageengine : "parquet-local",
    selection : [ {
      path : "/tpc-h/nation"
    } ],
    ref : "_MAP"
  }, {
    op : "project",
    @id : 2,
    input : 1,
    projections : [ {
      ref : "output.NAME",
      expr : "_MAP.N_NAME"
    } ]
  }, {
    op : "limit",
    @id : 3,
    input : 2,
    first : 0,
    last : 5
  }, {
    op : "store",
    @id : 4,
    memo : "output sink",
    input : 3,
    target : {
      number : 0
    },
    partition : null,
    storageEngine : "queue"
  } ]
}

Note that the "order" operator is missing.

- Steven Phillips
On Sept. 21, 2013, 5:56 a.m., Timothy Chen wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/14027/
> -----------------------------------------------------------
>
> (Updated Sept. 21, 2013, 5:56 a.m.)
>
>
> Review request for drill and Jacques Nadeau.
>
>
> Repository: drill-git
>
>
> Description
> -------
>
> Adding Limit operator end to end
>
>
> Diffs
> -----
>
>   LICENSE 5234110
>   common/src/main/java/org/apache/drill/common/JSONOptions.java 8157dc6
>   common/src/main/java/org/apache/drill/common/logical/data/Constant.java e05ce41
>   common/src/main/java/org/apache/drill/common/logical/data/Limit.java 93eb182
>   common/src/main/java/org/apache/drill/common/logical/data/LogicalOperator.java 9810e75
>   common/src/main/java/org/apache/drill/common/logical/data/LogicalOperatorBase.java 29c994f
>   exec/java-exec/src/main/java/org/apache/drill/exec/opt/BasicOptimizer.java 5a1fd6e
>   exec/java-exec/src/main/java/org/apache/drill/exec/physical/base/AbstractPhysicalVisitor.java 286144b
>   exec/java-exec/src/main/java/org/apache/drill/exec/physical/base/PhysicalVisitor.java a36b65a
>   exec/java-exec/src/main/java/org/apache/drill/exec/physical/config/Limit.java PRE-CREATION
>   exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/ImplCreator.java 94acc0e
>   exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/limit/LimitBatchCreator.java PRE-CREATION
>   exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/limit/LimitRecordBatch.java PRE-CREATION
>   exec/java-exec/src/main/java/org/apache/drill/exec/planner/fragment/StatsCollector.java 0368d0c
>   exec/java-exec/src/test/java/org/apache/drill/exec/physical/impl/limit/TestSimpleLimit.java PRE-CREATION
>   exec/java-exec/src/test/resources/limit/test1.json PRE-CREATION
>   exec/java-exec/src/test/resources/limit/test2.json PRE-CREATION
>   exec/java-exec/src/test/resources/limit/test3.json PRE-CREATION
>   exec/ref/src/main/java/org/apache/drill/exec/ref/rops/LimitROP.java 00baf81
>   pom.xml ce1f93d
>   sqlparser/src/main/java/org/apache/drill/optiq/DrillImplementor.java 6efe60b
>   sqlparser/src/main/java/org/apache/drill/optiq/DrillLimitRel.java PRE-CREATION
>   sqlparser/src/main/java/org/apache/drill/optiq/DrillLimitRule.java PRE-CREATION
>   sqlparser/src/main/java/org/apache/drill/optiq/DrillOptiq.java b01aa7d
>   sqlparser/src/main/java/org/apache/drill/optiq/DrillSortRel.java b2e9b50