You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "jin xing (JIRA)" <ji...@apache.org> on 2019/08/01 04:56:00 UTC
[jira] [Created] (CALCITE-3223) Non-RexInputRef may fails the
matching of FilterToProjectUnifyRule during 'invert' by mistake.
jin xing created CALCITE-3223:
---------------------------------
Summary: Non-RexInputRef may fails the matching of FilterToProjectUnifyRule during 'invert' by mistake.
Key: CALCITE-3223
URL: https://issues.apache.org/jira/browse/CALCITE-3223
Project: Calcite
Issue Type: Bug
Components: core
Reporter: jin xing
In current code of {{FilterToProjectUnifyRule::invert}}(https://github.com/apache/calcite/blob/master/core/src/main/java/org/apache/calcite/plan/SubstitutionVisitor.java#L1124), the implementation
1. Fails the matching when there is Non-RexInputRef in the projects
2. Didn't check if all {{exprList}} has already ben set correctly.
As a result below tests fails.
{code:java}
@Test public void testFilterToProject0() {
String union =
"select * from \"emps\" where \"empid\" > 300\n"
+ "union all select * from \"emps\" where \"empid\" < 200";
String mv = "select *, \"empid\" * 2 from (" + union + ")";
String query = "select * from (" + union + ") where (\"empid\" * 2) > 3";
checkMaterialize(mv, query);
}
@Test public void testFilterToProject1() {
String agg =
"select \"deptno\", count(*) as \"c\", sum(\"salary\") as \"s\"\n"
+ "from \"emps\" group by \"deptno\"";
String mv = "select \"c\", \"s\", \"s\" from (" + agg + ")";
String query = "select * from (" + agg + ") where (\"s\" * 0.8) > 10000";
checkNoMaterialize(mv, query, HR_FKUK_MODEL);
}
{code}
--
This message was sent by Atlassian JIRA
(v7.6.14#76016)