Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Published by Scroll Versions from space DEV and version r0762

D toc

Through the Search panel, you can access and apply functions that have been developed external to 

D s product
rtrue
.

Pre-requisites

Warning

Also known as user-defined functions, external functions must be developed in an environment external to the product and then registered for use in it. These steps require developer skills. For more information, see User-Defined Functions.


Invoke

After an external function has been registered with the product, you can complete the following steps to invoke the function within your recipe. 

Steps:

  1. In the Transform Builder, you can search for any of the following:
    1. udf
    2. invoke external function

      Info

      NOTE: You cannot search for the name of the external function.

  2. Select Invoke external function
  3. The list of available external functions is displayed. Select the function to use. 
  4. Depending on the function, the following options may be available:
    1. Columns: specify the column or columns to which to apply the function. 
    2. Arguments: If the function accepts arguments, you can enter them on individual lines.
    3. New column name: Some functions generate a new column. Enter a new column name.
  5. To add the instance of the function to your recipe, click Add.
  6. The step is added to your recipe.

Examples

You can create these examples functions in Java for use in the platform. For more information, see Java UDFs.

ConcatUDF

The ConcatUDF function concatenates two strings together. 

Tip

Tip: This function is provided for demonstration purposes only. In practice, you should use the MERGE function instead. See MERGE Function.

D trans
p03ValuemyConcatUDFColumn
Typestep
WrangleTextudf name: 'ConcatUDF' col: colA,colB as: 'myConcatUDFColumn'
p01NameColumn
p01ValuecolA, colB
p02NameArguments
p02Value(empty)
p03NameNew column name
SearchTermInvoke external function

AdderUDF

The AdderUDF function adds an input value to a constant that is submitted by parameter. The following invocation of AdderUDF adds colA and the constant 100.

Tip

Tip: This function is provided for demonstration purposes only. In practice, you should use the ADD function instead. See ADD Function.

D trans
p03ValuemyAdderUDFColumn
Typestep
WrangleTextudf name: 'AdderUDF' col: colA args: '100' as: 'myAdderUDFColumn'
p01NameColumn
p01ValuecolA
p02NameArguments
p02Value100
p03NameNew column name
SearchTermInvoke external function