You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@drill.apache.org by "B Anil Kumar (JIRA)" <ji...@apache.org> on 2014/10/01 06:56:33 UTC

[jira] [Assigned] (DRILL-1475) MongoDB storage plugin errors with sum/avg functions

     [ https://issues.apache.org/jira/browse/DRILL-1475?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

B Anil Kumar reassigned DRILL-1475:
-----------------------------------

    Assignee: B Anil Kumar

> MongoDB storage plugin errors with sum/avg functions
> ----------------------------------------------------
>
>                 Key: DRILL-1475
>                 URL: https://issues.apache.org/jira/browse/DRILL-1475
>             Project: Apache Drill
>          Issue Type: Bug
>    Affects Versions: 0.6.0
>            Reporter: Neeraja
>            Assignee: B Anil Kumar
>
> Using the latest code from Apache Drill 0.6 branch and hitting issues with the mongodb plugin.
> Dataset is used is the mongo DB zips dataset.
> 0: jdbc:drill:zk=local> select state, sum(pop) from zips group by state order by state;
> Query failed: Failure while running fragment. Invalid value for boolean: 15338 [8b6073af-a6ba-4516-ad9b-144f486c548c]
> Error: exception while executing query: Failure while trying to get next result batch. (state=,code=0)
> 0: jdbc:drill:zk=local> select state, avg(pop) from zips group by state order by state;
> Query failed: Failure while running fragment. Invalid value for boolean: 15338 [79d074a9-6299-4e8c-8ca4-aedef3873c49]
> Error: exception while executing query: Failure while trying to get next result batch. (state=,code=0)
> -------
> Explain plan output.
> 0: jdbc:drill:zk=local> explain plan for select state, avg(pop) from zips group by state order by state;
> +------------+------------+
> |    text    |    json    |
> +------------+------------+
> | 00-00    Screen
> 00-01      Project(state=[$0], EXPR$1=[$1])
> 00-02        SelectionVectorRemover
> 00-03          Sort(sort0=[$0], dir0=[ASC])
> 00-04            Project(state=[$0], EXPR$1=[CAST(/(CastHigh(CASE(=($2, 0), null, $1)), $2)):ANY])
> 00-05              HashAgg(group=[{0}], agg#0=[$SUM0($1)], agg#1=[COUNT($1)])
> 00-06                Project(state=[$1], pop=[$0])
> 00-07                  Scan(groupscan=[MongoGroupScan [MongoScanSpec=MongoScanSpec [dbName=newzipdb, collectionName=zips, filters=null], columns=[SchemaPath [`state`], SchemaPath [`pop`]]]])
>  | {
>   "head" : {
>     "version" : 1,
>     "generator" : {
>       "type" : "ExplainHandler",
>       "info" : ""
>     },
>     "type" : "APACHE_DRILL_PHYSICAL",
>     "options" : [ ],
>     "queue" : 0,
>     "resultMode" : "EXEC"
>   },
>   "graph" : [ {
>     "pop" : "mongo-scan",
>     "@id" : 7,
>     "mongoScanSpec" : {
>       "dbName" : "newzipdb",
>       "collectionName" : "zips",
>       "filters" : null
>     },
>     "storage" : {
>       "type" : "mongo",
>       "connection" : "mongodb://localhost:27017",
>       "enabled" : true
>     },
>     "columns" : [ "`state`", "`pop`" ],
>     "cost" : 29353.0
>   }, {
>     "pop" : "project",
>     "@id" : 6,
>     "exprs" : [ {
>       "ref" : "`state`",
>       "expr" : "`state`"
>     }, {
>       "ref" : "`pop`",
>       "expr" : "`pop`"
>     } ],
>     "child" : 7,
>     "initialAllocation" : 1000000,
>     "maxAllocation" : 10000000000,
>     "cost" : 29353.0
>   }, {
>     "pop" : "hash-aggregate",
>     "@id" : 5,
>     "child" : 6,
>     "cardinality" : 1.0,
>     "initialAllocation" : 1000000,
>     "maxAllocation" : 10000000000,
>     "cost" : 14676.5,
>     "groupByExprs" : [ {
>       "ref" : "`state`",
>       "expr" : "`state`"
>     } ],
>     "aggrExprs" : [ {
>       "ref" : "`$f1`",
>       "expr" : "$sum0(`pop`) "
>     }, {
>       "ref" : "`$f2`",
>       "expr" : "count(`pop`) "
>     } ]
>   }, {
>     "pop" : "project",
>     "@id" : 4,
>     "exprs" : [ {
>       "ref" : "`state`",
>       "expr" : "`state`"
>     }, {
>       "ref" : "`EXPR$1`",
>       "expr" : "divide(casthigh( ( if (equal(`$f2`, 0)  ) then (NULL )  else (`$f1` )  end  ) ) , `$f2`) "
>     } ],
>     "child" : 5,
>     "initialAllocation" : 1000000,
>     "maxAllocation" : 10000000000,
>     "cost" : 2935.3
>   }, {
>     "pop" : "external-sort",
>     "@id" : 3,
>     "child" : 4,
>     "orderings" : [ {
>       "order" : "ASC",
>       "expr" : "`state`",
>       "nullDirection" : "UNSPECIFIED"
>     } ],
>     "reverse" : false,
>     "initialAllocation" : 20000000,
>     "maxAllocation" : 10000000000,
>     "cost" : 2935.3
>   }, {
>     "pop" : "selection-vector-remover",
>     "@id" : 2,
>     "child" : 3,
>     "initialAllocation" : 1000000,
>     "maxAllocation" : 10000000000,
>     "cost" : 2935.3
>   }, {
>     "pop" : "project",
>     "@id" : 1,
>     "exprs" : [ {
>       "ref" : "`state`",
>       "expr" : "`state`"
>     }, {
>       "ref" : "`EXPR$1`",
>       "expr" : "`EXPR$1`"
>     } ],
>     "child" : 2,
>     "initialAllocation" : 1000000,
>     "maxAllocation" : 10000000000,
>     "cost" : 2935.3
>   }, {
>     "pop" : "screen",
>     "@id" : 0,
>     "child" : 1,
>     "initialAllocation" : 1000000,
>     "maxAllocation" : 10000000000,
>     "cost" : 2935.3
>   } ]
> } |
> +------------+------------+



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)