Example 2: Wrapper with DataFrames - 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 EchoDF Class is an example wrapper function that uses the Aster-Spark
 * API and simply returns the input DataFrame as output. It mimics the behavior of
 * an echo function and it derives from the base class AsterSparkFunctionDF
 * which hides all the interactions with Aster.
 * The Echo class overrides the run method and implements the echo
 * functionality.
 *
 */
class EchoDF (args : Array[String], name: String, mstr:String = null )
  extends AsterSparkFunctionDF (args, name, mstr) {
   /**
   * The run method is overridden to implement the echo functionality.
   * @param input The input data frame that reads data from the source.
   * @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 is a data frame containing all the input data.
   */
  override def run(input:DataFrame, sparkFunctParams: String ): DataFrame = {
    input
  }
}