Apache Drill
  1. Apache Drill
  2. DRILL-850

support of multiple count(distinct) inconsistent

    Details

      Description

      git.commit.id.abbrev=01bf849
      git.commit.id=01bf8496b217781521c943cc1a9a38ed9f841288

      With planner.enable_multiphase_agg and planner.enable_hashagg set to false, planner.enable_hashagg is encountered for the following query:

      select cast(c_groupby as varchar(4)), count(distinct(c_int)), count(distinct(c_bigint)), count(distinct(c_float4)), count(distinct(c_float8)) from data group by c_groupby;

        Activity

        Hide
        Zhiyong Liu added a comment -

        0: jdbc:drill:schema=dfs> alter session set `planner.enable_multiphase_agg` = false;
        ----------------------+

        ok summary

        ----------------------+

        true planner.enable_multiphase_agg updated.

        ----------------------+
        1 row selected (0.031 seconds)
        0: jdbc:drill:schema=dfs> alter session set `planner.enable_hashagg` = false;
        ----------------------+

        ok summary

        ----------------------+

        true planner.enable_hashagg updated.

        ----------------------+
        1 row selected (0.022 seconds)
        0: jdbc:drill:schema=dfs> select cast(c_groupby as varchar(4)), count(distinct(c_int)), count(distinct(c_bigint)), count(distinct(c_float4)), count(distinct(c_float8)) from data group by c_groupby;
        Query failed: org.apache.drill.exec.rpc.RpcException: Remote failure while running query.[error_id: "c27ac681-6a4e-4bb4-bc45-a9f32cd6121e"
        endpoint

        { address: "perfnode104.perf.lab" user_port: 31010 control_port: 31011 data_port: 31012 }


        error_type: 0
        message: "Failure while running fragment. < UnsupportedOperationException:[ Failure finding function that runtime code generation expected. Signature: compare_to( INT:OPTIONALVARBINARY:OPTIONAL, ) returns INT:REQUIRED ]"
        ]
        Error: exception while executing query (state=,code=0)
        0: jdbc:drill:schema=dfs> alter session set `planner.enable_hashagg` = true;
        ----------------------+

        ok summary

        ----------------------+

        true planner.enable_hashagg updated.

        ----------------------+
        1 row selected (0.021 seconds)
        0: jdbc:drill:schema=dfs> alter session set `planner.enable_multiphase_agg` = true;
        ----------------------+

        ok summary

        ----------------------+

        true planner.enable_multiphase_agg updated.

        ----------------------+
        1 row selected (0.031 seconds)
        0: jdbc:drill:schema=dfs> select cast(c_groupby as varchar(4)), count(distinct(c_int)), count(distinct(c_bigint)), count(distinct(c_float4)), count(distinct(c_float8)) from data group by c_groupby;
        ----------------------------------------------------

        EXPR$0 EXPR$1 EXPR$2 EXPR$3 EXPR$4

        ----------------------------------------------------

        "" 6 6 6 6
        abc 6 6 6 6
        ab 5 6 6 6
        a 5 5 5 5

        ----------------------------------------------------
        4 rows selected (3.274 seconds)

        Show
        Zhiyong Liu added a comment - 0: jdbc:drill:schema=dfs> alter session set `planner.enable_multiphase_agg` = false; ----------- -----------+ ok summary ----------- -----------+ true planner.enable_multiphase_agg updated. ----------- -----------+ 1 row selected (0.031 seconds) 0: jdbc:drill:schema=dfs> alter session set `planner.enable_hashagg` = false; ----------- -----------+ ok summary ----------- -----------+ true planner.enable_hashagg updated. ----------- -----------+ 1 row selected (0.022 seconds) 0: jdbc:drill:schema=dfs> select cast(c_groupby as varchar(4)), count(distinct(c_int)), count(distinct(c_bigint)), count(distinct(c_float4)), count(distinct(c_float8)) from data group by c_groupby; Query failed: org.apache.drill.exec.rpc.RpcException: Remote failure while running query.[error_id: "c27ac681-6a4e-4bb4-bc45-a9f32cd6121e" endpoint { address: "perfnode104.perf.lab" user_port: 31010 control_port: 31011 data_port: 31012 } error_type: 0 message: "Failure while running fragment. < UnsupportedOperationException:[ Failure finding function that runtime code generation expected. Signature: compare_to( INT:OPTIONALVARBINARY:OPTIONAL, ) returns INT:REQUIRED ]" ] Error: exception while executing query (state=,code=0) 0: jdbc:drill:schema=dfs> alter session set `planner.enable_hashagg` = true; ----------- -----------+ ok summary ----------- -----------+ true planner.enable_hashagg updated. ----------- -----------+ 1 row selected (0.021 seconds) 0: jdbc:drill:schema=dfs> alter session set `planner.enable_multiphase_agg` = true; ----------- -----------+ ok summary ----------- -----------+ true planner.enable_multiphase_agg updated. ----------- -----------+ 1 row selected (0.031 seconds) 0: jdbc:drill:schema=dfs> select cast(c_groupby as varchar(4)), count(distinct(c_int)), count(distinct(c_bigint)), count(distinct(c_float4)), count(distinct(c_float8)) from data group by c_groupby; ----------- ---------- ---------- ---------- ----------- EXPR$0 EXPR$1 EXPR$2 EXPR$3 EXPR$4 ----------- ---------- ---------- ---------- ----------- "" 6 6 6 6 abc 6 6 6 6 ab 5 6 6 6 a 5 5 5 5 ----------- ---------- ---------- ---------- ----------- 4 rows selected (3.274 seconds)
        Hide
        Aman Sinha added a comment -

        Zhiyong Liu can you retest this on latest master branch and provide an update ? I am not able to reproduce the issue.

        Show
        Aman Sinha added a comment - Zhiyong Liu can you retest this on latest master branch and provide an update ? I am not able to reproduce the issue.
        Hide
        Zhiyong Liu added a comment -

        Neither can I reproduce this. It's been a long time and a lot has changed.

        Show
        Zhiyong Liu added a comment - Neither can I reproduce this. It's been a long time and a lot has changed.
        Hide
        Aman Sinha added a comment -

        Can you add test coverage in the functional test suite for this ? After that I will close the issue.

        Show
        Aman Sinha added a comment - Can you add test coverage in the functional test suite for this ? After that I will close the issue.
        Hide
        Zhiyong Liu added a comment -

        Added a test to cover this.

        Show
        Zhiyong Liu added a comment - Added a test to cover this.
        Hide
        Aman Sinha added a comment -

        Already fixed previously. Added unit tests in commit #: 35a350fd3

        Show
        Aman Sinha added a comment - Already fixed previously. Added unit tests in commit #: 35a350fd3

          People

          • Assignee:
            Aman Sinha
            Reporter:
            Zhiyong Liu
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development