Select clause not showing '\u0001 char present inside string field in Hive CLI output

171 Views Asked by At

Facing problem while fetching data form hive table.

Input String : "\u0001d1\u0002d2\u0003"

Here \u0001 = ^A character. similarly \u0002 = ^B character ...

Inserted above string into hive table successfully. Hive DDL query is:

CREATE TABLE test_lt_snap (f1 string) PARTITIONED BY ( date string) ROW FORMAT SERDE 'org.apache.hadoop.hive.ql.io.orc.OrcSerde' WITH SERDEPROPERTIES ('serialization.encoding'='utf-8') STORED AS INPUTFORMAT 'org.apache.hadoop.hive.ql.io.orc.OrcInputFormat' OUTPUTFORMAT 'org.apache.hadoop.hive.ql.io.orc.OrcOutputFormat' LOCATION '<file path>' TBLPROPERTIES ( 'store.charset'='utf-8', 'retrieve.charset'='utf-8');

After selecting field f1 through hive CLI i am not able to see '\u0001' char. such as:

hive (test_db) > select f1 from test_lt_snap;
output: d1d2
hive (test_db) > select f1 from test_lt_snap where f1 like '\u0001d1%';
output: d1d2

The problem with above select clause is the \u0001 char are not visible. Is there any way we can display the chars as well ?

Thanks Amiya

0

There are 0 best solutions below