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

Denys Kuzmenko resolved HIVE-30131.
-----------------------------------
    Fix Version/s: 4.3.0
       Resolution: Fixed

> StatsOptimizer cannot answer MIN/MAX/COUNT(col) from statistics for DECIMAL 
> columns
> -----------------------------------------------------------------------------------
>
>                 Key: HIVE-30131
>                 URL: https://issues.apache.org/jira/browse/HIVE-30131
>             Project: Hive
>          Issue Type: Bug
>            Reporter: Denys Kuzmenko
>            Assignee: Denys Kuzmenko
>            Priority: Major
>              Labels: pull-request-available
>             Fix For: 4.3.0
>
>
>   - select min(c) from t with c decimal(p,s) and accurate column statistics 
> still plans a full scan, while count(*) folds.                                
>                                         
>   - StatsOptimizer.getType returns Unsupported for DECIMAL (only 
> integral/double/float/binary/boolean/string/date are handled), so the MIN/MAX 
> and COUNT(col) branches decline with "Unsupported  
>     type: decimal(p,s) encountered in metadata optimizer".                    
>                                                                               
>                                       
>   - The metastore model already carries the bounds (DecimalColumnStatsData 
> low/high/numNulls), and both HMS and the Iceberg handler (HIVE-29834) serve 
> them — only the optimizer's type switch    
>     lacks the case. 
>                                                                               
>                                                                               
>                   
>   - Fix: add StatType.Decimal, getDecimalStats().getNumNulls(), and a MIN/MAX 
> case converting thrift Decimal → HiveDecimal the way StatsUtils already does 
> (:924-931). Tests: a decimal column in 
>     stats_part.q and iceberg_part_colstats.q, with a 
> hive.compute.query.using.stats=false control and an all-NULL case.            
>                                                                
>   - Applies equally to native tables.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to