0

The data i have is delimited by '¬' when i try using it in create table i get error as invalid character. i tried using it's unicode version '\U00AC' but no use all record gets ingested in first field. in unix this character '¬' is displayed as �. Could anyone guide me on this as to what to use in the field terminated by section.

CREATE TABLE IF NOT EXISTS test
(
CONTACT_RECORD_ID    string,
ACCOUNT    string,
CUST    string,
NUMBER    string,
NUMBER1    string,
NUMBER2    string,
NUMBER3    string,
NUMBER4    string,
NUMBER5    string,
NUMBER6    string,
NUMBER7    string,
LIST    string
)
ROW FORMAT DELIMITED 
FIELDS TERMINATED BY '¬';
Chetan Pulate
  • 503
  • 1
  • 7
  • 21

2 Answers2

0

Can you please try with this DDL.

CREATE TABLE IF NOT EXISTS test
(
CONTACT_RECORD_ID    string,
ACCOUNT    string,
CUST    string,
NUMBER    string,
NUMBER1    string,
NUMBER2    string,
NUMBER3    string,
NUMBER4    string,
NUMBER5    string,
NUMBER6    string,
NUMBER7    string,
LIST    string
)
ROW FORMAT SERDE 'org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe'
WITH SERDEPROPERTIES ('empty.string.null'='true','field.delim'='\0AC','serialization.format'='\0AC','serialization.null.format'='')
STORED AS INPUTFORMAT 
  'org.apache.hadoop.mapred.TextInputFormat' 
OUTPUTFORMAT 
  'org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat';
donut
  • 790
  • 5
  • 11
  • ty tried it but didn't solve the problem. all data in first column – Chetan Pulate Mar 21 '16 at 05:36
  • output is like this 1�0000000000000010792�0000000000000549223�HFBlHgUUmGrCd�HaNlzg0tE�4G�HFN�H�X���93a�HFNBd2ht�QB3a�HFNBughjkL4�u NULL NULLNULL NULL NULL NULL NULL NULL NULL NULL NULL – Chetan Pulate Mar 21 '16 at 05:37
  • Can you verify the file contains the ¬ as delimiter.Please use "cat | grep ¬ " – donut Mar 21 '16 at 05:47
0

if you have data in csv format, you can use this tool as in Hadoop/Hive : Loading data from .csv on a local machine to easily export data into Hadoop.

Community
  • 1
  • 1
Vijay Kumar
  • 124
  • 1
  • 10