Class IcebergIO.WriteRows
- All Implemented Interfaces:
Serializable,HasDisplayData
- Enclosing class:
IcebergIO
- See Also:
-
Field Summary
Fields inherited from class org.apache.beam.sdk.transforms.PTransform
annotations, displayData, name, resourceHints -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionexpand(PCollection<Row> input) Override this method to specify how thisPTransformshould be expanded on the givenInputT.voidpopulateDisplayData(DisplayData.Builder builder) Register display data for the given transform or component.to(DynamicDestinations destinations) to(org.apache.iceberg.catalog.TableIdentifier identifier) withDirectWriteByteLimit(Integer directWriteByteLimit) withDistributionMode(org.apache.iceberg.DistributionMode mode) Defines distribution of write data.withMaximumTableCacheSize(int maximumTableCacheSize) Sets the maximum number of distinct table metadata specifications to broadcast in the side-input cache.withPartitionFields(List<String> partitionFields) Defines the desired Partition Spec to be applied when the Iceberg table must be dynamically created, e.g.Enables expirable side-input caching of Iceberg table metadata across workers.withSortOrder(List<String> sortFields) Defines the desired Sort Order to be applied when the Iceberg table must be dynamically created, e.g.withTableCachePollingBuckets(int pollingBuckets) Sets the number of parallel buckets/workers used to query the Iceberg catalog during refreshes.withTableCacheRefreshInterval(Duration refreshInterval) Sets the interval at which table metadata is refreshed from the Iceberg catalog.withTriggeringFrequency(Duration triggeringFrequency) Sets the frequency at which data is written to files and a newSnapshotis produced.withWriteProperties(Map<String, String> writeProperties) Defines properties to be passed to the Iceberg writer itself.Methods inherited from class org.apache.beam.sdk.transforms.PTransform
addAnnotation, compose, compose, getAdditionalInputs, getAnnotations, getDefaultOutputCoder, getDefaultOutputCoder, getDefaultOutputCoder, getKindString, getName, getResourceHints, setDisplayData, setResourceHints, toString, validate, validate
-
Constructor Details
-
WriteRows
public WriteRows()
-
-
Method Details
-
to
-
to
-
withTriggeringFrequency
Sets the frequency at which data is written to files and a newSnapshotis produced.Roughly every triggeringFrequency duration, records are written to data files and appended to the respective table. Each append operation creates a new table snapshot.
Generally speaking, increasing this duration will result in fewer, larger data files and fewer snapshots.
This is only applicable when writing an unbounded
PCollection(i.e. a streaming pipeline). -
withDirectWriteByteLimit
-
withDistributionMode
Defines distribution of write data. Supported distributions:DistributionMode.NONE: don't shuffle rows (default)DistributionMode.HASH: shuffle rows by partition key before writing data
DistributionMode.RANGEis not supported yet -
withAutosharding
-
withWriteProperties
Defines properties to be passed to the Iceberg writer itself. Note that these properties are execution-scoped, meaning that they are applied to a preexisting table and will not mutate any table-level properties.To set table-level properties that will be applied to dynamically created tables, use the managed Iceberg transform instead, setting the `table_properties` config property.
See: https://iceberg.apache.org/docs/latest/configuration/#write-properties
-
withPartitionFields
Defines the desired Partition Spec to be applied when the Iceberg table must be dynamically created, e.g. `bucket(id_field, 32)` or `day(timestamp_field)`See: https://iceberg.apache.org/spec/#partitioning
-
withSortOrder
Defines the desired Sort Order to be applied when the Iceberg table must be dynamically created, e.g. `int_field desc` or `bucket(modulo_5, 4) asc nulls last`See: https://iceberg.apache.org/spec/#sorting
-
withSideInputTableCache
Enables expirable side-input caching of Iceberg table metadata across workers.When enabled, a driver transform periodically polls the Iceberg catalog and broadcasts lightweight table specifications as a side input. Workers construct in-memory
Tablerepresentations without issuing remote catalog RPCs, drastically reducing catalog load. -
withMaximumTableCacheSize
Sets the maximum number of distinct table metadata specifications to broadcast in the side-input cache. Any tables exceeding this limit fall back to worker-local catalog loading.Note: This option is only supported for bounded (batch) pipelines. Calling this on an unbounded streaming pipeline will throw an exception at pipeline construction.
-
withTableCacheRefreshInterval
Sets the interval at which table metadata is refreshed from the Iceberg catalog.Applicable for unbounded streaming pipelines. Defaults to 5 minutes.
-
withTableCachePollingBuckets
Sets the number of parallel buckets/workers used to query the Iceberg catalog during refreshes. Defaults to 1 to serialize catalog queries and protect catalogs from connection spikes. -
populateDisplayData
Description copied from class:PTransformRegister display data for the given transform or component.populateDisplayData(DisplayData.Builder)is invoked by Pipeline runners to collect display data viaDisplayData.from(HasDisplayData). Implementations may callsuper.populateDisplayData(builder)in order to register display data in the current namespace, but should otherwise usesubcomponent.populateDisplayData(builder)to use the namespace of the subcomponent.By default, does not register any display data. Implementors may override this method to provide their own display data.
- Specified by:
populateDisplayDatain interfaceHasDisplayData- Overrides:
populateDisplayDatain classPTransform<PCollection<Row>,IcebergWriteResult> - Parameters:
builder- The builder to populate with display data.- See Also:
-
expand
Description copied from class:PTransformOverride this method to specify how thisPTransformshould be expanded on the givenInputT.NOTE: This method should not be called directly. Instead apply the
PTransformshould be applied to theInputTusing theapplymethod.Composite transforms, which are defined in terms of other transforms, should return the output of one of the composed transforms. Non-composite transforms, which do not apply any transforms internally, should return a new unbound output and register evaluators (via backend-specific registration methods).
- Specified by:
expandin classPTransform<PCollection<Row>,IcebergWriteResult>
-