Packages

c

com.nvidia.spark.rapids

MultiFileParquetPartitionReader

class MultiFileParquetPartitionReader extends MultiFileCoalescingPartitionReaderBase with ParquetPartitionReaderBase

A PartitionReader that can read multiple Parquet files up to the certain size. It will coalesce small files together and copy the block data in a separate thread pool to speed up processing the small files before sending down to the GPU.

Efficiently reading a Parquet split on the GPU requires re-constructing the Parquet file in memory that contains just the column chunks that are needed. This avoids sending unnecessary data to the GPU and saves GPU memory.

Linear Supertypes
ParquetPartitionReaderBase, MultiFileCoalescingPartitionReaderBase, MultiFileReaderFunctions, FilePartitionReaderBase, Arm, ScanWithMetrics, Logging, PartitionReader[ColumnarBatch], Closeable, AutoCloseable, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. MultiFileParquetPartitionReader
  2. ParquetPartitionReaderBase
  3. MultiFileCoalescingPartitionReaderBase
  4. MultiFileReaderFunctions
  5. FilePartitionReaderBase
  6. Arm
  7. ScanWithMetrics
  8. Logging
  9. PartitionReader
  10. Closeable
  11. AutoCloseable
  12. AnyRef
  13. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new MultiFileParquetPartitionReader(conf: Configuration, splits: Array[PartitionedFile], clippedBlocks: Seq[ParquetSingleDataBlockMeta], isSchemaCaseSensitive: Boolean, readDataSchema: StructType, debugDumpPrefix: String, maxReadBatchSizeRows: Integer, maxReadBatchSizeBytes: Long, execMetrics: Map[String, GpuMetric], partitionSchema: StructType, numThreads: Int)

    conf

    the Hadoop configuration

    splits

    the partitioned files to read

    clippedBlocks

    the block metadata from the original Parquet file that has been clipped to only contain the column chunks to be read

    isSchemaCaseSensitive

    whether schema is case sensitive

    readDataSchema

    the Spark schema describing what will be read

    debugDumpPrefix

    a path prefix to use for dumping the fabricated Parquet data or null

    maxReadBatchSizeRows

    soft limit on the maximum number of rows the reader reads per batch

    maxReadBatchSizeBytes

    soft limit on the maximum number of bytes the reader reads per batch

    execMetrics

    metrics

    partitionSchema

    Schema of partitions.

    numThreads

    the size of the threadpool

Type Members

  1. class ParquetCopyBlocksRunner extends Callable[(Seq[DataBlockBase], Long)]

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. implicit def ParquetSingleDataBlockMeta(in: ExtraInfo): ParquetExtraInfo
  5. def addPartitionValues(batch: Option[ColumnarBatch], inPartitionValues: InternalRow, partitionSchema: StructType): Option[ColumnarBatch]
    Attributes
    protected
    Definition Classes
    MultiFileReaderFunctions
  6. def areNamesEquiv(groups: GroupType, index: Int, otherName: String, isCaseSensitive: Boolean): Boolean
    Attributes
    protected
    Definition Classes
    ParquetPartitionReaderBase
  7. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  8. var batch: Option[ColumnarBatch]
    Attributes
    protected
    Definition Classes
    FilePartitionReaderBase
  9. def calculateEstimatedBlocksOutputSize(filesAndBlocks: LinkedHashMap[Path, ArrayBuffer[DataBlockBase]], schema: SchemaBase): Long

    Calculate the output size according to the block chunks and the schema, and the estimated output size will be used as the initialized size of allocating HostMemoryBuffer

    Calculate the output size according to the block chunks and the schema, and the estimated output size will be used as the initialized size of allocating HostMemoryBuffer

    Please be note, the estimated size should be at least equal to size of HEAD + Blocks + FOOTER

    schema

    shema info

    returns

    Long, the estimated output size

    Definition Classes
    MultiFileParquetPartitionReaderMultiFileCoalescingPartitionReaderBase
  10. def calculateFinalBlocksOutputSize(footerOffset: Long, blocks: Seq[DataBlockBase], schema: SchemaBase): Long

    Calculate the final block output size which will be used to decide if re-allocate HostMemoryBuffer

    Calculate the final block output size which will be used to decide if re-allocate HostMemoryBuffer

    There is no need to re-calculate the block size, just calculate the footer size and plus footerOffset.

    If the size calculated by this function is bigger than the one calculated by calculateEstimatedBlocksOutputSize, then it will cause HostMemoryBuffer re-allocating, and cause the performance issue.

    footerOffset

    footer offset

    blocks

    blocks to be evaluated

    schema

    schema info

    returns

    the output size

    Definition Classes
    MultiFileParquetPartitionReaderMultiFileCoalescingPartitionReaderBase
  11. def calculateParquetFooterSize(currentChunkedBlocks: Seq[BlockMetaData], schema: MessageType): Long
    Attributes
    protected
    Definition Classes
    ParquetPartitionReaderBase
  12. def calculateParquetOutputSize(currentChunkedBlocks: Seq[BlockMetaData], schema: MessageType, handleCoalesceFiles: Boolean): Long
    Attributes
    protected
    Definition Classes
    ParquetPartitionReaderBase
  13. def checkIfNeedToSplitDataBlock(currentBlockInfo: SingleDataBlockInfo, nextBlockInfo: SingleDataBlockInfo): Boolean

    To check if the next block will be split into another ColumnarBatch

    To check if the next block will be split into another ColumnarBatch

    currentBlockInfo

    current SingleDataBlockInfo

    nextBlockInfo

    next SingleDataBlockInfo

    returns

    true: split the next block into another ColumnarBatch and vice versa

    Definition Classes
    MultiFileParquetPartitionReaderMultiFileCoalescingPartitionReaderBase
  14. def clone(): AnyRef
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @native() @throws( ... )
  15. def close(): Unit
    Definition Classes
    FilePartitionReaderBase → Closeable → AutoCloseable
  16. def closeOnExcept[T <: AutoCloseable, V](r: ArrayBuffer[T])(block: (ArrayBuffer[T]) ⇒ V): V

    Executes the provided code block, closing the resources only if an exception occurs

    Executes the provided code block, closing the resources only if an exception occurs

    Definition Classes
    Arm
  17. def closeOnExcept[T <: AutoCloseable, V](r: Array[T])(block: (Array[T]) ⇒ V): V

    Executes the provided code block, closing the resources only if an exception occurs

    Executes the provided code block, closing the resources only if an exception occurs

    Definition Classes
    Arm
  18. def closeOnExcept[T <: AutoCloseable, V](r: Seq[T])(block: (Seq[T]) ⇒ V): V

    Executes the provided code block, closing the resources only if an exception occurs

    Executes the provided code block, closing the resources only if an exception occurs

    Definition Classes
    Arm
  19. def closeOnExcept[T <: AutoCloseable, V](r: T)(block: (T) ⇒ V): V

    Executes the provided code block, closing the resource only if an exception occurs

    Executes the provided code block, closing the resource only if an exception occurs

    Definition Classes
    Arm
  20. val conf: Configuration
  21. def copyBlocksData(in: FSDataInputStream, out: HostMemoryOutputStream, blocks: Seq[BlockMetaData], realStartOffset: Long): Seq[BlockMetaData]

    Copies the data corresponding to the clipped blocks in the original file and compute the block metadata for the output.

    Copies the data corresponding to the clipped blocks in the original file and compute the block metadata for the output. The output blocks will contain the same column chunk metadata but with the file offsets updated to reflect the new position of the column data as written to the output.

    in

    the input stream for the original Parquet file

    out

    the output stream to receive the data

    returns

    updated block metadata corresponding to the output

    Attributes
    protected
    Definition Classes
    ParquetPartitionReaderBase
  22. val copyBufferSize: Int
    Definition Classes
    ParquetPartitionReaderBase
  23. def copyDataRange(range: CopyRange, in: FSDataInputStream, out: OutputStream, copyBuffer: Array[Byte]): Unit
    Attributes
    protected
    Definition Classes
    ParquetPartitionReaderBase
  24. def dumpDataToFile(hmb: HostMemoryBuffer, dataLength: Long, splits: Array[PartitionedFile], debugDumpPrefix: Option[String] = None, format: Option[String] = None): Unit

    Dump the data from HostMemoryBuffer to a file named by debugDumpPrefix + random + format

    Dump the data from HostMemoryBuffer to a file named by debugDumpPrefix + random + format

    hmb

    host data to be dumped

    dataLength

    data size

    splits

    PartitionedFile to be handled

    debugDumpPrefix

    file name prefix, if it is None, will not dump

    format

    file name suffix, if it is None, will not dump

    Attributes
    protected
    Definition Classes
    FilePartitionReaderBase
  25. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  26. def equals(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  27. def evolveSchemaIfNeededAndClose(inputTable: Table, filePath: String, clippedSchema: MessageType): Table
    Attributes
    protected
    Definition Classes
    ParquetPartitionReaderBase
  28. def fileSystemBytesRead(): Long
    Attributes
    protected
    Definition Classes
    MultiFileReaderFunctions
  29. def finalize(): Unit
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  30. def freeOnExcept[T <: RapidsBuffer, V](r: T)(block: (T) ⇒ V): V

    Executes the provided code block, freeing the RapidsBuffer only if an exception occurs

    Executes the provided code block, freeing the RapidsBuffer only if an exception occurs

    Definition Classes
    Arm
  31. def get(): ColumnarBatch
    Definition Classes
    FilePartitionReaderBase → PartitionReader
  32. def getBatchRunner(file: Path, outhmb: HostMemoryBuffer, blocks: ArrayBuffer[DataBlockBase], offset: Long): Callable[(Seq[DataBlockBase], Long)]

    The sub-class must implement the real file reading logic in a Callable which will be running in a thread pool

    The sub-class must implement the real file reading logic in a Callable which will be running in a thread pool

    file

    file to be read

    outhmb

    the sliced HostMemoryBuffer to hold the blocks, and the implementation is in charge of closing it in sub-class

    blocks

    blocks meta info to specify which blocks to be read

    offset

    used as the offset adjustment

    returns

    Callable[(Seq[DataBlockBase], Long)], which will be submitted to a ThreadPoolExecutor, and the Callable will return a tuple result and result._1 is block meta info with the offset adjusted result._2 is the bytes read

    Definition Classes
    MultiFileParquetPartitionReaderMultiFileCoalescingPartitionReaderBase
  33. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  34. final def getFileFormatShortName: String

    File format short name used for logging and other things to uniquely identity which file format is being used.

    File format short name used for logging and other things to uniquely identity which file format is being used.

    returns

    the file format short name

    Definition Classes
    MultiFileParquetPartitionReaderMultiFileCoalescingPartitionReaderBase
  35. def getPrecisionsList(fields: Seq[Type]): Seq[Int]
    Definition Classes
    ParquetPartitionReaderBase
  36. def getThreadPool(numThreads: Int): ThreadPoolExecutor

    Get ThreadPoolExecutor to run the Callable.

    Get ThreadPoolExecutor to run the Callable.

    The rules: 1. same ThreadPoolExecutor for cloud and coalescing for the same file format 2. different file formats have different ThreadPoolExecutors

    returns

    ThreadPoolExecutor

    Definition Classes
    MultiFileParquetPartitionReaderMultiFileCoalescingPartitionReaderBase
  37. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  38. def initializeLogIfNecessary(isInterpreter: Boolean, silent: Boolean): Boolean
    Attributes
    protected
    Definition Classes
    Logging
  39. def initializeLogIfNecessary(isInterpreter: Boolean): Unit
    Attributes
    protected
    Definition Classes
    Logging
  40. var isDone: Boolean
    Attributes
    protected
    Definition Classes
    FilePartitionReaderBase
  41. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  42. val isSchemaCaseSensitive: Boolean
  43. def isTraceEnabled(): Boolean
    Attributes
    protected
    Definition Classes
    Logging
  44. def log: Logger
    Attributes
    protected
    Definition Classes
    Logging
  45. def logDebug(msg: ⇒ String, throwable: Throwable): Unit
    Attributes
    protected
    Definition Classes
    Logging
  46. def logDebug(msg: ⇒ String): Unit
    Attributes
    protected
    Definition Classes
    Logging
  47. def logError(msg: ⇒ String, throwable: Throwable): Unit
    Attributes
    protected
    Definition Classes
    Logging
  48. def logError(msg: ⇒ String): Unit
    Attributes
    protected
    Definition Classes
    Logging
  49. def logInfo(msg: ⇒ String, throwable: Throwable): Unit
    Attributes
    protected
    Definition Classes
    Logging
  50. def logInfo(msg: ⇒ String): Unit
    Attributes
    protected
    Definition Classes
    Logging
  51. def logName: String
    Attributes
    protected
    Definition Classes
    Logging
  52. def logTrace(msg: ⇒ String, throwable: Throwable): Unit
    Attributes
    protected
    Definition Classes
    Logging
  53. def logTrace(msg: ⇒ String): Unit
    Attributes
    protected
    Definition Classes
    Logging
  54. def logWarning(msg: ⇒ String, throwable: Throwable): Unit
    Attributes
    protected
    Definition Classes
    Logging
  55. def logWarning(msg: ⇒ String): Unit
    Attributes
    protected
    Definition Classes
    Logging
  56. var maxDeviceMemory: Long
    Attributes
    protected
    Definition Classes
    FilePartitionReaderBase
  57. val metrics: Map[String, GpuMetric]
    Definition Classes
    ScanWithMetrics
  58. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  59. def next(): Boolean
    Definition Classes
    MultiFileCoalescingPartitionReaderBase → PartitionReader
  60. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  61. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  62. def populateCurrentBlockChunk(blockIter: BufferedIterator[BlockMetaData], maxReadBatchSizeRows: Int, maxReadBatchSizeBytes: Long): Seq[BlockMetaData]
    Attributes
    protected
    Definition Classes
    ParquetPartitionReaderBase
  63. def readBufferToTable(dataBuffer: HostMemoryBuffer, dataSize: Long, clippedSchema: SchemaBase, extraInfo: ExtraInfo): Table

    Sent host memory to GPU to decode

    Sent host memory to GPU to decode

    dataBuffer

    the data which can be decoded in GPU

    dataSize

    data size

    clippedSchema

    the clipped schema

    extraInfo

    the extra information for specific file format

    returns

    Table

    Definition Classes
    MultiFileParquetPartitionReaderMultiFileCoalescingPartitionReaderBase
  64. val readDataSchema: StructType
  65. def readPartFile(blocks: Seq[BlockMetaData], clippedSchema: MessageType, filePath: Path): (HostMemoryBuffer, Long)
    Attributes
    protected
    Definition Classes
    ParquetPartitionReaderBase
  66. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  67. implicit def toBlockMetaData(block: DataBlockBase): BlockMetaData
  68. implicit def toBlockMetaDataSeq(blocks: Seq[DataBlockBase]): Seq[BlockMetaData]
  69. implicit def toDataBlockBase(blocks: Seq[BlockMetaData]): Seq[DataBlockBase]
  70. implicit def toMessageType(schema: SchemaBase): MessageType
  71. def toString(): String
    Definition Classes
    AnyRef → Any
  72. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  73. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  74. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @throws( ... )
  75. def withResource[T <: AutoCloseable, V](r: ArrayBuffer[T])(block: (ArrayBuffer[T]) ⇒ V): V

    Executes the provided code block and then closes the array buffer of resources

    Executes the provided code block and then closes the array buffer of resources

    Definition Classes
    Arm
  76. def withResource[T <: AutoCloseable, V](r: Array[T])(block: (Array[T]) ⇒ V): V

    Executes the provided code block and then closes the array of resources

    Executes the provided code block and then closes the array of resources

    Definition Classes
    Arm
  77. def withResource[T <: AutoCloseable, V](r: Seq[T])(block: (Seq[T]) ⇒ V): V

    Executes the provided code block and then closes the sequence of resources

    Executes the provided code block and then closes the sequence of resources

    Definition Classes
    Arm
  78. def withResource[T <: AutoCloseable, V](r: Option[T])(block: (Option[T]) ⇒ V): V

    Executes the provided code block and then closes the Option[resource]

    Executes the provided code block and then closes the Option[resource]

    Definition Classes
    Arm
  79. def withResource[T <: AutoCloseable, V](r: T)(block: (T) ⇒ V): V

    Executes the provided code block and then closes the resource

    Executes the provided code block and then closes the resource

    Definition Classes
    Arm
  80. def withResourceIfAllowed[T, V](r: T)(block: (T) ⇒ V): V

    Executes the provided code block and then closes the value if it is AutoCloseable

    Executes the provided code block and then closes the value if it is AutoCloseable

    Definition Classes
    Arm
  81. def writeFileFooter(buffer: HostMemoryBuffer, bufferSize: Long, footerOffset: Long, blocks: Seq[DataBlockBase], clippedSchema: SchemaBase): (HostMemoryBuffer, Long)

    Writer a footer for a specific file format.

    Writer a footer for a specific file format. If there is no footer for the file format, just return (hmb, offset)

    Please be note, some file formats may re-allocate the HostMemoryBuffer because of the estimated initialized buffer size may be a little smaller than the actual size. So in this case, the hmb should be closed in the implementation.

    buffer

    The buffer holding (header + data blocks)

    bufferSize

    The total buffer size which equals to size of (header + blocks + footer)

    footerOffset

    Where begin to write the footer

    blocks

    The data block meta info

    clippedSchema

    The clipped schema info

    returns

    the buffer and the buffer size

    Definition Classes
    MultiFileParquetPartitionReaderMultiFileCoalescingPartitionReaderBase
  82. def writeFileHeader(buffer: HostMemoryBuffer): Long

    Write a header for a specific file format.

    Write a header for a specific file format. If there is no header for the file format, just ignore it and return 0

    buffer

    where the header will be written

    returns

    how many bytes written

    Definition Classes
    MultiFileParquetPartitionReaderMultiFileCoalescingPartitionReaderBase
  83. def writeFooter(out: OutputStream, blocks: Seq[BlockMetaData], schema: MessageType): Unit
    Attributes
    protected
    Definition Classes
    ParquetPartitionReaderBase

Inherited from MultiFileReaderFunctions

Inherited from FilePartitionReaderBase

Inherited from Arm

Inherited from ScanWithMetrics

Inherited from Logging

Inherited from PartitionReader[ColumnarBatch]

Inherited from Closeable

Inherited from AutoCloseable

Inherited from AnyRef

Inherited from Any

Ungrouped