Jesus Camacho Rodriguez created HIVE-18680:
----------------------------------------------
Summary: FieldTrimmer missing opportunity with SortLimit operators
Key: HIVE-18680
URL: https://issues.apache.org/jira/browse/HIVE-18680
Project: Hive
Issue Type: Bug
Components: CBO
Affects Versions: 3.0.0
Reporter: Jesus Camacho Rodriguez
Assignee: Jesus Camacho Rodriguez
In the following plan, {{_o__col4}} is not needed:
{code}
2018-02-11T11:35:14,501 DEBUG [0fda1a20-c7f1-489e-b287-65f35fda9848 main]
calcite.sql2rel: Plan after trimming unused fields
HiveProject(download_volume_bytes=[$0], ri_date=[$1], end_cell_id=[$2],
environment=[$3])
HiveSortLimit(sort0=[$2], dir0=[ASC-nulls-first], fetch=[100])
HiveProject(download_volume_bytes=[$4], ri_date=[$3], end_cell_id=[$1],
environment=[$2], _o__col4=[$0])
HiveAggregate(group=[{0, 1, 2, 3}], agg#0=[sum($4)])
HiveProject($f0=[$1], $f1=[$2], $f2=[$3], $f3=[$0], $f4=[$4])
HiveProject(ri_date=[$0], imsi=[$1], end_cell_id=[$2],
environment=[$3], s1_u_download_data_volume=[$4])
HiveTableScan(table=[[default.lsr094]], table:alias=[a])
{code}
{{_o__col4}} should be removed by the FieldTrimmer. Otherwise, this may prevent
MV rewriting to be triggered on some queries containing order by/limit clauses.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)