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

Paul Rogers edited comment on DRILL-5364 at 3/17/17 7:52 PM:
-------------------------------------------------------------

When the query runs, the planner inserts a sort. Because the "legacy" sort is 
configured by default, the query uses the unmanaged sort. Somehow, somewhere in 
the process, the single row is remove and the result set passed to the client 
is empty.

Since this works for other folks, this is very likely a problem unique to an 
embedded drillbit, which is what this particular test uses.

The record count going into the legacy sort is 1, but 0 records come out.


was (Author: paul-rogers):
When the query runs, the planner inserts a sort. Because the "legacy" sort is 
configured by default, the query uses the unmanaged sort. Somehow, somewhere in 
the process, the single row is remove and the result set passed to the client 
is empty.

Since this works for other folks, this is very likely a problem unique to an 
embedded drillbit, which is what this particular test uses.

> Planner inserts sort for simple constant value query
> ----------------------------------------------------
>
>                 Key: DRILL-5364
>                 URL: https://issues.apache.org/jira/browse/DRILL-5364
>             Project: Apache Drill
>          Issue Type: Bug
>    Affects Versions: 1.10.0
>            Reporter: Paul Rogers
>
> Consider the following query:
> {code}
> SELECT CURRENT_TIMESTAMP FROM (VALUES(1))
> {code}
> The following is the plan generated for the query. Notice the inclusion of an 
> unnecessary sort.
> {code}
>   "graph" : [ {
>     "pop" : "Values",
>     "@id" : 4,
>     "content" : [ {
>       "EXPR$0" : {
>         "$numberLong" : 1
>       }
>     } ],
>     "initialAllocation" : 1000000,
>     "maxAllocation" : 10000000000,
>     "cost" : 1.0
>   }, {
>     "pop" : "project",
>     "@id" : 3,
>     "exprs" : [ {
>       "ref" : "`CURRENT_TIMESTAMP`",
>       "expr" : "current_timestamp() "
>     } ],
>     "child" : 4,
>     "initialAllocation" : 1000000,
>     "maxAllocation" : 10000000000,
>     "cost" : 1.0
>   }, {
>     "pop" : "external-sort",
>     "@id" : 2,
>     "child" : 3,
>     "orderings" : [ {
>       "order" : "ASC",
>       "expr" : "`CURRENT_TIMESTAMP`",
>       "nullDirection" : "UNSPECIFIED"
>     } ],
>     "reverse" : false,
>     "initialAllocation" : 20000000,
>     "maxAllocation" : 10000000000,
>     "cost" : 1.0
>   }, {
>     "pop" : "selection-vector-remover",
>     "@id" : 1,
>     "child" : 2,
>     "initialAllocation" : 1000000,
>     "maxAllocation" : 10000000000,
>     "cost" : 1.0
>   }, {
>     "pop" : "screen",
>     "@id" : 0,
>     "child" : 1,
>     "initialAllocation" : 1000000,
>     "maxAllocation" : 10000000000,
>     "cost" : 1.0
>   } ]
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Reply via email to