Test C API Functions Locally with TestRunner - Aster Execution Engine

Teradata Aster® Developer Guide

Product
Aster Execution Engine
Release Number
7.00.02
Published
July 2017
Language
English (United States)
Last Update
2018-04-13
dita:mapPath
xnl1494366523182.ditamap
dita:ditavalPath
Generic_no_ie_no_tempfilter.ditaval
dita:id
ffu1489104705746
lifecycle
previous
Product Category
Software

Because SQL-MapReduce functions are built to run on data in an Aster instance, testing them locally requires a test program that can simulate the data and services of the cluster. The SDK provides this in the form of the TestRunner (the actual library path and name is sqlmr-sdk/lib/libsqlmr-testrunner.so).

Detailed reference documentation for TestRunner is provided in the header files in sqlmr-sdk/include/sqlmr/testrunner/c/SimpleTest.h and in the supporting headers TestArgumentClause.h and TestColumnDefinition.h.

TestRunner allows you to write a test that:

  • Runs an SQL-MapReduce function contained in a specified SQL-MapReduce C executable file (a .so library).
  • Provides test input data to the function, using a data input file you specify.
  • Simulates other SQL-MapReduce services, such as installed files or temporary storage.
  • Writes the test output to files you specify:

    The completed runtime contract file provides a list of the output columns of your SQL-MapReduce function, and the datatype of each. For example, if you have built the "test" target in the echo_input example, you will see sqlmr-sdk/example/c/echo_input/build/testoutput/contract.out

    The output data file contains the actual output your function produced based on the test input data. For example, (assuming you have built the "test" target), you will see, sqlmr-sdk/example/c/echo_input/build/testoutput/testrun.out

After running the function, the test can then verify the contents of the created output files (for the completed contract and output data).

Only row functions are supported for the C test runner. Thus it is not possible to test partition or multiple input functions using this test runner.