[
https://issues.apache.org/jira/browse/IMPALA-8205?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16770060#comment-16770060
]
Quanlong Huang commented on IMPALA-8205:
----------------------------------------
numTrues and numFalses are hard coded here:
[https://github.com/apache/impala/blob/ef15da08aa124126805201ba0c7199e22c0dcdb7/fe/src/main/java/org/apache/impala/catalog/ColumnStats.java#L269]
There used to be a TODO above it but was removed:
[https://github.com/apache/impala/commit/b3d8a507cb4e5e7887ed55782f5de1d6cdfcd276#diff-b0fabd1ea9efd6f9e7fdd6f01ecedfbdL876]
([~alex.behm], do you know more background of this?)
I think we should be compatible with Hive to avoid breaking CBOs of Hive(with
Calcite), Presto or other systems.
> Illegal statistics for numFalse and numTrue
> -------------------------------------------
>
> Key: IMPALA-8205
> URL: https://issues.apache.org/jira/browse/IMPALA-8205
> Project: IMPALA
> Issue Type: Bug
> Reporter: wuchang
> Priority: Major
> Labels: impala, numFalse, numTrue, statistics
>
> When impala compute statistics, it set *numFalse = -1* and *numTrue = 1* when
> the statistic is missing;
> *-1* for *numFalse* will corrupt some query engine like Presto and there
> already exists some PR report and hotfix it :
> [presto-11859|https://github.com/prestodb/presto/pull/11859]
> *1* for *numTrue* is also unreasonable because we are not sure whether it
> indicates the real numTrue statistics or a missing statistics;
> Also, previously , the *nullCount* also use -1 to indicate its absence which
> also caused problem for Presto. Presto has to add a hotfix for
> it([presto-11549|https://github.com/prestodb/presto/pull/11549]) . But it is
> a fortunate that impala has fixed this bug;
> It is necessary to set to null when these statistics are absent instead of -1
> and 1.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]