trait LayerDataFrameWriter extends AnyRef

Custom Spark DataFrameWriter for writing data to a given layer.

The layer type will be inferred from the layer configuration. Therefore the api to write to index layer or versioned layer is the same. To write to an index or versioned layer, your application must perform the following operations:

Below is an example written in Scala that demonstrates how to write data to an index layer:

import com.here.platform.data.client.spark.LayerDataFrameWriter.DataFrameExt

val spark =
  SparkSession
    .builder()
    .appName(getClass.getSimpleName)
    .master("local[*]")
    .getOrCreate()

val dataFrame: DataFrame = ???
dataFrame
    .writeLayer(catalogHrn, indexLayer)
    .save()

Java developers should use com.here.platform.data.client.spark.javadsl.JavaLayerDataFrameWriter#writeLayer instead of dataFrame.writeLayer:

Dataset<Row> df = ???
JavaLayerDataFrameWriter.create(df)
    .writeLayer(catalogHrn, layerId)
    .save()

The batch size (number of Rows) for a grouping can be restricted to a certain amount by setting the option olp.groupedBatchSize (ie 2 for 2 Rows to be in each group):

val dataFrame: DataFrame = ???
dataFrame
    .writeLayer(catalogHrn, indexLayer)
    .option("olp.groupedBatchSize", 2)
    .save()
Note

If the save method cannot correctly infer the DataConverter from the layer content type, the application will be required to provide the DataConverter using the withDataConverter method.

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. LayerDataFrameWriter
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Abstract Value Members

  1. abstract def option(key: String, value: String): LayerDataFrameWriter

    Adds an option for the underlying data source.

  2. abstract def option(key: String, value: Boolean): LayerDataFrameWriter

    Adds an option for the underlying data source.

  3. abstract def option(key: String, value: Long): LayerDataFrameWriter

    Adds an option for the underlying data source.

  4. abstract def option(key: String, value: Double): LayerDataFrameWriter

    Adds an option for the underlying data source.

  5. abstract def save(): Unit

    Save the data to the given layer *

  6. abstract def withDataConverter(dataConverter: DataConverter): LayerDataFrameWriter

    Specify a DataConverter to convert a collection of data Row to an aggregated data file as a byte array.

  7. abstract def withDataConverter(dataConverter: DataConverter): LayerDataFrameWriter

    Specify a DataConverter to convert a collection of data Row to an aggregated data file as a byte array.

  8. abstract def withDependencies(dependencies: Seq[VersionDependency]): LayerDataFrameWriter

    Specify the dependencies to be used for write operation

Concrete 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. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  10. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  11. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  12. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  13. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  14. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  15. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  16. def toString(): String
    Definition Classes
    AnyRef → Any
  17. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  18. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  19. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native()

Inherited from AnyRef

Inherited from Any

Ungrouped