Skip to content

Write

Write is an abstraction of writers.

Contract

Description

String description()

Defaults to the name of this Write class

Used when:

Supported CustomMetrics

CustomMetric[] supportedCustomMetrics()

Defaults to no CustomMetrics

Used when:

Creating BatchWrite

BatchWrite toBatch()

toBatch throws an UnsupportedOperationException by default:

[description]: Batch write is not supported

toBatch should be implemented for Tables that create Writes that reports BATCH_WRITE support in their capabilities.

Used when:

  • V2ExistingTableWriteExec is requested to run
  • TableWriteExecHelper is requested to writeToTable

Creating StreamingWrite

StreamingWrite toStreaming()

toStreaming throws an UnsupportedOperationException by default:

[description]: Streaming write is not supported

toStreaming should be implemented for Tables that create Writes that reports STREAMING_WRITE support in their capabilities.

Used when:

Implementations

  • ConsoleTable (Spark Structured Streaming)
  • WriteBuilder
  • FileWrite
  • ForeachWrite (Spark Structured Streaming)
  • KafkaWrite
  • MemoryWrite (Spark Structured Streaming)
  • NoopWrite
  • RequiresDistributionAndOrdering
  • V1Write