Skip to content

HIVE-29416: optimise extrapolation by fetching matched partition col rows with one query#6602

Open
cyanzheng2926 wants to merge 1 commit into
apache:masterfrom
cyanzheng2926:HIVE-29416_optimise_extrapolation
Open

HIVE-29416: optimise extrapolation by fetching matched partition col rows with one query#6602
cyanzheng2926 wants to merge 1 commit into
apache:masterfrom
cyanzheng2926:HIVE-29416_optimise_extrapolation

Conversation

@cyanzheng2926

Copy link
Copy Markdown
Contributor

What changes were proposed in this pull request?

Replace per min/max col query used for min/max extrapolation in DirectSqlAggrStats.aggrStatsUseDB with a single query that fetches PART_NAME and all relevant min/max stat columns. Scan all returned partition rows to find the global min/max borders before linear extrapolation.

Why are the changes needed?

When aggregating column stats over partitions with partial stats, min/max values need to be extrapolated from partitions with stats. Previous implementation runs the same query to db per min/max column required for extrapolation, same query is executed multiple times in this case.

Does this PR introduce any user-facing change?

No.

How was this patch tested?

Added unit tests under TestObjectStore.java for extrapolation with partial partition stats

…xtrapolation

Replace db query for min/max extrapolation in each run with one fetch. Scan all
partition rows retrieved to find min/max borders for partially collected partition column stats. Added unit tests
@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