ArrowWriter

Save dataFrame content in Apache Arrow format (can be written to File, ByteArray, OutputStream or raw Channel) with targetSchema. If dataFrame content does not match targetSchema, the behaviour is specified by mode, and mismatches would be sent to mismatchSubscriber

Inheritors

Types

Link copied to clipboard
object Companion
Link copied to clipboard
data class Mode(val restrictWidening: Boolean, val restrictNarrowing: Boolean, val strictType: Boolean, val strictNullable: Boolean)

If restrictWidening is true, dataFrame columns not described in targetSchema would not be saved (otherwise, would be saved as is). If restrictNarrowing is true, targetSchema fields that are not nullable and do not exist in dataFrame will produce an exception (otherwise, would not be saved). If strictType is true, dataFrame columns described in targetSchema with non-compatible type will produce an exception (otherwise, would be saved as is). If strictNullable is true, targetSchema fields that are not nullable and contain nulls in dataFrame will produce an exception (otherwise, would be saved as is with nullable = true).

Properties

Link copied to clipboard
abstract val dataFrame: DataFrame<*>
Link copied to clipboard
Link copied to clipboard
abstract val mode: ArrowWriter.Mode
Link copied to clipboard
abstract val targetSchema: Schema

Functions

Link copied to clipboard
abstract fun allocateVectorSchemaRoot(): VectorSchemaRoot

Create Arrow VectorSchemaRoot with dataFrame content cast to targetSchema according to the mode.

Link copied to clipboard
abstract fun close()
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open fun writeArrowFeather(file: File)

Save data to Arrow random access format, write to new or existing file. If file exists, it would be recreated.

Save data to Arrow random access format, write to opened stream.

Save data to Arrow random access format, write to opened channel.

open fun writeArrowFeather(path: Path)

Save data to Arrow random access format, write to a new or existing file on the given path. If file on the given path exists, it would be recreated.

Link copied to clipboard
open fun writeArrowIPC(stream: OutputStream)

Save data to Arrow interprocess streaming format, write to opened stream.

Save data to Arrow interprocess streaming format, write to opened channel.

open fun writeArrowIPC(file: File, append: Boolean = true)

Save data to Arrow interprocess streaming format, write to new or existing file. If file exists, it can be recreated or expanded.

open fun writeArrowIPC(path: Path, append: Boolean = true)

Save data to Arrow interprocess streaming format, write to a new or existing file on the given path. If file on the given path exists, it can be recreated or expanded.