case class RawTableTransformation(transformers: Map[String, Transformation[String, String]]) extends Transformation[RawTable, RawTable] with Product with Serializable

A transformation class that applies a specific set of transformations to the rows of a RawTable based on matching column names.

transformers

A map where the keys are column names (as String) and the values are Transformation[String, String] instances, which define how to transform data in the corresponding columns. This class implements the Transformation[RawTable, RawTable] trait, meaning it takes a RawTable as input and produces a transformed RawTable as output. The transformation process is based on matching column names from the transformers map with the column names in the table's header. If a match is found, the corresponding transformation is applied to the relevant column in each row of the table.

Example Usage

To use this class, first construct a RawTableTransformation instance by providing a map of column names and their corresponding transformations:

val transformers: Map[String, Transformation[String, String]] = Map(
  "column1" -> CustomTransformation1,
  "column2" -> CustomTransformation2
)
val transformation = RawTableTransformation(transformers)

// Apply the transformation to a RawTable object
val transformedTable = transformation(rawTable)

Implementation Details

  • The apply method retrieves the table's maybeHeader object, which contains the column names.
  • For each column name in the transformers map, it fetches the column index using Header.getIndex.
  • The transformations are then compiled into a map associating column indices with their respective transformations.
  • Finally, the table's rows are transformed using the map method, which applies a RawRowTransformation to each row.
See also

Transformation

RawTable

Header.getIndex

Linear Supertypes
Serializable, Product, Equals, Transformation[RawTable, RawTable], (RawTable) => RawTable, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. RawTableTransformation
  2. Serializable
  3. Product
  4. Equals
  5. Transformation
  6. Function1
  7. AnyRef
  8. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Instance Constructors

  1. new RawTableTransformation(transformers: Map[String, Transformation[String, String]])

    transformers

    A map where the keys are column names (as String) and the values are Transformation[String, String] instances, which define how to transform data in the corresponding columns. This class implements the Transformation[RawTable, RawTable] trait, meaning it takes a RawTable as input and produces a transformed RawTable as output. The transformation process is based on matching column names from the transformers map with the column names in the table's header. If a match is found, the corresponding transformation is applied to the relevant column in each row of the table.

    Example Usage

    To use this class, first construct a RawTableTransformation instance by providing a map of column names and their corresponding transformations:

    val transformers: Map[String, Transformation[String, String]] = Map(
      "column1" -> CustomTransformation1,
      "column2" -> CustomTransformation2
    )
    val transformation = RawTableTransformation(transformers)
    
    // Apply the transformation to a RawTable object
    val transformedTable = transformation(rawTable)

    Implementation Details

    • The apply method retrieves the table's maybeHeader object, which contains the column names.
    • For each column name in the transformers map, it fetches the column index using Header.getIndex.
    • The transformations are then compiled into a map associating column indices with their respective transformations.
    • Finally, the table's rows are transformed using the map method, which applies a RawRowTransformation to each row.

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. def andThen[A](g: (RawTable) => A): (RawTable) => A
    Definition Classes
    Function1
    Annotations
    @unspecialized()
  5. def apply(t: RawTable): RawTable

    Applies a set of transformations to a given RawTable.

    Applies a set of transformations to a given RawTable. The transformations are selectively applied based on the column indices determined by matching keys in the transformers map with the column headers (if available) in the input table.

    t

    the input RawTable which is a representation of a table containing rows and optionally headers. Each row in the table may be transformed based on the transformations for matching columns.

    returns

    a new RawTable where each row is transformed according to the applicable transformations.

    Definition Classes
    RawTableTransformation → Function1
  6. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  7. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native()
  8. def compose[A](g: (A) => RawTable): (A) => RawTable
    Definition Classes
    Function1
    Annotations
    @unspecialized()
  9. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  10. final def getClass(): Class[_ <: AnyRef]
    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. def productElementNames: Iterator[String]
    Definition Classes
    Product
  16. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  17. def toString(): String
    Definition Classes
    Function1 → AnyRef → Any
  18. val transformers: Map[String, Transformation[String, String]]
  19. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  20. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  21. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()

Deprecated Value Members

  1. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable]) @Deprecated
    Deprecated

    (Since version 9)

Inherited from Serializable

Inherited from Product

Inherited from Equals

Inherited from (RawTable) => RawTable

Inherited from AnyRef

Inherited from Any

Ungrouped