[Enhancement] Read DATE/DATETIME footer stats in tablet pre-split meta tier#74710
Open
xiangguangyxg wants to merge 5 commits into
Open
[Enhancement] Read DATE/DATETIME footer stats in tablet pre-split meta tier#74710xiangguangyxg wants to merge 5 commits into
xiangguangyxg wants to merge 5 commits into
Conversation
…pre-split meta tier
…indow Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…/DATETIME - Extract the format-agnostic [1970-01-01, 9999-12-31] safe-window gate into MetaTierTemporalWindow (called by both footer readers), removing per-reader duplication. - Replace the duplicated 4-way integer-type checks in the Parquet INT32/INT64 arms with PrimitiveType.isIntegerType(), matching the ORC reader. - Name the ORC stripe-conversion helpers as verbs (convertIntegerStripe/convertDateStripe) and expand stripeInfo -> stripeInformation. - Wrap convertDateStripe's Variant.of inside the RuntimeException -> MetaTierUnavailableException guard so an unrepresentable date value falls back to data tier instead of escaping read(). - Fix the stale ORC type-window javadoc, note the intentional checked-exception bypass in the Parquet convertBlock catch, move the duplicated statusOf test helper into PresplitTestSupport, and drop a redundant DATE->BIGINT fallback test. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
@codex review |
|
Codex Review: Didn't find any major issues. Bravo. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Contributor
[Java-Extensions Incremental Coverage Report]✅ pass : 0 / 0 (0%) |
Contributor
[FE Incremental Coverage Report]✅ pass : 60 / 64 (93.75%) file detail
|
Contributor
[BE Incremental Coverage Report]✅ pass : 0 / 0 (0%) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why I'm doing:
The Sample-Based Tablet Pre-Split meta tier reads Parquet/ORC footer column statistics to plan tablet split boundaries cheaply, avoiding a full data-tier
SELECTsub-query. Until now it only accepted integer/boolean stats, so temporal range/partition sort keys — the dominant bulk-load case — always fell through to the data tier. This extends the meta tier to DATE/DATETIME so those loads get the cheap footer-based split.What I'm doing:
Only the two footer readers change; the pipeline below them (
ParquetMetadataSampler,BoundaryPlanner,Variant/DateVariant, the providers,MetaTierFormat) is type-agnostic and untouched.ParquetRowGroupStatisticsReader):INT32 + DATE→ StarRocksDATE;INT64 + TIMESTAMPwithisAdjustedToUTC=false(MILLIS/MICROS/NANOS) →DATETIME.OrcStripeStatisticsReader):DATEcategory → StarRocksDATE.[1970-01-01, 9999-12-31]via the newMetaTierTemporalWindow. Anything outside it — plus UTC-adjusted/INT96 Parquet timestamps, ORCTIMESTAMP/TIMESTAMP_INSTANT,DECIMAL, andFLOAT/DOUBLE— throwsMetaTierUnavailableExceptionand falls back to the data tier (never a wrong boundary, never a load failure).Why the window: for non-negative ticks the FE
Math.floorDiv/floorModconversion is bit-identical to the BE load's signed division (Int64ToDateTimeConverter), so the FE-computed boundary equals the value the load stores; the window also avoids theyyyy-formatter year-0 mis-render and the pre-1582 proleptic/hybrid-calendar parity question. Boundary strings round-trip throughDateVariant.getStringValue(canonicalyyyy-MM-dd/yyyy-MM-dd HH:mm:ss[.ffffff]).Tests: per-reader DATE/DATETIME success (incl. window edges and NANOS→micros truncation), UTC-adjusted / out-of-window / type-mismatch / all-null fallbacks, ORC
TIMESTAMPdeferral, and aParquetMetadataSamplerdate-quantile integration test that pins the type-agnostic-pipeline claim.What type of PR is this:
Does this PR entail a change in behavior?
If yes, please specify the type of change:
Checklist:
Bugfix cherry-pick branch check:
🤖 Generated with Claude Code