[FEA] Configure RapidsFileIO and route file reads and writes by URI scheme [databricks] #17055
All Vouch review confidence checks passed
Residual risk 0.43 = Change Risk (0.75) × (1 − Review Confidence (0.43)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.75 · 650 lines diff across 8 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 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.388
Shallow Review Depth
shallow_review_depth
0.344
Sensitive Paths
sensitive_paths
0.075
Real PR Conversation Timeline
1 comments
"Review active on #17055"
general
weight: 0.35
gerashegalov
Fixes #17025.
Stacked on #17054.
Description
An application selects how RAPIDS opens data files with
spark.rapids.sql.fileio.impl. Its registered default iscom.nvidia.spark.rapids.fileio.hadoop.HadoopFileIO(bothHadoopFileIOandResolvingRapidsFileIOare also accepted by simple name). A custom implementation must be a public concreteRapidsFileIOwith a publicjava.util.Map<String, String>constructor. RAPIDS stripsspark.rapids.sql.fileio.and consumes the selectingimplkey while preserving the original string values.FileIOConfigandResolvingRapidsFileIOlive insql-plugin-fileio.RapidsConf.fileIOConfiglazily caches a snapshot of the session settings, andRapidsConf.fileIOConfig(SQLConf)reads directly fromSQLConfviaTrampolineUtil.getPrefixedSqlConfs(skipping option scanning forHadoopFileIO) so callers without an existingRapidsConfavoid copying the full conf map. Driver planning eagerly validates top-level and per-scheme custom classes, modifiers,Mapconstructors, and scheme-key casings viaResolvingRapidsFileIO.parseRoutes(supporting dotted URI schemes such ascustom.io://while preserving dotted options such ass3.client.impland rejecting conflicting case variants).Parquet and ORC reader factories share
BroadcastedFileIOand write jobs useGpuWriteJobDescriptionto broadcastFileIOConfig(registered withKryoJavaSerializerinGpuKryoRegistratorso both Java serialization andKryoSerializer— includingspark.kryo.registrationRequired=true— are supported) and constructRapidsFileIOlazily once per task on executors.ResolvingRapidsFileIOand customAutoCloseableRapidsFileIOimplementations are closed via Spark task completion listeners when the task ends;ResolvingRapidsFileIOalso tracks closure (volatile boolean closed) so any delegate constructed concurrently withclose()is removed and closed once rather than leaked. Non-FileIO reader factories (CSV, JSON, Avro, Hive text) do not broadcastFileIOConfig.This covers GPU Parquet and ORC reads (including hybrid Parquet scans, which restrict KvikIO local-file reads to exact
HadoopFileIOand keep customRapidsFileIOimplementations andHadoopFileIOsubclasses onRapidsFileIORangeReader), writes through the shared GPU file-format writer, and OSS Delta Lake on-disk deletion vectors with pushdown enabled. Parquet passes knownPartitionedFile.fileSizevianewInputFile(path, length)to avoid extra S3/GCS metadata HEAD requests onHadoopFileIOand validatesfooterIndexbounds inParquetFooterUtils.readFooterBufferFromInputFilebefore allocating host buffers.IcebergS3InputFilerecordsrecordPerfioS3BackendOnceso Iceberg-on-S3 PerfIO task metrics remain intact. Dictionary and Bloom filter pruning retainParquetFileReaderthrough Hadoop, and CSV/JSON/Avro/Hive text, legacy/Databricks Delta DVs, Spark file discovery/commits, and Iceberg table I/O continue using their existing paths. Follow-up #17200 tracks simplifyingHadoopFileIOwith this configuration framework.AI assistance was used to implement and test this change.
Verification
Validated commit
cb5bbea4308022e7b3b9f99eb2576a51d62a35e2(combined withmain6283d81f92296a24bc91d19e5ba91da61173f477) on 2026-12-04:RapidsFileIOSuite(18/18, including latch-controlled concurrentResolvingRapidsFileIO.close()delegate cleanup and local hybrid Parquet scan with aHadoopFileIOsubclass),HybridScanNativeFileSuite(8/8), andGpuKryoRegistratorSuite(2/2, including GPU Parquet & ORC scans withspark.kryo.registrationRequired=true); additionally on350a0c5038/4f7f7a0b21,GpuFileFormatDataWriterSuite,OrcPerfIOReadSuite,IcebergS3InputFileSuite, andRapidsConfSuiteall passed.testsreactor), and Spark 4.0.4 (Scala 2.13).scalastyle-all-modules(0 errors/warnings),with-resource-nesting-audit,test_root_safe_provider_selection.py,iceberg-matrix-tests, and static shim preflight across all 34mainprofiles (330–421, including400db173and410db183) all passed with 0 new findings.g6.4xlargeL4 GPU,INCLUDE_SPARK_AVRO_JAR=true ./run_pyspark_from_build.sh, previously run on1ff4fcfef9): Spark 3.3.0 (Scala 2.12) passed30,896/30,896(0 failed); Spark 4.0.2 (Scala 2.13) passed32,364/32,364(0 failed).400db173,410db183) are validated statically via shim preflight only (no local Databricks JARs). S3/GCS end-to-end runs on this head (including Parquet and Iceberg S3 path tests) remain to be run against S3/GCS storage.Performance
On Spark 3.5.9 and a local RTX 5880 Ada GPU (measured on
feff4baaa40e055ef7ca9b5f67d980c1ad436629), a filtered Parquet aggregation over 2 million rows in 16 files had a median of 73.85 ms with the defaultHadoopFileIOand 75.21 ms withResolvingRapidsFileIOfalling back to Hadoop. Each setting had three warmups and nine interleaved measurements.Reader and writer setup paths that only hold
SQLConfavoid copyingSQLConf.getAllConfs, using a singleFILE_IO_IMPL.get(sqlConf)lookup forHadoopFileIOand prefix-only scanning ofSQLConf.settingsfor custom implementations. Parquet passesPartitionedFile.fileSizevianewInputFile(path, length)soHadoopInputFile/S3InputFile/GCSInputFilereturn the known length directly without an extra S3 HEAD or GCS metadata request, andParquetFooterUtils.readFooterBufferFromInputFileprefetches a 64 KiB tail in a single suffix-range read. Parquet/ORC reader factories and write jobs broadcastFileIOConfigrather than serializingRapidsFileIO, while non-FileIO reader factories (CSV, JSON, Avro, Hive text) do not create anyFileIOConfigbroadcast.Dictionary and Bloom filter pruning still require Hadoop read access even when data and footer reads use a custom FileIO. Production cloud latency remains unmeasured.
Checklists
Documentation
Testing
Performance