Krisztian Kasa created HIVE-24335:
-------------------------------------
Summary: RelOptMaterialization creates LogicalProject on top of
HiveTableScan
Key: HIVE-24335
URL: https://issues.apache.org/jira/browse/HIVE-24335
Project: Hive
Issue Type: Bug
Components: Materialized views
Reporter: Krisztian Kasa
Assignee: Krisztian Kasa
In some cases RelOptMaterialization creates a Project operator on top of
materialized view HiveTableScan.
Ex.: when some columns need to be casted.
{code:java}
LogicalProject(empid=[CAST($0):INTEGER NOT NULL], deptno=[$1], name=[$2],
salary=[$3], commission=[$4])
HiveTableScan(table=[[default, mv1_n2]], table:alias=[mv1_n2])
{code}
This Project operator is represented by a LogicalProject however a HiveProject
should be used.
Cause: in calcite RelOptMaterialization constructor calls
RelOptUtil.createCastRel which uses the RelFactories.DEFAULT_PROJECT_FACTORY
[https://github.com/apache/calcite/blob/987cb7f7da6ff1cb436718ac93868d50e88e875f/core/src/main/java/org/apache/calcite/plan/RelOptMaterialization.java#L60]
[https://github.com/apache/calcite/blob/987cb7f7da6ff1cb436718ac93868d50e88e875f/core/src/main/java/org/apache/calcite/plan/RelOptUtil.java#L832]
--
This message was sent by Atlassian Jira
(v8.3.4#803005)