[ 
https://issues.apache.org/jira/browse/HIVE-29275?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18035807#comment-18035807
 ] 

Thomas Rebele commented on HIVE-29275:
--------------------------------------

Thank you very much for investigating the bug!

The {{Decimal}} class containing the {{compareTo}} method is generated from 
{{{}standalone-metastore/metastore-common/src/main/thrift/hive_metastore.thrift{}}}.
  I've checked the other generated languages in 
{{standalone-metastore/metastore-common/src/gen/thrift/}} (Python, C++, Ruby, 
PHP). Only the Java generated code provides comparison function for Decimal. 
There seems to be [no way to prevent 
Thrift|https://github.com/apache/thrift/blob/2a93df80f27739ccabb5b885cb12a8dc7595ecdf/compiler/cpp/src/thrift/generate/t_java_generator.cc#L1669]
 from [generating the compareTo 
method|https://github.com/apache/thrift/blob/2a93df80f27739ccabb5b885cb12a8dc7595ecdf/compiler/cpp/src/thrift/generate/t_java_generator.cc#L2041-L2077]
 (also not in the [dev version of 
Thrift|https://github.com/apache/thrift/blob/e7ab34eccb272584441f5462104d87f08b217ea7/compiler/cpp/src/thrift/generate/t_java_generator.cc#L1771]).

[~krisztiankasa], do you think it's worth to create a Thrift ticket to ask for 
a way to turn off to generate the compareTo method? Otherwise there's always 
the risk to accidentally use this faulty comparison method.

> Stats autogather calculates the min statistic incorrectly
> ---------------------------------------------------------
>
>                 Key: HIVE-29275
>                 URL: https://issues.apache.org/jira/browse/HIVE-29275
>             Project: Hive
>          Issue Type: Bug
>    Affects Versions: 4.1.0, 4.0.1
>            Reporter: Thomas Rebele
>            Priority: Major
>              Labels: hive-4.2.0-candidate
>
>  In stats_histogram.q autogather gets enabled and then rows are inserted into 
> a newly created table. The minimum value for column e is 
> [-123.2|https://github.com/apache/hive/blob/55d9ab7d6b00fa510be791b9de55974f61c90519/ql/src/test/queries/clientpositive/stats_histogram.q#L20].
>  However, {{DESCRIBE FORMATTED test_stats e}} shows 
> [-10.2|https://github.com/apache/hive/blob/55d9ab7d6b00fa510be791b9de55974f61c90519/ql/src/test/results/clientpositive/llap/stats_histogram.q.out#L364]
>  as the minimum value.
> When executing {{ANALYZE TABLE test_stats COMPUTE STATISTICS FOR COLUMNS;}} 
> before the {{DESCRIBE FORMATTED test_stats e}} command, the [min value is 
> -123.2|https://github.com/thomasrebele/hive/commit/2be9bef2851028678fa6752f7482080b3d201a51#diff-436ceeced7ea88c3ad4d931cfbf3d09feb838eef368a74ca8106d378209b1209L262-L364]
>  as expected.



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

Reply via email to