Skip to content

HIVE-29554: Refactor MTableColumnStatistics and MPartitionColumnStatistics to avoid code duplication#6420

Draft
thomasrebele wants to merge 1 commit intoapache:masterfrom
thomasrebele:tr/HIVE-29554
Draft

HIVE-29554: Refactor MTableColumnStatistics and MPartitionColumnStatistics to avoid code duplication#6420
thomasrebele wants to merge 1 commit intoapache:masterfrom
thomasrebele:tr/HIVE-29554

Conversation

@thomasrebele
Copy link
Copy Markdown
Contributor

HIVE-29554

What changes were proposed in this pull request?

Extract a common superclass MColumnStatistics from MPartitionColumnStatistics and MColumnStatistics and combine some methods that use the latter two.

Why are the changes needed?

There is a lot of code duplication around column statistics, which increases the risk of diverging code and partially applied fixes.

Does this PR introduce any user-facing change?

No

How was this patch tested?

  1. I've run Hive from the master branch (13f3208), created a table with some values, and executed analyze table tab1 compute statistics for columns;. I verified the statistics with describe formatted tab1 a;.
  2. I stopped Hive, and run Hive with the changes of the PR. I checked that the statistics are shown correctly. I inserted more values into the table and executed the ANALYZE TABLE ... command. I verified the statistics.
  3. I stopped Hive, and run Hive from the master branch again. I verified the statistics. I inserted more values into the table and executed the ANALYZE TABLE ... command. I verified the statistics.

I started and run the DESCRIBE FORMATTED, ANALYZE TABLE, DESCRIBE FORMATTED sequence for

  • a metastore server with the changes from the PR, and
  • a hiveserver and beeline from the master branch

and vice versa, i.e.,

  • a metastore server from the master branch, and
  • a hiveserver and beeline with the changes from the PR

All commands worked as expected.

@sonarqubecloud
Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants