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()

BatchWrite of this connector

UnsupportedOperationException by default

toBatch throws an UnsupportedOperationException by default and is expected to be overriden by implementations.

[description]: Batch write is not supported

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

See:

Used when:

  • V2ExistingTableWriteExec physical command is executed
  • 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