class IndexedInputToRowsAggregator[Input, Row] extends InputAggregator[Input, Row, Try]
The IndexedInputToRowsAggregator class provides functionality to process and aggregate input
data of type Input into structured rows of type Row, with support for error handling,
validation, and conditional processing. It extends the abstract class InputAggregator.
The class leverages implicit Joinable behavior for Input and works with Try to handle
potential failures during the transformation of input data into rows. The flexibility is further
increased with options to apply a custom predicate to filter rows, enable forgiving behavior (ignoring
failures), and process multi-line inputs.
- Input
the type of input elements to be processed.
- Row
the type of rows transformed from the input.
- Alphabetic
- By Inheritance
- IndexedInputToRowsAggregator
- InputAggregator
- InputPreprocessor
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Instance Constructors
- new IndexedInputToRowsAggregator(f: ((Input, Int)) => Try[Row], multiline: Boolean, forgiving: Boolean, predicate: (Try[Row]) => Boolean)(implicit arg0: Joinable[Input])
- f
a function that takes a tuple of
(Input, Int)and returns aTry[Row], used to transform each input element and its index into aRow.- multiline
a flag indicating whether multi-line input processing is enabled.
- forgiving
a flag indicating whether forgiving behavior is enabled (i.e., failures are logged and ignored rather than propagated).
- predicate
a function that takes a
Try[Row]and returns a boolean, used to filter processed rows based on custom validation logic.
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
- Definition Classes
- InputPreprocessor
- 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()
- def processInput(xs: Iterator[Input]): Try[Iterator[Row]]
Processes an iterator of inputs and transforms them into a wrapped iterator of rows.
Processes an iterator of inputs and transforms them into a wrapped iterator of rows.
This method combines the transformation of inputs into
Try[Row]throughmapTsToRowsand the subsequent processing of these tried rows throughprocessTriedRows.- xs
an iterator of inputs of type
Inputto be processed.- returns
a
Wrappercontaining an iterator of rows of typeRow, where the transformation and processing operations have been applied to the inputs.
- Definition Classes
- IndexedInputToRowsAggregator → InputAggregator
- def processTriedRows(rys: Iterator[Try[Row]]): Try[Iterator[Row]]
Processes an iterator of
Trywrapped rows, transforming it into a singleTrythat contains an iterator of successfully processed rows.Processes an iterator of
Trywrapped rows, transforming it into a singleTrythat contains an iterator of successfully processed rows.NOTE this is not a simple iterator to iterator pipeline. We have to sequence the input to get the output.
- rys
an iterator of
Try[Row], where eachTryrepresents the result of processing a single row which may either succeed or fail- returns
a
Try[Iterator[Row]]that encapsulates either:- a success containing an iterator of all successfully processed rows, or
- a failure if any of the individual rows failed during processing
- Definition Classes
- IndexedInputToRowsAggregator → InputAggregator
- 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()
- implicit object JoinableTInt extends JoinableTInt[Input]
Implicit object that provides a
JoinableTIntinstance for the typeInput.Implicit object that provides a
JoinableTIntinstance for the typeInput.This object extends
JoinableTIntfor the type parameterInputand provides an implicitJoinableinstance forInput. It defines the joining behavior for tuples of type(Input, Int)while utilizing the underlyingJoinableinstance forInput.Example usage:
val joinableTIntInstance = JoinableTInt // use the implicit instance for operations requiring JoinableTInt[(Input, Int)]
- Note
This object is implicitly available in the scope where required. It relies on an implicit
Joinable[Input]defined elsewhere in the application.- See also
JoinableTInt for its detailed trait definition.
Example:
Deprecated Value Members
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable]) @Deprecated
- Deprecated
(Since version 9)