Packages

c

io.delta.flink.sink.internal

DeltaBucketAssigner

class DeltaBucketAssigner[T] extends BucketAssigner[T, String]

Custom implementation of BucketAssigner class required to provide behaviour on how to map particular events to buckets (aka partitions).

This implementation can be perceived as a utility class for complying to the DeltaLake's partitioning style (that follows Apache Hive's partitioning style by providing the partitioning column's and its values as FS directories paths, e.g. "/some_path/table_1/date=2020-01-01") It's still possible for users to roll out their own version of BucketAssigner and pass it to the DeltaSinkBuilder during creation of the sink.

This DeltaBucketAssigner is applicable only to DeltaSinkBuilder and not to RowDataDeltaSinkBuilder. The former lets you use this DeltaBucketAssigner to provide the required custom bucketing behaviour, while the latter doesn't expose a custom bucketing API, and you can provide the partition column keys only.

Thus, this DeltaBucketAssigner is currently not exposed to the user through any public API.

In the future, if you'd like to implement your own custom bucketing...

    /////////////////////////////////////////////////////////////////////////////////
    // implements a custom partition computer
    /////////////////////////////////////////////////////////////////////////////////
    static class CustomPartitionColumnComputer implements DeltaPartitionComputer<RowData> {

        @Override
        public LinkedHashMap<String, String> generatePartitionValues(
                RowData element, BucketAssigner.Context context) {
            String f1 = element.getString(0).toString();
            int f3 = element.getInt(2);
            LinkedHashMap<String, String> partitionSpec = new LinkedHashMap<>();
            partitionSpec.put("f1", f1);
            partitionSpec.put("f3", Integer.toString(f3));
            return partitionSpec;
        }
    }
    ...
    /////////////////////////////////////////
    // creates partition assigner for a custom partition computer
    /////////////////////////////////////////
    DeltaBucketAssignerInternal<RowData> partitionAssigner =
                new DeltaBucketAssignerInternal<>(new CustomPartitionColumnComputer());

    ...

    /////////////////////////////////////////////////////////////////////////////////
    // create the builder
    /////////////////////////////////////////////////////////////////////////////////

    DeltaSinkBuilder<RowData></RowData> foo =
     new DeltaSinkBuilder.DefaultDeltaFormatBuilder<>(
        ...,
        partitionAssigner,
        ...)

Linear Supertypes
BucketAssigner[T, String], Serializable, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. DeltaBucketAssigner
  2. BucketAssigner
  3. Serializable
  4. AnyRef
  5. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new DeltaBucketAssigner(partitionComputer: DeltaPartitionComputer[T])

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. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  5. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native()
  6. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  7. def equals(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  8. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  9. def getBucketId(element: T, context: Context): String
    Definition Classes
    DeltaBucketAssigner → BucketAssigner
    Annotations
    @Override()
  10. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  11. def getSerializer(): SimpleVersionedSerializer[String]
    Definition Classes
    DeltaBucketAssigner → BucketAssigner
    Annotations
    @Override()
  12. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  13. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  14. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  15. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  16. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  17. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  18. def toString(): String
    Definition Classes
    DeltaBucketAssigner → AnyRef → Any
    Annotations
    @Override()
  19. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  20. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  21. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native()

Inherited from BucketAssigner[T, String]

Inherited from Serializable

Inherited from AnyRef

Inherited from Any

Ungrouped