You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@drill.apache.org by "Mehant Baid (JIRA)" <ji...@apache.org> on 2013/12/12 21:31:08 UTC

[jira] [Commented] (DRILL-323) Drill expression parser incorrectly handles expressions that involve math functions with more than 2 inputs

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

Mehant Baid commented on DRILL-323:
-----------------------------------

As a workaround we need to set the precedence for expression evaluation explicitly. For example we need to change the project operator to the following for the above plan to work

{
pop : "project",
@id : 2,
exprs : [
{ ref : "output.EXPR$0", expr : " ((blue - blue) + 1) " }
],
child : 1
},


The same query would work if submitted via sqlline, reason being that Optiq surrounds the expression with appropriate braces while generating the logical plan which is propagated to the physical plan. 

> Drill expression parser incorrectly handles expressions that involve math functions with more than 2 inputs
> -----------------------------------------------------------------------------------------------------------
>
>                 Key: DRILL-323
>                 URL: https://issues.apache.org/jira/browse/DRILL-323
>             Project: Apache Drill
>          Issue Type: Bug
>            Reporter: Mehant Baid
>            Assignee: Mehant Baid
>
> While executing the following plan:
> {
>   head : {
>     version : 1,
>     generator : {
>       type : "optiq",
>       info : "na"
>     },
>     type : "APACHE_DRILL_PHYSICAL"
>   },
>          graph:[
>          {
>              @id:1,
>              pop:"mock-scan",
>              url: "http://apache.org",
>              entries:[
>                  {records: 1, types: [
>                    {name: "blue", type: "BIGINT", mode: "REQUIRED"}
>                  ]}
>              ]
>          }, {
>     pop : "project",
>     @id : 2,
>     exprs : [ {
>       ref : "output.EXPR$0",
>       expr : " blue - blue + 1 "
>     } ],
>     child : 1
>   }, {
>     pop : "screen",
>     @id : 3,
>     child : 2
>   } ]
> }
> we will hit the following error: "Failure while running fragment. < UnsupportedOperationException:[ Missing function implementation: [add(BIGINT-REQUIRED, BIGINT-REQUIRED, BIGINT-REQUIRED)] ]"



--
This message was sent by Atlassian JIRA
(v6.1.4#6159)