You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "Jesus Camacho Rodriguez (JIRA)" <ji...@apache.org> on 2017/11/09 15:31:00 UTC
[jira] [Comment Edited] (CALCITE-1984) Incorrect rewriting with
materialized views using DISTINCT in aggregate functions
[ https://issues.apache.org/jira/browse/CALCITE-1984?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16245196#comment-16245196 ]
Jesus Camacho Rodriguez edited comment on CALCITE-1984 at 11/9/17 3:30 PM:
---------------------------------------------------------------------------
Fixed in http://git-wip-us.apache.org/repos/asf/calcite/commit/a147d1a.
Thanks for reporting [~chenfeisd@163.com].
was (Author: jcamachorodriguez):
Fixed in http://git-wip-us.apache.org/repos/asf/calcite/commit/81691cef5.
Thanks for reporting [~chenfeisd@163.com].
> Incorrect rewriting with materialized views using DISTINCT in aggregate functions
> ---------------------------------------------------------------------------------
>
> Key: CALCITE-1984
> URL: https://issues.apache.org/jira/browse/CALCITE-1984
> Project: Calcite
> Issue Type: Bug
> Components: core
> Affects Versions: 1.13.0
> Reporter: fei.chen
> Assignee: Jesus Camacho Rodriguez
> Fix For: 1.15.0
>
>
> I had written a test as follows . It runs to succeed . But , the result seems not right . The “count distinct” aggregation should not be changed to “count”.
> {code:java}
> @Test public void testAggregateMaterializationOnCountDistinctQuery1() {
> checkMaterialize(
> "select \"deptno\", \"empid\" ,\"salary\"\n"
> + "from \"emps\" group by \"deptno\", \"empid\",\"salary\"",
> "select \"deptno\", count( distinct \"empid\")" + "from (select \"deptno\", \"empid\" \n"
> + "from \"emps\" group by \"deptno\", \"empid\") group by \"deptno\"",
> HR_FKUK_MODEL,
> CalciteAssert.checkResultContains(
> "EnumerableAggregate(group=[{0}], S=[COUNT($1)])\n" +
> " EnumerableTableScan(table=[[hr, m0]]"));
> }
> {code}
>
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)