Also make sure your results fields are terminated by ‘|’ and lines terminated by ‘n

Also make sure your results fields are terminated by ‘|’ and lines terminated by ‘n

Answer: Solutions:

Step 1: Clean the hdfs file system, if they exists clean out.

hadoop fs -rm -R departments

hadoop fs -rm -R categories

hadoop fs -rm -R products

hadoop fs -rm -R orders

hadoop fs -rm -R order_items

hadoop fs -rm -R customers

Step 2: Now import the department table as per requirement.

sqoop import

-connect jdbc:mysql://quickstart:330G/retaiI_db

–username=retail_dba

-password=cloudera

-table departments

-target-dir=departments

-fields-terminated-by ‘|’

-lines-terminated-by ‘n’

-ml

Step 3: Check imported data.

hdfs dfs -Is departments

hdfs dfs -cat departments/part-m-00000

Step 4: Now again import data and needs to appended.

sqoop import

-connect jdbc:mysql://quickstart:3306/retail_db

–username=retail_dba

-password=cloudera

-table departments

-target-dir departments

-append

-tields-terminated-by ‘|’

-lines-termtnated-by ‘n’

-ml

Step 5: Again Check the results

hdfs dfs -Is departments

hdfs dfs -cat departments/part-m-00001

Latest CCA175 Dumps Valid Version with 96 Q&As

Latest And Valid Q&A | Instant Download | Once Fail, Full Refund

Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments