IBM Support

Length function returning different values between HIVE and BigSQL

Troubleshooting


Problem

When using LENGTH command to determine the size of a column BigSQL is returning a different size than the same column in Hive.

Symptom

db2 "CREATE HADOOP TABLE BIGSQL.TEST_TABLE (col1 VARCHAR(512)) STORED AS PARQUETFILE "
The SQL command completed successfully.

db2 "insert into bigsql.test_table values('•')"
The SQL command completed successfully.

db2 "select length(col1) from bigsql.test_table"
1
-----------
13
1 record(s) selected

hive> select length(col1) from bigsql.test_table;
OK
6

Document Location

Worldwide

[{"Business Unit":{"code":"BU048","label":"IBM Software"},"Product":{"code":"SSCRJT","label":"IBM Db2 Big SQL"},"Component":"","Platform":[{"code":"PF016","label":"Linux"}],"Version":"4.2, 4.2.5, 5.0.0, 5.0.1, 5.0.2, 5.0.3, 5.0.4","Edition":"","Line of Business":{"code":"LOB76","label":"Data Platform"}}]

Log InLog in to view more of this document

This document has the abstract of a technical article that is available to authorized users once you have logged on. Please use Log in button above to access the full document. After log in, if you do not have the right authorization for this document, there will be instructions on what to do next.

Document Information

Modified date:
08 April 2021

UID

ibm10870828