You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@impala.apache.org by "Taras Bobrovytsky (JIRA)" <ji...@apache.org> on 2017/07/24 23:15:00 UTC

[jira] [Resolved] (IMPALA-5679) Count star optimization gives incorrect result for parquet table partitioned by STRING column

     [ https://issues.apache.org/jira/browse/IMPALA-5679?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Taras Bobrovytsky resolved IMPALA-5679.
---------------------------------------
       Resolution: Fixed
    Fix Version/s: Impala 2.10.0

{code}
commit 408b0aac831ab7d6d6459353848f9a11b811e281
Author: Taras Bobrovytsky <tb...@cloudera.com>
Date:   Fri Jul 21 14:13:28 2017 -0700

    IMPALA-5679: Fix Parquet count(*) with group by string
    
    In a recent patch (IMPALA-5036) a bug was introduced where a count(*)
    query with a group by a string partition column returned incorrect
    results. Data was being written into the tuple at an incorrect offset.
    
    Testing:
    - Added an end to end test where we are selecting from a table
      partitioned by string.
    
    Change-Id: I225547574c2b2259ca81cb642d082e151f3bed6b
    Reviewed-on: http://gerrit.cloudera.org:8080/7481
    Reviewed-by: Tim Armstrong <ta...@cloudera.com>
    Tested-by: Impala Public Jenkins
{code}

> Count star optimization gives incorrect result for parquet table partitioned by STRING column
> ---------------------------------------------------------------------------------------------
>
>                 Key: IMPALA-5679
>                 URL: https://issues.apache.org/jira/browse/IMPALA-5679
>             Project: IMPALA
>          Issue Type: Bug
>          Components: Backend
>    Affects Versions: Impala 2.10.0
>            Reporter: Attila Jeges
>            Assignee: Taras Bobrovytsky
>            Priority: Blocker
>              Labels: correctness, parquet
>             Fix For: Impala 2.10.0
>
>
> The issue can be reproduced as follows:
> {noformat}
> > create table part_tbl_parq (a integer) partitioned by (p STRING) stored as parquet;
> > insert into part_tbl_parq partition(p="val100") values(100);
> > select * from part_tbl_parq;
> +-----+--------+
> | a   | p      |
> +-----+--------+
> | 100 | val100 |
> +-----+--------+
> > select p, count(a) from part_tbl_parq group by p;
> +--------+----------+
> | p      | count(a) |
> +--------+----------+
> | val100 | 1        |
> +--------+----------+
> > select p, count(*) from part_tbl_parq group by p;
> +---+----------+
> | p | count(*) |
> +---+----------+
> |   | 0        |
> +---+----------+
> {noformat}
> The result of the last select is obviously incorrect.
> The problem does not happen if the table is partitioned by an INT column:
> {noformat}
> > create table part_tbl_parq2 (a integer) partitioned by (p integer) stored as parquet;
> > insert into part_tbl_parq2 partition(p=100) values(100);
> > select p, count(*) from part_tbl_parq2 group by p;
> +-----+----------+
> | p   | count(*) |
> +-----+----------+
> | 100 | 1        |
> +-----+----------+
> {noformat}



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)