Removing Nulls from Data with Aster Loader Tool on Linux - Aster Client

Teradata Aster® Client Guide

Product
Aster Client
Release Number
7.00
Published
May 2017
Language
English (United States)
Last Update
2018-04-13
dita:mapPath
hki1475000360386.ditamap
dita:ditavalPath
Generic_no_ie_no_tempfilter.ditaval
dita:id
B700-2005
lifecycle
previous
Product Category
Software
A SQL error occurs when data containing ASCII null (embedded in a non-empty VARCHAR field) is inserted into the Aster Database. This error can arise when data is inserted into the Aster database through any means, including ncluster_loader and the Teradata Connector. Note that the ASCII null character is unrelated to the concept of NULL values in the database.

When Aster encounters ASCII null in the data that is being inserted, it treats the null character as invalid UTF-8.

The option --preprocess-script for Aster Loader Tool on Linux executes a shell script against the source file, and uses the output of the script as the new source file for loading. You can use this feature along with a provided script remove-null.sh to remove NULL(0x00) values from data to be loaded using Aster Loader Tool on Linux.

To install and use the shell script:

  1. Copy the script remove_null.sh from the Aster Client package to the client machine. The script can be found in the directory:
    • For 64-bit Linux: stage/home/beehive/clients-linux64/shell-scripts/remove-null.sh
    • For 32-bit Linux: stage/home/beehive/clients-linux32/shell-scripts/remove-null.sh
  2. Ensure that the directory where remove-null.sh is located is in your PATH.
  3. Set the file permissions on the script to make it executable:
    # chmod +x remove-null.sh
  4. Use this syntax when invoking Aster Loader Tool:
    $ ./ncluster_loader -h 10.0.0.10 -U beehive -w beehive -d beehive
    --preprocess-script=remove_null.sh target_table source_file.csv