[
https://issues.apache.org/jira/browse/CALCITE-4736?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Xurenhe updated CALCITE-4736:
-----------------------------
Comment: was deleted
(was: ok, thanks for your reply. [~nobigo]
I make a pr: https://github.com/apache/calcite/pull/2484
Please you review it.
Thanks a lot.)
> There are some unreasonable process of SubstitutionVisitor
> ----------------------------------------------------------
>
> Key: CALCITE-4736
> URL: https://issues.apache.org/jira/browse/CALCITE-4736
> Project: Calcite
> Issue Type: Improvement
> Components: core
> Reporter: Xurenhe
> Priority: Major
> Attachments: image-2021-08-13-16-05-37-881.png,
> image-2021-08-13-16-06-52-136.png
>
>
> Hello everyone.
> There are some unreasonable process in SubstitutionVisitor#go.
> For example:
> I define two mvs, and one of them can be using during query-write.
> First of them throw RuntimeException, but second of then should be using,
> during query-rewrite.
> Code as follow:
> {code:java}
> @Test void testQueryRewriteFlowFail() {
> final String mv1 = ""
> + "select count(1) as cnt "
> + "from \"emps\" "
> + "where cast(\"commission\" as varchar) = 'a10' "
> + "group by \"deptno\"";
> final String mv2 = ""
> + "select count(1) as cnt "
> + "from \"emps\" "
> + "where cast(\"commission\" as varchar) = 'b10' "
> + "group by \"deptno\"";
> final String query = ""
> + "select count(1) as cnt "
> + "from \"emps\" "
> + "where cast(\"commission\" as varchar) = 'b10' "
> + "group by \"deptno\"";
> sql(ImmutableList.of(mv1, mv2), query).ok();
> }
> {code}
> !image-2021-08-13-16-05-37-881.png!
> Using two mvs, test-cast is fail, but using one right mv, test-case pass.
> !image-2021-08-13-16-06-52-136.png!
--
This message was sent by Atlassian Jira
(v8.3.4#803005)