Fix Spark 5 ORC filter and file scan test compatibility [databricks] [reduced-it] #17199
All Vouch review confidence checks passed
Residual risk 0.20 = Change Risk (0.46) × (1 − Review Confidence (0.57)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.46 · 479 lines diff across 5 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
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
Diff Size
diff_size
0.369
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #17199"
general
weight: 0.35
firestarman
Fixes #16702.
Fixes #17197.
Description
Spark 5 changed the JVM signature of
OrcFilters.createFilter. Keeping that call in the sharedsql-plugin-apiwrapper would produce incompatible bytecode across Spark parallel worlds and could cause packaging failures orNoSuchMethodErrorat runtime.This change moves the package-private call from the root-promoted
sql-plugin-apimodule into ordinarysql-pluginsource, which is compiled separately for every Spark parallel world. The shared source call omits the defaulted read-schema argument: pre-Spark-5 compilers emit the two-argument invocation, while Spark 5 supplies the defaultNoneand emits the three-argument invocation. Binary de-duplication retains the differing wrapper bytecode in the appropriate parallel worlds.Spark's read-schema guard currently affects nanosecond timestamp types, which the GPU ORC scan rejects during planning and leaves to Spark's CPU reader. Preserving
Nonetherefore retains existing supported behavior and avoids building an additional schema map for every file split. If GPU ORC later supports these types, the call must pass both the per-file ORC schema and the actual requested read schema.A later Spark 5 change also made the built-in
ParquetScan.partitionsimplementation final, which prevented two scan-split test fixtures from compiling. The suites now share a planning-onlyFileScanfixture matching the production GPU scan hierarchy, while retaining Spark'sParquetScanas the comparison baseline.There is no user-facing configuration or behavior change. This change restores Spark 5 build and test compatibility.
Performance validation compared Spark 5 ORC filter construction with and without the read schema while keeping the file schema and filter identical. Passing the read schema added about 3.4 microseconds per call for a 10-column schema, 50 microseconds for a 100-column read schema over a 1000-column file schema, and 531 microseconds for a 1000-column read schema. The final implementation passes no read schema and therefore retains the previous construction path without this additional per-split work.
Validation completed:
HistorySizedFileScanSuiteandScanSplitResizeSuite, 9 tests passed.sql-plugintest sources compiled and the same 9 tests passed.sql-pluginrun passed 323 of 324 tests; the remaining unrelatedClassInitializationSuitetest usesThread.suspend, which JDK 21 rejects.PushedFilters.testsmodule remains blocked by an unrelated existingGpuRangeBoundaryPythonIslandSuiteconstructor compatibility issue.This change was developed with AI assistance.
Checklists
Documentation
Testing
Performance