kasakrisz opened a new pull request, #6491:
URL: https://github.com/apache/hive/pull/6491

   <!--
   Thanks for sending a pull request!  Here are some tips for you:
     1. If this is your first time, please read our contributor guidelines: 
https://cwiki.apache.org/confluence/display/Hive/HowToContribute
     2. Ensure that you have created an issue on the Hive project JIRA: 
https://issues.apache.org/jira/projects/HIVE/summary
     3. Ensure you have added or run the appropriate tests for your PR: 
     4. If the PR is unfinished, add '[WIP]' in your PR title, e.g., 
'[WIP]HIVE-XXXXX:  Your PR title ...'.
     5. Be sure to keep the PR description updated to reflect all changes.
     6. Please write your PR title to summarize what this PR proposes.
     7. If possible, provide a concise example to reproduce the issue for a 
faster review.
   
   -->
   
   ### What changes were proposed in this pull request?
   * Use custom DTOs to store column statistics and ensure that 
serialVersionUID is specified explicitly.
   * Modify `StatsUtils.estimateStatsForMissingCols` to return a new list of 
column statistics instead of adding the newly estimated stats to its input 
parameter.
   
   ### Why are the changes needed?
   * Currently, Thrift-generated objects are serialized when storing the column 
statistics of an Iceberg table. However, the `serialVersionUID` is not 
explicitly specified, hence the Java compiler generates one at build time. This 
can lead to compatibility issues when a newer Hive version attempts to read 
column stats from a table created by an older version.
   * When reading the column statistics of an Iceberg table fails, 
`Collections.emptyList()` is returned. Because this is an unmodifiable list, 
the current implementation of `estimateStatsForMissingCols` [tries to 
add](https://github.com/apache/hive/blob/1516fb91e8a622b4655b0e07a37fb449634c1637/ql/src/java/org/apache/hadoop/hive/ql/stats/StatsUtils.java#L254-L257)
 the estimated column statistics to it and an exception is thrown.
   
   ### Does this PR introduce _any_ user-facing change?
   <!--
   Note that it means *any* user-facing change including all aspects such as 
the documentation fix.
   If yes, please clarify the previous behavior and the change this PR proposes 
- provide the console output, description, screenshot and/or a reproducable 
example to show the behavior difference if possible.
   If possible, please also clarify if this is a user-facing change compared to 
the released Hive versions or within the unreleased branches such as master.
   If no, write 'No'.
   -->
   
   No.
   
   ### How was this patch tested?
   ```
   mvn test -Dtest=TestHiveIcebergStatistics -pl iceberg/iceberg-handler
   mvn test -Dtest.output.overwrite -DskipSparkTests 
-Dtest=TestIcebergLlapLocalCliDriver -Dqfile=merge_iceberg_partitioned_orc.q 
-pl itests/qtest-iceberg -Pitests
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to