Compile the UDTF
After you create your C++ file for your new UDTF, compile the C++ file by using the nzudxcompile command. The command is in the /nz/kit/bin/adm directory. The compilation process creates the object files that will run on the Netezza Performance Server host and on the Netezza Performance Server SPUs.
- To compile the parseNames.cpp file and create
the output object files:
nzudxcompile parseNames.cpp
- parseNames.o_x86
- The object file for the Netezza® host (i386 Linux® platform on x86).
- parseNames.o_spu10
- The object file for the Linux-based Rev10 SPUs on IBM® Netezza 1000 and Netezza 100 models.
After you create the compiled object files, you must register the UDTF with the Netezza Performance Server system. You can register a user-defined function by using the CREATE FUNCTION command.
nzudxcompile --sig "parseNames(VARCHAR(ANY))" --return
"TABLE(product_id VARCHAR(200))" --class parseNames --version 2
parseNames.cpp –-user myuser –-pw password –-db mydbFor systems running 7.0.3 or later that support multiple schemas in a database, you can specify the schema where you want to register the UDTF using the --schema option, as follows:
nzudxcompile --sig "parseNames(VARCHAR(ANY))" --return
"TABLE(product_id VARCHAR(200))" --class parseNames --version 2 parseNames.cpp
–-user myuser –-pw password –-db mydb
--schema myschema