hive - sqoop from MySQL where the data contains carriage returns -
hive - sqoop from MySQL where the data contains carriage returns -
i have mysql table of values in varchar column end '^m' (i.e. carriage homecoming or '\r') while others not. mysql database part of production environment not control, , i'm unable remove trailing carriage returns simple update mytable set mycol = trim(mycol);
.
when sqoop
mysql table cluster, notice records carriage homecoming end misaligned resulting in unusual query results. sqoop (v 1.4.4) command looks this:
sqoop import \ --connect jdbc:mysql://myhost:3306/mydb --username myuser --password mypass --table mytable --target-dir user/hive/warehouse/mydb.db/mytable --hive-import --hive-table mydb.mytable --hive-overwrite -m 1
q) possible sqoop
info contains carriage returns straight mysql without having sort of intermediate step remove carriage returns?
the ideal workflow simple sqoop
command scheduled oozie
. staging info , stripping out \r
sed (or whatever) seems kludge.
the reply in manual (http://sqoop.apache.org/docs/1.4.4/sqoopuserguide.html). needed add together next argument sqoop
statement:
--hive-drop-import-delims
mysql hive sqoop
Comments
Post a Comment