IBM Support

Cannot load into a Hive table that is created in IBM InfoSphere BigInsights Big SQL when Oracle is used as the metastore

Troubleshooting


Problem

When Oracle is configured as the Hive metastore for IBM Big SQL, and you create a Hive table in Big SQL, the LOAD operation fails with an exception, 'Table not found'.

Symptom


Loading a table fails with the exception, "Table not found", as described in the following example:

LOAD HIVE DATA INPATH '/tmp/test.dat' OVERWRITE INTO TABLE test;
BIGSQL-GEN-0010 Found an internal error: 'Failed to execute query 'LOAD HIVE DATA INPATH '/tmp/test.dat' OVERWRITE INTO TABLE test' : java.lang.RuntimeException: load failed due to an error ocurring in hive: FAILED: Error in semantic analysis: Line 1:70 Table not found 'test'

Cause

The failure happens because the table property, serialization.null.format, is set to nothing, as in the following example:

serialization.null.format=

The root cause of the problem is that Oracle returns NULL for a column that contains a value of an empty string.

Resolving The Problem

If Big SQL has an Oracle metastore configuration, you need to create the table by explicitly setting the serialization property in the CREATE TABLE DDL, as in the following example:



CREATE TABLE test(col1 INT) TBLPROPERTIES ('serialization.null.format' = 'NULL');

[{"Product":{"code":"SSCRJT","label":"IBM Db2 Big SQL"},"Business Unit":{"code":"BU059","label":"IBM Software w\/o TPS"},"Component":"Big SQL","Platform":[{"code":"PF016","label":"Linux"}],"Version":"2.1.0;2.1.1;2.1.2","Edition":"Enterprise Edition","Line of Business":{"code":"LOB10","label":"Data and AI"}}]

Document Information

Modified date:
08 April 2021

UID

swg21667875