Skip to content

HIVE-30131: StatsOptimizer: Answer MIN, MAX and COUNT on a DECIMAL column from column statistics - #6844

Open
deniskuzZ wants to merge 1 commit into
apache:masterfrom
deniskuzZ:HIVE-30131
Open

deniskuzZ wants to merge 1 commit into
apache:masterfrom
deniskuzZ:HIVE-30131

Conversation

@deniskuzZ

Copy link
Copy Markdown
Member

What changes were proposed in this pull request?

  • getType mapped a decimal column to StatType.Unsupported, so min, max and count(col) over one scanned the table even with accurate satistics
  • add StatType.Decimal and the cases its exhaustive switches then require
  • read the bound through DecimalUtils.getHiveDecimal, as the metastore does
  • partitioned tables need no fold here: statsFor already aggregates them

Why are the changes needed?

Missing stats optimization for DECIMAL column

Does this PR introduce any user-facing change?

No

How was this patch tested?

metadata_only_queries.q

@deniskuzZ deniskuzZ changed the title iHIVE-30131: StatsOptimizer: Answer MIN, MAX and COUNT on a DECIMAL column from column statistics HIVE-30131: StatsOptimizer: Answer MIN, MAX and COUNT on a DECIMAL column from column statistics Oct 5, 2026
@deniskuzZ
deniskuzZ force-pushed the HIVE-30131 branch 2 times, most recently from c24a193 to ba8a463 Compare October 5, 2026 22:55
…lumn from column statistics

  - getType mapped a decimal column to StatType.Unsupported, so min, max and count(col) over one scanned the table even with accurate satistics
  - add StatType.Decimal and the cases its exhaustive switches then require
  - read the bound through DecimalUtils.getHiveDecimal, as the metastore does
  - partitioned tables need no fold here: statsFor already aggregates them
@sonarqubecloud

sonarqubecloud Bot commented Oct 6, 2026

Copy link
Copy Markdown

This branch has not been deployed

No deployments
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