drill-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Victoria Markman (JIRA)" <j...@apache.org>
Subject [jira] [Created] (DRILL-2168) Wrong result on grouping by expression involving CONCAT function
Date Thu, 05 Feb 2015 00:30:34 GMT
Victoria Markman created DRILL-2168:
---------------------------------------

             Summary: 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


{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