Cannot load into a Hive table that is created in IBM InfoSphere BigInsights Big SQL when Oracle is used as the metastore
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'.
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'
The failure happens because the table property, serialization.null.format, is set to nothing, as in the following example:
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');
More support for:
Software version: 2.1.0, 2.1.1, 2.1.2
Operating system(s): Linux
Software edition: Enterprise Edition
Reference #: 1667875
Modified date: 27 March 2014