No delimiter in hive textfile

Viewed 22

I use presto sql to create a hive table.

+-------------------------------------------------------------------------------+--+
|                                createtab_stmt                                 |
+-------------------------------------------------------------------------------+--+
| CREATE TABLE `tmp.test_q`(                                      ...... )                                           |
| ROW FORMAT SERDE                                                              |
|   'org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe'                        |
| STORED AS INPUTFORMAT                                                         |
|   'org.apache.hadoop.mapred.TextInputFormat'                                  |
| OUTPUTFORMAT                                                                  |
|   'org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat'                |
| LOCATION                                                                      |
|   'hdfs://tmp.db/test_q'  |
| TBLPROPERTIES (                                                                                           |
|   'transient_lastDdlTime'='1662780797')                                       |
+-------------------------------------------------------------------------------+--+

I used hdfs dfs -get to get data to server and then used scp to copy from remote to local.

but after I downloaded the gz file and gunzip it, I did not see delimiters at all.

After I run ALTER TABLE tmp.test_q SET SERDEPROPERTIES ('field.delim' = ','), the delimiter became \001.

WHen I do select * from tmp.test_q, I got ONLY ONE column, other columns became NULL.

why?

0 Answers
Related