I want to create a Hive table by importing data from MySQL. The following command can create the table -
sqoop import \
-D mapred.job.name=name \
-Dorg.apache.sqoop.splitter.allow_text_splitter=true \
-connect "connection_detail" \
-username "username" \
-password "pwd" \
-query "SELECT * FROM schema.tablename WHERE \$CONDITIONS " \
-null-string '' \
-null-non-string '' \
-fields-terminated-by ',' \
-m 1 \
-hive-overwrite \
--hive-import \
--hive-table tablename \
-map-column-hive z_column=bigint,y_column=int,x_column=int \
-delete-target-dir \
-target-dir "path_dir"
I now want to create dynamic partition columns in the table - I tried the following command. But, it is giving error mentioned below -
sqoop import \
-D mapred.job.name=name \
-Dorg.apache.sqoop.splitter.allow_text_splitter=true \
-connect "connection_detail" \
-username "username" \
-password "pwd" \
-query "SELECT * FROM schema.tablename WHERE \$CONDITIONS " \
-null-string '' \
-null-non-string '' \
-fields-terminated-by ',' \
-m 1 \
-hive-overwrite \
--hive-import \
--hive-table tablename \
-map-column-hive z_column=bigint,y_column=int,x_column=int \
--hive-partition-key a_column,b_column,c_column \
--hive-partition-value 'a_data','b_data','c_data' \
-delete-target-dir \
-target-dir "path_dir"
FAILED: ParseException line 1:367 cannot recognize input near ',' 'b_column' ',' in column type
Where exactly is the error?