velox-configuration.md

September 4, 2026 ยท View on GitHub


layout: page title: Configuration nav_order: 16

Gluten Velox backend configurations

KeyModifiabilityDefaultDescription
spark.gluten.sql.columnar.backend.velox.IOThreadsโš“ Static<undefined>The Size of the IO thread pool in the Connector. This thread pool is used for split preloading and DirectBufferedInput. By default, the value is the same as the maximum task slots per Spark executor.
spark.gluten.sql.columnar.backend.velox.SplitPreloadPerDriver๐Ÿ”„ Dynamic2The split preload per task
spark.gluten.sql.columnar.backend.velox.abandonPartialAggregationMinPct๐Ÿ”„ Dynamic90If partial aggregation aggregationPct greater than this value, partial aggregation may be early abandoned. Note: this option only works when flushable partial aggregation is enabled. Ignored when spark.gluten.sql.columnar.backend.velox.flushablePartialAggregation=false.
spark.gluten.sql.columnar.backend.velox.abandonPartialAggregationMinRows๐Ÿ”„ Dynamic100000If partial aggregation input rows number greater than this value, partial aggregation may be early abandoned. Note: this option only works when flushable partial aggregation is enabled. Ignored when spark.gluten.sql.columnar.backend.velox.flushablePartialAggregation=false.
spark.gluten.sql.columnar.backend.velox.asyncTimeoutOnTaskStoppingโš“ Static30000msTimeout in milliseconds when waiting for runtime-scoped async work to finish during teardown.
spark.gluten.sql.columnar.backend.velox.cacheEnabledโš“ StaticfalseEnable Velox cache, default off. It's recommended to enablesoft-affinity as well when enable velox cache.
spark.gluten.sql.columnar.backend.velox.cachePrefetchMinPctโš“ Static0Set prefetch cache min pct for velox file scan
spark.gluten.sql.columnar.backend.velox.checkUsageLeakโš“ StatictrueEnable check memory usage leak.
spark.gluten.sql.columnar.backend.velox.cudf.allowCpuFallbackโš“ StatictrueAllow cuDF to fall back to CPU execution for unsupported operators.
spark.gluten.sql.columnar.backend.velox.cudf.batchSize๐Ÿ”„ Dynamic2147483647Cudf input batch size after shuffle reader
spark.gluten.sql.columnar.backend.velox.cudf.concurrentGpuTasksโš“ Static1The number of concurrent GPU tasks to run.
spark.gluten.sql.columnar.backend.velox.cudf.enableTableScanโš“ StaticfalseEnable cudf table scan
spark.gluten.sql.columnar.backend.velox.cudf.enableValidation๐Ÿ”„ DynamictrueHeuristics you can apply to validate a cuDF/GPU plan and only offload when the entire stage can be fully and profitably executed on GPU
spark.gluten.sql.columnar.backend.velox.cudf.memoryPercentโš“ Static50The initial percent of GPU memory to allocate for memory resource for one thread.
spark.gluten.sql.columnar.backend.velox.cudf.memoryResourceโš“ StaticasyncGPU RMM memory resource.
spark.gluten.sql.columnar.backend.velox.cudf.shuffleMaxPrefetchBytes๐Ÿ”„ Dynamic1028MBMaximum bytes to prefetch in CPU memory during GPU shuffle read while waiting for GPU available.
spark.gluten.sql.columnar.backend.velox.directorySizeGuessโš“ Static32KBDeprecated, rename to spark.gluten.sql.columnar.backend.velox.footerEstimatedSize
spark.gluten.sql.columnar.backend.velox.driverSideBroadcastHashTableBuild๐Ÿ”„ DynamicfalseEnable driver-side broadcast hash table build. When enabled, the hash table is built and serialized on the driver, then broadcast to executors. When disabled, each executor builds its own hash table from the broadcast data.
spark.gluten.sql.columnar.backend.velox.enableTimestampNtzValidation๐Ÿ”„ DynamicfalseEnable validation fallback for TimestampNTZ type. When true, any plan containing TimestampNTZ will fall back to Spark execution. When false, allows native execution for TimestampNTZ scan.
spark.gluten.sql.columnar.backend.velox.fileHandleCacheEnabledโš“ StatictrueEnables caching of open file handles to avoid repeated open/close overhead. Benefits both local filesystems (fewer open/close syscalls and file descriptor churn) and remote filesystems/object stores (reused connection state). Should be disabled if files are mutable, i.e. file content may change while the file path stays the same.
spark.gluten.sql.columnar.backend.velox.fileHandleExpirationDurationMsโš“ Static10mExpiration time for cached file handles. Handles not accessed within this duration are evicted from the cache. This prevents stale handles from accumulating (e.g., expired HDFS leases, closed remote connections). Accepts a Spark duration string (e.g., "10m", "600s") or a plain number interpreted as milliseconds. A value of 0 disables TTL-based eviction.
spark.gluten.sql.columnar.backend.velox.filePreloadThresholdโš“ Static1MBSet the file preload threshold for velox file scan, refer to Velox's file-preload-threshold
spark.gluten.sql.columnar.backend.velox.floatingPointMode๐Ÿ”„ DynamiclooseConfig used to control the tolerance of floating point operations alignment with Spark. When the mode is set to strict, flushing is disabled for sum(float/double)and avg(float/double). When set to loose, flushing will be enabled.
spark.gluten.sql.columnar.backend.velox.flushablePartialAggregation๐Ÿ”„ DynamictrueEnable flushable aggregation. If true, Gluten will try converting regular aggregation into Velox's flushable aggregation when applicable. A flushable aggregation could emit intermediate result at anytime when memory is full / data reduction ratio is low.
spark.gluten.sql.columnar.backend.velox.footerEstimatedSizeโš“ Static32KBSet the footer estimated size for velox file scan, refer to Velox's footer-estimated-size
spark.gluten.sql.columnar.backend.velox.gpuAsyncShuffleReader.enabled๐Ÿ”„ DynamicfalseExperimental: Enable GPU async shuffle reader. When true, the gpu shuffle reader will use a thread pool to read and deserialize the input streams. When false, the shuffle reader will execute in the current thread.
spark.gluten.sql.columnar.backend.velox.gpuAsyncShuffleReader.maxPrefetchBytes๐Ÿ”„ Dynamic1GBThe maximum number of bytes to prefetch in CPU memory during GPU async shuffle read.
spark.gluten.sql.columnar.backend.velox.gpuAsyncShuffleReader.threadPoolSizeโš“ Static1The number of threads used by GPU async shuffle reader for decompressing and deserializing input streams.
spark.gluten.sql.columnar.backend.velox.hashProbe.bloomFilter.bypassMinPct๐Ÿ”„ Dynamic85Bypass the build-side Bloom filter when its acceptance percentage reaches this value.
spark.gluten.sql.columnar.backend.velox.hashProbe.bloomFilter.bypassMinRows๐Ÿ”„ Dynamic0Number of probe rows used to decide whether to bypass the build-side Bloom filter for left outer, existence, and left anti joins.
spark.gluten.sql.columnar.backend.velox.hashProbe.bloomFilterPushdown.maxSize๐Ÿ”„ Dynamic0bThe maximum byte size of Bloom filter that can be generated from hash probe. When set to 0, no Bloom filter will be generated. To achieve optimal performance, this should not be too larger than the CPU cache size on the host.
spark.gluten.sql.columnar.backend.velox.hashProbe.dynamicFilterPushdown.enabled๐Ÿ”„ DynamictrueWhether hash probe can generate any dynamic filter (including Bloom filter) and push down to upstream operators.
spark.gluten.sql.columnar.backend.velox.hashShuffle.reader.streamMerge.enabled๐Ÿ”„ DynamicfalseEnables a reader-side raw payload merge fast path for plain hash shuffle payloads within each shuffle input stream. This path merges payload buffers before Velox vectors are materialized, so it has lower per-batch overhead than generic VeloxResizeBatchesExec resizing, but it only covers plain payloads. Complex types and dictionary-encoded payloads are not merged by this path. VeloxResizeBatchesExec can still be enabled separately as a generic complement for types and encodings not covered by this fast path. If false, each hash shuffle payload is returned as its own columnar batch.
spark.gluten.sql.columnar.backend.velox.loadQuantumโš“ Static256MBSet the load quantum for velox file scan, recommend to use the default value (256MB) for performance consideration. If Velox cache is enabled, it can be 8MB at most.
spark.gluten.sql.columnar.backend.velox.maxCoalescedBytesโš“ Static64MBSet the max coalesced bytes for velox file scan
spark.gluten.sql.columnar.backend.velox.maxCoalescedDistanceโš“ Static512KBSet the max coalesced distance bytes for velox file scan
spark.gluten.sql.columnar.backend.velox.maxCompiledRegexes๐Ÿ”„ Dynamic100Controls maximum number of compiled regular expression patterns per function instance per thread of execution.
spark.gluten.sql.columnar.backend.velox.maxExtendedPartialAggregationMemory๐Ÿ”„ Dynamic<undefined>Set the max extended memory of partial aggregation in bytes. When this option is set to a value greater than 0, it will override spark.gluten.sql.columnar.backend.velox.maxExtendedPartialAggregationMemoryRatio. Note: this option only works when flushable partial aggregation is enabled. Ignored when spark.gluten.sql.columnar.backend.velox.flushablePartialAggregation=false.
spark.gluten.sql.columnar.backend.velox.maxExtendedPartialAggregationMemoryRatio๐Ÿ”„ Dynamic0.15Set the max extended memory of partial aggregation as maxExtendedPartialAggregationMemoryRatio of offheap size. Note: this option only works when flushable partial aggregation is enabled. Ignored when spark.gluten.sql.columnar.backend.velox.flushablePartialAggregation=false.
spark.gluten.sql.columnar.backend.velox.maxPartialAggregationMemory๐Ÿ”„ Dynamic<undefined>Set the max memory of partial aggregation in bytes. When this option is set to a value greater than 0, it will override spark.gluten.sql.columnar.backend.velox.maxPartialAggregationMemoryRatio. Note: this option only works when flushable partial aggregation is enabled. Ignored when spark.gluten.sql.columnar.backend.velox.flushablePartialAggregation=false.
spark.gluten.sql.columnar.backend.velox.maxPartialAggregationMemoryRatio๐Ÿ”„ Dynamic0.1Set the max memory of partial aggregation as maxPartialAggregationMemoryRatio of offheap size. Note: this option only works when flushable partial aggregation is enabled. Ignored when spark.gluten.sql.columnar.backend.velox.flushablePartialAggregation=false.
spark.gluten.sql.columnar.backend.velox.maxPartitionsPerWritersSession๐Ÿ”„ Dynamic10000Maximum number of partitions per a single table writer instance.
spark.gluten.sql.columnar.backend.velox.maxSpillBytes๐Ÿ”„ Dynamic100GThe maximum file size of a query
spark.gluten.sql.columnar.backend.velox.maxSpillFileSize๐Ÿ”„ Dynamic1GBThe maximum size of a single spill file created
spark.gluten.sql.columnar.backend.velox.maxSpillLevel๐Ÿ”„ Dynamic4The max allowed spilling level with zero being the initial spilling level
spark.gluten.sql.columnar.backend.velox.maxSpillRunRows๐Ÿ”„ Dynamic3MThe maximum row size of a single spill run
spark.gluten.sql.columnar.backend.velox.memCacheSizeโš“ Static1GBThe memory cache size
spark.gluten.sql.columnar.backend.velox.memInitCapacity๐Ÿ”„ Dynamic8MBThe initial memory capacity to reserve for a newly created Velox query memory pool.
spark.gluten.sql.columnar.backend.velox.memoryPoolCapacityTransferAcrossTasks๐Ÿ”„ DynamictrueWhether to allow memory capacity transfer between memory pools from different tasks.
spark.gluten.sql.columnar.backend.velox.memoryUseHugePages๐Ÿ”„ DynamicfalseUse explicit huge pages for Velox memory allocation.
spark.gluten.sql.columnar.backend.velox.numCacheFileHandlesโš“ Static10000Maximum number of entries in the file handle cache. Each entry holds an open file descriptor (local FS) or connection state (remote FS). Note that on local filesystems, high values may approach the OS file descriptor limit (ulimit -n). On remote object stores (S3, ABFS, GCS) entries represent network connections/sockets rather than per-file OS file descriptors, but they can still count toward OS resource limits (ulimit -n).
spark.gluten.sql.columnar.backend.velox.orc.scan.enabled๐Ÿ”„ DynamictrueEnable velox orc scan. If disabled, vanilla spark orc scan will be used.
spark.gluten.sql.columnar.backend.velox.parquet.dictionaryPageSizeBytes๐Ÿ”„ Dynamic2MBThe maximum size in bytes for a Parquet dictionary page
spark.gluten.sql.columnar.backend.velox.parquet.pageSizeBytes๐Ÿ”„ Dynamic1MBThe page size in bytes is for compression.
spark.gluten.sql.columnar.backend.velox.parquetMaxTargetFileSize๐Ÿ”„ Dynamic0bThe target file size for each output file when writing data. 0 means no limit on target file size, and the actual file size will be determined by other factors such as max partition number and shuffle batch size.
spark.gluten.sql.columnar.backend.velox.parquetUseColumnNames๐Ÿ”„ DynamictrueMaps table field names to file field names using names, not indices for Parquet files.
spark.gluten.sql.columnar.backend.velox.prefetchRowGroupsโš“ Static1Set the prefetch row groups for velox file scan
spark.gluten.sql.columnar.backend.velox.queryTraceEnabled๐Ÿ”„ DynamicfalseEnable query tracing flag.
spark.gluten.sql.columnar.backend.velox.reclaimMaxWaitMs๐Ÿ”„ Dynamic3600000msThe max time in ms to wait for memory reclaim.
spark.gluten.sql.columnar.backend.velox.resizeBatches.copyRanges.enabled๐Ÿ”„ DynamictrueEnables a VeloxResizeBatchesExec fast path that combines eligible batches using Velox vector copyRanges instead of generic RowVector append. When possible, it collects the small input batches for one VeloxResizeBatchesExec output, allocates the output RowVector once, and bulk-copies child vector ranges. This is most useful for shuffle-read outputs where plain hash shuffle payloads are materialized as dense flat vectors. Complex vectors can also use copyRanges, but ARRAY and MAP still rebuild nested offsets and sizes while bulk-copying child ranges. Unsupported encodings such as dictionary and constant vectors fall back to the generic copy path. This option is enabled by default and complements the reader-side raw payload merge fast path: that path avoids materializing small plain payload batches, while this option optimizes VeloxResizeBatchesExec when that operator is enabled.
spark.gluten.sql.columnar.backend.velox.resizeBatches.shuffleInput๐Ÿ”„ DynamictrueIf true, combine small columnar batches together before sending to shuffle. The default minimum output batch size is equal to 0.25 * spark.gluten.sql.columnar.maxBatchSize
spark.gluten.sql.columnar.backend.velox.resizeBatches.shuffleInput.minSize๐Ÿ”„ Dynamic<undefined>The minimum batch size for shuffle. If size of an input batch is smaller than the value, it will be combined with other batches before sending to shuffle. Only functions when spark.gluten.sql.columnar.backend.velox.resizeBatches.shuffleInput is set to true. Default value: 0.25 *
spark.gluten.sql.columnar.backend.velox.resizeBatches.shuffleInputOutput.minSize๐Ÿ”„ Dynamic<undefined>The minimum batch size for shuffle input and output. If size of an input batch is smaller than the value, it will be combined with other batches before sending to shuffle. The same applies for batches output by shuffle read. Only functions when spark.gluten.sql.columnar.backend.velox.resizeBatches.shuffleInput or spark.gluten.sql.columnar.backend.velox.resizeBatches.shuffleOutput is set to true. Default value: 0.25 *
spark.gluten.sql.columnar.backend.velox.resizeBatches.shuffleOutput๐Ÿ”„ DynamicfalseIf true, combine small columnar batches together right after shuffle read. The default minimum output batch size is equal to 0.25 * spark.gluten.sql.columnar.maxBatchSize
spark.gluten.sql.columnar.backend.velox.scan.bloomFilterPushdown.enabledโš“ StaticfalseWhether to push Bloom filters into Velox scans.
spark.gluten.sql.columnar.backend.velox.showTaskMetricsWhenFinished๐Ÿ”„ DynamicfalseShow velox full task metrics when finished.
spark.gluten.sql.columnar.backend.velox.spillFileSystem๐Ÿ”„ DynamiclocalThe filesystem used to store spill data. local: The local file system. heap-over-local: Write file to JVM heap if having extra heap space. Otherwise write to local file system.
spark.gluten.sql.columnar.backend.velox.spillNumMaxMergeFiles๐Ÿ”„ Dynamic0The max number of files to merge at a time when merging sorted files into a single ordered stream. 0 means unlimited.
spark.gluten.sql.columnar.backend.velox.spillStrategy๐Ÿ”„ Dynamicautonone: Disable spill on Velox backend; auto: Let Spark memory manager manage Velox's spilling
spark.gluten.sql.columnar.backend.velox.ssdCacheIOThreadsโš“ Static4The number of IO threads for SSD cache read/write operations
spark.gluten.sql.columnar.backend.velox.ssdCachePathโš“ Static/tmpThe folder to store the cache files, better on SSD
spark.gluten.sql.columnar.backend.velox.ssdCacheShardsโš“ Static1The cache shards
spark.gluten.sql.columnar.backend.velox.ssdCacheSizeโš“ Static1GBThe SSD cache size, will do memory caching only if this value = 0
spark.gluten.sql.columnar.backend.velox.ssdCheckpointIntervalBytesโš“ Static0Checkpoint after every 'checkpointIntervalBytes' for SSD cache. 0 means no checkpointing.
spark.gluten.sql.columnar.backend.velox.ssdChecksumEnabledโš“ StaticfalseIf true, checksum write to SSD is enabled.
spark.gluten.sql.columnar.backend.velox.ssdChecksumReadVerificationEnabledโš“ StaticfalseIf true, checksum read verification from SSD is enabled.
spark.gluten.sql.columnar.backend.velox.ssdDisableFileCowโš“ StaticfalseTrue if copy on write should be disabled.
spark.gluten.sql.columnar.backend.velox.ssdODirectโš“ StaticfalseThe O_DIRECT flag for cache writing
spark.gluten.sql.columnar.backend.velox.valueStream.dynamicFilter.enabled๐Ÿ”„ DynamicfalseWhether to apply dynamic filters pushed down from hash probe in the ValueStream (shuffle reader) operator to filter rows before they reach the hash join.
spark.gluten.sql.enable.enhancedFeatures๐Ÿ”„ DynamictrueEnable some features including iceberg native write and other features.
spark.gluten.sql.rewrite.castArrayToString๐Ÿ”„ DynamictrueWhen true, rewrite cast(array as String) to concat('[', array_join(array, ', ', null), ']') to allow offloading to Velox.
spark.gluten.velox.broadcast.build.targetBytesPerThreadโš“ Static32MBIt is used to calculate the number of hash table build threads. Based on our testing across various thresholds (1MB to 128MB), we recommend a value of 32MB or 64MB, as these consistently provided the most significant performance gains.
spark.gluten.velox.broadcastBuild.mergeBatches๐Ÿ”„ DynamicfalseIf enabled, all columnar batches in a broadcast build relation will be serialized into a single buffer to reduce the number of addInput calls in HashBuild operator. This can significantly improve BHJ performance when the broadcast table has many small batches, but may increase driver-side peak memory and is not suitable for very large broadcasts.
spark.gluten.velox.castFromVarcharAddTrimNode๐Ÿ”„ DynamicfalseIf true, will add a trim node which has the same semantic as vanilla Spark to CAST-from-varchar.Otherwise, do nothing.
spark.gluten.velox.decimalToFloatHighPrecisionCastEnabled๐Ÿ”„ DynamicfalseIf true, enables high-precision casts from DECIMAL to REAL/DOUBLE in Velox, which match vanilla Spark for values that cannot be represented exactly by floating-point arithmetic. Disabled by default because it is slower than the default conversion; enable it if precision matters more than throughput.
spark.gluten.velox.s3MaxConcurrentUploadNumโš“ Static4The maximum number of in-flight S3 part uploads per file.
spark.gluten.velox.s3UploadPartAsyncโš“ StaticfalseIf true, S3 multipart upload parts are uploaded asynchronously.
spark.gluten.velox.s3UploadThreadsโš“ Static16The number of shared S3 part upload threads.

Gluten Velox backend experimental configurations

KeyModifiabilityDefaultDescription
spark.gluten.velox.abandonDedupHashMap.minPct๐Ÿ”„ Dynamic0Experimental: abandon hashmap build if duplicated rows are more than this percentile. Value is integer based and range is [0, 100].
spark.gluten.velox.abandonDedupHashMap.minRows๐Ÿ”„ Dynamic100000Experimental: abandon hashmap build if duplicated rows more than this number.
spark.gluten.velox.joinBuildVectorHasherMaxNumDistinct๐Ÿ”„ Dynamic1000000Experimental: maximum number of distinct values to keep when merging vector hashers in join HashBuild.
spark.gluten.velox.minTableRowsForParallelJoinBuild๐Ÿ”„ Dynamic1000Experimental: the minimum number of table rows that can trigger the parallel hash join table build.
spark.gluten.velox.offHeapBroadcastBuildRelation.enabled๐Ÿ”„ DynamicfalseExperimental: If enabled, broadcast build relation will use offheap memory. Otherwise, broadcast build relation will use onheap memory.