drill-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Victoria Markman (JIRA)" <j...@apache.org>
Subject [jira] [Closed] (DRILL-2168) Wrong result on grouping by expression involving CONCAT function
Date Fri, 17 Apr 2015 18:26:59 GMT

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

Victoria Markman closed DRILL-2168.
-----------------------------------

> Wrong result on grouping by expression involving CONCAT function
> ----------------------------------------------------------------
>
>                 Key: DRILL-2168
>                 URL: https://issues.apache.org/jira/browse/DRILL-2168
>             Project: Apache Drill
>          Issue Type: Bug
>          Components: Query Planning & Optimization
>    Affects Versions: 0.8.0
>            Reporter: Victoria Markman
>            Assignee: Jinfeng Ni
>            Priority: Critical
>             Fix For: 0.8.0
>
>         Attachments: 0001-CALCITE-593-SqlValidator-in-Frameworks-should-by-def.patch,
0001-DRILL-2168-Fix-incorrect-query-result-issue-when-gro.patch, 0002-Make-sure-expression-in-the-select-list-is-expanded-.patch,
0003-Bump-to-version-r18.1.patch, 0_0_0.parquet
>
>
> {code}
> 0: jdbc:drill:schema=dfs> select * from test;
> +------------+------------+
> |     a1     |     b1     |
> +------------+------------+
> | 51237400   | 2014-03-16 03:55:21.0 |
> | -691523338 | 2014-02-13 15:47:22.0 |
> | -1843395360 | 2014-01-14 03:31:27.0 |
> | 1095015454 | 2014-09-27 17:35:21.0 |
> | -48817354  | 2014-01-17 16:14:25.0 |
> | 59892266   | 2014-04-23 05:08:34.0 |
> | -827965492 | 2014-06-21 07:29:12.0 |
> | -1281245980 | 2014-10-25 15:49:46.0 |
> | -1778510302 | 2014-07-31 04:11:53.0 |
> | 1346460386 | 2014-07-31 04:11:53.0 |
> +------------+------------+
> 10 rows selected (0.072 seconds)
> 0: jdbc:drill:schema=dfs> select
> . . . . . . . . . . . . >         concat(cast(extract(day from b1) as varchar(10)),
'-', cast(extract(month from b1) as varchar(10)),'-',cast(extract(year from b1) as varchar(10))),
> . . . . . . . . . . . . >         sum(a1)
> . . . . . . . . . . . . > from
> . . . . . . . . . . . . >         test
> . . . . . . . . . . . . > group by
> . . . . . . . . . . . . >         concat(cast(extract(day from b1) as varchar(10)),
'-', cast(extract(month from b1) as varchar(10)),'-',cast(extract(year from b1) as varchar(10)));
> +------------+------------+
> |   EXPR$0   |   EXPR$1   |
> +------------+------------+
> | 1-1-1970   | 51237400   |
> | 23-12-1969 | -691523338 |
> | 10-12-1969 | -1843395360 |
> | 13-1-1970  | 1095015454 |
> | 31-12-1969 | -48817354  |
> | 1-1-1970   | 59892266   |
> | 22-12-1969 | -827965492 |
> | 17-12-1969 | -1281245980 |
> | 26-12-1969 | -432049916 |
> +------------+------------+
> 9 rows selected (0.103 seconds)
> {code}
> Query plan:
> {code}
> 00-01      Project(EXPR$0=[$0], EXPR$1=[$1])
> 00-02        Project(EXPR$0=[concat(CAST(EXTRACT(FLAG(DAY), $1)):VARCHAR(10) CHARACTER
SET "ISO-8859-1" COLLATE "ISO-8859-1$en_US$primary", '-', CAST(EXTRACT(FLAG(MONTH), $1)):VARCHAR(10)
CHARACTER SET "ISO-8859-1" COLLATE "ISO-8859-1$en_US$primary", '-', CAST(EXTRACT(FLAG(YEAR),
$1)):VARCHAR(10) CHARACTER SET "ISO-8859-1" COLLATE "ISO-8859-1$en_US$primary")], EXPR$1=[$1])
> 00-03          HashAgg(group=[{0}], EXPR$1=[SUM($1)])
> 00-04            Project($f0=[CONCAT(CAST(EXTRACT(FLAG(DAY), $0)):VARCHAR(10) CHARACTER
SET "ISO-8859-1" COLLATE "ISO-8859-1$en_US$primary", '-', CAST(EXTRACT(FLAG(MONTH), $0)):VARCHAR(10)
CHARACTER SET "ISO-8859-1" COLLATE "ISO-8859-1$en_US$primary", '-', CAST(EXTRACT(FLAG(YEAR),
$0)):VARCHAR(10) CHARACTER SET "ISO-8859-1" COLLATE "ISO-8859-1$en_US$primary")], a1=[$1])
> 00-05              Scan(groupscan=[ParquetGroupScan [entries=[ReadEntryWithPath [path=maprfs:/aggregation/test]],
selectionRoot=/aggregation/test, numFiles=1, columns=[`b1`, `a1`]]])
> {code}



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

Mime
View raw message