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:
-
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
- Ensure that the directory where remove-null.sh is located is in your PATH.
-
Set the file permissions on the script to make it executable:
# chmod +x remove-null.sh
-
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