[
https://issues.apache.org/jira/browse/DRILL-3288?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14584210#comment-14584210
]
Victoria Markman edited comment on DRILL-3288 at 6/12/15 10:47 PM:
-------------------------------------------------------------------
I take it back, it can be reproduced without window function:
{code}
select
avg(j7.c_integer)
from
`j6/0_0_0.parquet` j6, `j7/0_0_0.parquet` j7
where j6.c_integer = j7.c_integer
group by
j6.c_date, j6.c_time, j6.c_integer;
{code}
Plan:
{code}
| 00-00 Screen
00-01 Project(EXPR$0=[CAST(/(CastHigh(CASE(=($4, 0), null, $3)), $4)):ANY
NOT NULL])
00-02 HashAgg(group=[{0, 1, 2}], agg#0=[$SUM0($3)], agg#1=[COUNT($3)])
00-03 MergeJoin(condition=[=($2, $3)], joinType=[inner])
00-05 SelectionVectorRemover
00-07 Sort(sort0=[$2], dir0=[ASC])
00-09 Project(c_date=[$1], c_time=[$2], c_integer=[$0])
00-11 Scan(groupscan=[ParquetGroupScan
[entries=[ReadEntryWithPath
[path=maprfs:///drill/testdata/subqueries/j6/0_0_0.parquet]],
selectionRoot=/drill/testdata/subqueries/j6/0_0_0.parquet, numFiles=1,
columns=[`c_date`, `c_time`, `c_integer`]]])
00-04 Project(c_integer0=[$0])
00-06 SelectionVectorRemover
00-08 Sort(sort0=[$0], dir0=[ASC])
00-10 Scan(groupscan=[ParquetGroupScan
[entries=[ReadEntryWithPath
[path=maprfs:///drill/testdata/subqueries/j7/0_0_0.parquet]],
selectionRoot=/drill/testdata/subqueries/j7/0_0_0.parquet, numFiles=1,
columns=[`c_integer`]]])
{code}
It's possible that this is regression of a bug that has already been fixed.
was (Author: vicky):
I take it back, it can be reproduced without window function:
{code}
select
avg(j7.c_integer)
from
`j6/0_0_0.parquet` j6, `j7/0_0_0.parquet` j7
where j6.c_integer = j7.c_integer
group by
j6.c_date, j6.c_time, j6.c_integer;
{code}
> False "Hash aggregate does not support schema changes" error message in a
> query with merge join and hash aggregation
> --------------------------------------------------------------------------------------------------------------------
>
> Key: DRILL-3288
> URL: https://issues.apache.org/jira/browse/DRILL-3288
> Project: Apache Drill
> Issue Type: Bug
> Components: Execution - Relational Operators
> Affects Versions: 1.0.0
> Reporter: Victoria Markman
> Assignee: Chris Westin
>
> This error seems to be happening only when you have both window and regular
> aggregate function in a query. You will need to disable hash join to
> reproduce this error: "alter session set `planner.enable_hashjoin` = false"
> Columns in table j6 are all of 'optional' type, columns in j7 are all
> "required" type. (attached sample for each)
> Here are two queries that are failing for me:
> Query 1 (aggregate function in the having clause):
> {code}
> 0: jdbc:drill:schema=dfs> select
> . . . . . . . . . . . . > j6.c_integer,
> . . . . . . . . . . . . > sum(j6.c_integer) over(partition by
> j6.c_date order by j6.c_time)
> . . . . . . . . . . . . > from
> . . . . . . . . . . . . > j6, j7
> . . . . . . . . . . . . > where j6.c_integer = j7.c_integer
> . . . . . . . . . . . . > group by
> . . . . . . . . . . . . > j6.c_date, j6.c_time, j6.c_integer
> . . . . . . . . . . . . > having
> . . . . . . . . . . . . > avg(j7.c_integer) > 0;
> java.lang.RuntimeException: java.sql.SQLException: UNSUPPORTED_OPERATION
> ERROR: Hash aggregate does not support schema changes
> Fragment 0:0
> [Error Id: ed0140d4-244c-4895-bf65-6ea1d085382e on atsqa4-133.qa.lab:31010]
> at sqlline.IncrementalRows.hasNext(IncrementalRows.java:73)
> at
> sqlline.TableOutputFormat$ResizingRowsProvider.next(TableOutputFormat.java:85)
> at sqlline.TableOutputFormat.print(TableOutputFormat.java:116)
> at sqlline.SqlLine.print(SqlLine.java:1583)
> at sqlline.Commands.execute(Commands.java:852)
> at sqlline.Commands.sql(Commands.java:751)
> at sqlline.SqlLine.dispatch(SqlLine.java:738)
> at sqlline.SqlLine.begin(SqlLine.java:612)
> at sqlline.SqlLine.start(SqlLine.java:366)
> at sqlline.SqlLine.main(SqlLine.java:259)
> {code}
> Query 2: (window function and aggregate function in projection list):
> {code}
> 0: jdbc:drill:schema=dfs> select
> . . . . . . . . . . . . > j6.c_integer,
> . . . . . . . . . . . . > avg(j7.c_integer),
> . . . . . . . . . . . . > sum(j6.c_integer) over(partition by
> j6.c_date order by j6.c_time)
> . . . . . . . . . . . . > from
> . . . . . . . . . . . . > j6, j7
> . . . . . . . . . . . . > where j6.c_integer = j7.c_integer
> . . . . . . . . . . . . > group by
> . . . . . . . . . . . . > j6.c_date, j6.c_time, j6.c_integer;
> java.lang.RuntimeException: java.sql.SQLException: UNSUPPORTED_OPERATION
> ERROR: Hash aggregate does not support schema changes
> Fragment 0:0
> [Error Id: 370188bd-012d-4fc2-a365-fe9e482aaa0f on atsqa4-133.qa.lab:31010]
> at sqlline.IncrementalRows.hasNext(IncrementalRows.java:73)
> at
> sqlline.TableOutputFormat$ResizingRowsProvider.next(TableOutputFormat.java:85)
> at sqlline.TableOutputFormat.print(TableOutputFormat.java:116)
> at sqlline.SqlLine.print(SqlLine.java:1583)
> at sqlline.Commands.execute(Commands.java:852)
> at sqlline.Commands.sql(Commands.java:751)
> at sqlline.SqlLine.dispatch(SqlLine.java:738)
> at sqlline.SqlLine.begin(SqlLine.java:612)
> at sqlline.SqlLine.start(SqlLine.java:366)
> at sqlline.SqlLine.main(SqlLine.java:259)
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)