You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hive.apache.org by "Jesus Camacho Rodriguez (Jira)" <ji...@apache.org> on 2020/05/22 03:49:00 UTC

[jira] [Updated] (HIVE-23530) Use SQL functions instead of compute_stats UDAF to compute column statistics

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

Jesus Camacho Rodriguez updated HIVE-23530:
-------------------------------------------
    Status: Patch Available  (was: In Progress)

> Use SQL functions instead of compute_stats UDAF to compute column statistics
> ----------------------------------------------------------------------------
>
>                 Key: HIVE-23530
>                 URL: https://issues.apache.org/jira/browse/HIVE-23530
>             Project: Hive
>          Issue Type: Improvement
>          Components: Statistics
>            Reporter: Jesus Camacho Rodriguez
>            Assignee: Jesus Camacho Rodriguez
>            Priority: Major
>
> Currently we compute column statistics by relying on the {{compute_stats}} UDAF. For instance, for a given table {{tbl}}, the query to compute statistics for columns is translated internally into:
> {code}
> SELECT compute_stats(c1),
>        compute_stats(c2),
>        ...
> FROM tbl;
> {code}
> {{compute_stats}} produces data for the stats available for each column type, e.g., struct<"max":long,"min":long,"countnulls":long,...>.
> This issue is to produce a query that relies purely on SQL functions instead:
> {code}
> SELECT max(c1), min(c1), count(case when c1 is null then 1 else null end),
>        ...
> FROM tbl;
> {code}
> This will allow us to deprecate the {{compute_stats}} UDAF since it mostly duplicates functionality found in those other functions. Additionally, many of those functions already provide a vectorized implementation so the approach could potentially improve the performance of column stats collection.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)