← Back to Pull requests

[AURON #2590] Preserve session timezone in timestamp truncation #2607

Open
unknown opened this pull request with 205 lines diff across 2 files
View on GitHub
unknown unknown commented on Oct 24, 2026 23:33 UTC
Author

Which issue does this PR close?

Closes #2590

Rationale for this change

TruncTimestamp currently maps to DataFusion date_trunc, but Auron's native timestamp type does not carry Spark's session timezone. In Asia/Shanghai, midnight on Monday is still Sunday in UTC, so truncating to a week can return the previous Monday.

What changes are included in this PR?

Evaluate TruncTimestamp through the existing Spark expression wrapper inside the native projection. This preserves the resolved session timezone and Spark's format aliases and invalid-format behavior, at the cost of using the Spark wrapper for timestamp truncation.

Add converter serialization regressions and extend the native query test across UTC, Asia/Shanghai and America/Los_Angeles, including the reported dates, aliases and null/invalid formats.

Are there any user-facing changes?

Timestamp truncation respects the Spark session timezone, including week boundaries outside UTC.

How was this patch tested?

  • Converter regression baseline: 5 passed, 2 new tests failed; patched suite: 7 passed.

  • Built the native library with the pinned nightly-2025-05-09 toolchain and the project's pre profile.

  • OpenJDK 17, Spark 3.5.8, Scala 2.12: mvn -Pspark-3.5 -Pscala-2.12 -DskipBuildNative -DskipTests=false -pl spark-extension-shims-spark -am test — BUILD SUCCESS; 264 tests passed, 23 suites completed, no failures or aborted suites. The native library was built separately before this command.

  • git diff --check passed.
  • Was this patch authored or co-authored using generative AI tooling?

  • Yes

  • No
  • Generated-by: OpenAI Codex CLI 0.163.0

    Diff: 205 lines (+153 / -52) across 2 files Reviewer: cxzl25 Review duration: 41407m
    All Vouch review confidence checks passed
    Residual risk 0.21 = Change Risk (0.36) × (1 − Review Confidence (0.43)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.36 · 205 lines diff across 2 files
    0.36
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.02 · 1 substantive comment(s)
    0.02
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    42%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Shallow Review Depth shallow_review_depth
    0.344
    Diff Size diff_size
    0.319
    Real PR Conversation Timeline
    1 comments
    "Review active on #2607"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 43.0% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 36.3% (MEDIUM) · Higher = larger blast radius
    36.3%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 43.0% · Lower = rushed or shallow review
    43.0%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 20.7% · Safe to merge
    20.7%
    Repository