mysql - How to use custom delimiter while creating table in Hive using create-hive-table -


i trying import data hdfs rdbms table. using create-hive-table copy schema hive , load data hive table.

command used import hdfs

sqoop import --connect jdbc:mysql://localhost/sqoop --username sqoop --password sqoop --table customers --warehouse-dir testingsqoop -m 1 --fields-terminated-by ',' --enclosed-by "\'" --lines-terminated-by "\n" 

command used create hive table:

sqoop create-hive-table --connect jdbc:mysql://localhost/sqoop --username sqoop --password sqoop --table customers --hive-table customers --fields-terminated-by "," --enclosed-by "\'" --lines-terminated-by "\n" 

and query used load data hive

load data inpath '/user/cloudera/testingsqoop/customers/*' table customers; 

as enclosing fields single quote ', hive while creating table not considering --enclosed-by flag, hence columns in hive table still having quotes '.

null  'richard'  'hernandez'  'xxxxxxxxx'  'xxxxxxxxx'  '6303 heather plaza'  'brownsville'  'tx'  '78521' 

however if don't use --enclosed-by works fine, want have it.

1) please regarding this?

2) there way can specify multiple chars field terminator?

thanks!

try below,

--fields-terminated-by \01 --hive-drop-import-delims --null-string \n --null-non-string \n

in sqoop import data query , hive table definition queries.


Comments

Popular posts from this blog

php - Wordpress website dashboard page or post editor content is not showing but front end data is showing properly -

How to get the ip address of VM and use it to configure SSH connection dynamically in Ansible -

javascript - Get parameter of GET request -