Example 1: Wrapper with DataRow - Aster Analytics

Teradata AsterĀ® Spark Connector User Guide

Product
Aster Analytics
Release Number
7.00.00.01
Published
May 2017
Language
English (United States)
Last Update
2018-04-13
dita:mapPath
dbt1482959363906.ditamap
dita:ditavalPath
Generic_no_ie_no_tempfilter.ditaval
dita:id
dbt1482959363906
lifecycle
previous
Product Category
Software
/** The Echo Class is an example wrapper function that uses the Aster-Spark API
 * and simply returns the input RDD as output. It mimics the behavior of an echo
 * function and it derives from the base class AsterSparkFunctionDR which hides
 * all the interactions with Aster.
 * The Echo class overrides the run method and implements the echo functionality.
 *
 */
class Echo (args : Array[String], name: String, mstr:String = null )
  extends AsterSparkFunctionDR (args, name, mstr) {
   /**
   * The run method is overridden to implement the echo functionality.
   * @param input The input RDD that reads data from the source. The input RDD
   * is of RDD[DataRow] type.
   * @param sparkFuncParams String representing the parameters specific to the
   * function the user is implementing. In this example sparkFuncParams
   * parameter is not used.
   * @return The result RDD is an RDD containing all the input data. This
   * return RDD is returned to aster by the Aster-Spark frame work.
   */
  override def run(input: RDD[DataRow], sparkFunctParams: String ): RDD[DataRow] = {
    input
  }
}