trait InputPreprocessor[Input, Row] extends AnyRef
A trait for preprocessing input data elements into rows, representing an early stage in data
transformation pipelines. The InputPreprocessor trait defines a contract for mapping input
data of type Input into rows of type Row, encapsulated in Try to handle processing outcomes.
This abstraction is intended to facilitate robust and reusable data-parsing workflows, allowing the encapsulation of individual transformations or mappings with error-handling functionality. Implementations of this trait can provide specific strategies or rules for transforming input into rows, effectively bridging raw input data and downstream processing.
- Input
the type of input elements to be processed, e.g., raw data points or records.
- Row
the type of rows to be produced by the mapping, e.g., structured representations of the input (such as case classes or key-value mappings).
- Alphabetic
- By Inheritance
- InputPreprocessor
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native()
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- def mapTsToRows(xs: Iterator[Input])(multiline: Boolean)(g: ((Input, Int)) => Try[Row])(implicit ev: Joinable[(Input, Int)]): Iterator[Try[Row]]
Processes an input iterator of type
Inputand maps its elements into rows of typeRowwhile handling potential errors using a specified transformation function.Processes an input iterator of type
Inputand maps its elements into rows of typeRowwhile handling potential errors using a specified transformation function. The function can operate in two modes: - Multiline mode: input data can span multiple lines and will be joined using the providedJoinabletype class. - Single-line mode: each input element is processed independently.- xs
The input iterator containing elements of type
Input.- multiline
A Boolean flag indicating whether to process input in multiline mode.
true: Enables multiline processing using the providedJoinabletype class.false: Processes each input independently.
- g
A transformation function that takes a tuple
(Input, Int), representing an input element and its index, and returns aTry[Row]. The function should encapsulate the logic for mapping input to a row, including error handling.- ev
An implicit instance of the
Joinable[(Input, Int)]type class, which handles joining and validating input tuples during multiline mode.- returns
An iterator of
Try[Row], where each element represents either a successfully processed row or a failure.- In multiline mode, elements may span across multiple lines, joined using the logic provided by the
Joinabletype class. - In single-line mode, each input element is processed individually.
- In multiline mode, elements may span across multiple lines, joined using the logic provided by the
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- AnyRef → Any
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
Deprecated Value Members
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable]) @Deprecated
- Deprecated
(Since version 9)