You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@drill.apache.org by "Chun Chang (JIRA)" <ji...@apache.org> on 2014/06/11 00:53:01 UTC

[jira] [Commented] (DRILL-946) sum(decimal18) only give precession 9 result

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

Chun Chang commented on DRILL-946:
----------------------------------

0: jdbc:drill:schema=dfs> explain plan for select sum(cast(c_decimal9 as decimal(18,9))) from data;
+------------+------------+
|    text    |    json    |
+------------+------------+
| 00-00    Screen
00-01      StreamAgg(group=[{}], EXPR$0=[SUM($0)])
00-02        Project($f0=[CAST($0):DECIMAL(18, 9)])
00-03          Scan(groupscan=[ParquetGroupScan [entries=[ReadEntryWithPath [path=maprfs:/user/root/mondrian/data]], selectionRoot=/user/root/mondrian/data, columns=[SchemaPath [`c_decimal9`]]]])
 | {
  "head" : {
    "version" : 1,
    "generator" : {
      "type" : "ExplainHandler",
      "info" : ""
    },
    "type" : "APACHE_DRILL_PHYSICAL",
    "options" : [ ],
    "resultMode" : "EXEC"
  },
  "graph" : [ {
    "pop" : "parquet-scan",
    "@id" : 3,
    "entries" : [ {
      "path" : "maprfs:/user/root/mondrian/data"
    } ],
    "storage" : {
      "type" : "file",
      "connection" : "maprfs:///",
      "workspaces" : {
        "default" : {
          "location" : "/user/root/mondrian/",
          "writable" : false,
          "storageformat" : null
        },
        "home" : {
          "location" : "/",
          "writable" : false,
          "storageformat" : null
        },
        "root" : {
          "location" : "/",
          "writable" : false,
          "storageformat" : null
        },
        "tmp" : {
          "location" : "/tmp",
          "writable" : true,
          "storageformat" : "csv"
        }
      },
      "formats" : {
        "psv" : {
          "type" : "text",
          "extensions" : [ "tbl" ],
          "delimiter" : "|"
        },
        "csv" : {
          "type" : "text",
          "extensions" : [ "csv" ],
          "delimiter" : ","
        },
        "tsv" : {
          "type" : "text",
          "extensions" : [ "tsv" ],
          "delimiter" : "\t"
        },
        "parquet" : {
          "type" : "parquet"
        },
        "json" : {
          "type" : "json"
        }
      }
    },
    "format" : {
      "type" : "parquet"
    },
    "columns" : [ "`c_decimal9`" ],
    "selectionRoot" : "/user/root/mondrian/data"
  }, {
    "pop" : "project",
    "@id" : 2,
    "exprs" : [ {
      "ref" : "`$f0`",
      "expr" : "cast( (`c_decimal9` ) as DECIMAL18(18, 9) )"
    } ],
    "child" : 3,
    "initialAllocation" : 1000000,
    "maxAllocation" : 10000000000
  }, {
    "pop" : "streaming-aggregate",
    "@id" : 1,
    "child" : 2,
    "keys" : [ ],
    "exprs" : [ {
      "ref" : "`EXPR$0`",
      "expr" : "sum(`$f0`) "
    } ],
    "initialAllocation" : 1000000,
    "maxAllocation" : 10000000000
  }, {
    "pop" : "screen",
    "@id" : 0,
    "child" : 1,
    "initialAllocation" : 1000000,
    "maxAllocation" : 10000000000
  } ]
} |

> sum(decimal18) only give precession 9 result
> --------------------------------------------
>
>                 Key: DRILL-946
>                 URL: https://issues.apache.org/jira/browse/DRILL-946
>             Project: Apache Drill
>          Issue Type: Bug
>          Components: Execution - Operators
>            Reporter: Chun Chang
>            Assignee: Mehant Baid
>
> #Mon Jun 09 10:22:40 PDT 2014
> git.commit.id.abbrev=fb2091a
> When I sum() a decimal18, I used to get result with P18, with this build, I only get P9. Looks like a regression.
> Here is the query through drill:
> 0: jdbc:drill:schema=dfs> select sum(cast(c_decimal9 as decimal(18,9))) from data;
> +------------+
> |   EXPR$0   |
> +------------+
> | 1.23582883E8 |
> +------------+
> And I used to get
> 1.2358288447063999E8



--
This message was sent by Atlassian JIRA
(v6.2#6252)