Import departments table from mysql to hdfs as parquet file in departments_parquet directory.

Import departments table from mysql to hdfs as parquet file in departments_parquet directory.

Answer: Solution:

Step 1: Import departments table from mysql to hdfs as textfile

sqoop import

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

~username=retail_dba

-password=cloudera

-table departments

-as-textfile

-target-dir=departments_text

verify imported data

hdfs dfs -cat departments_text/part"

Step 2: Import departments table from mysql to hdfs as sequncetlle

sqoop import

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

~username=retail_dba

-password=cloudera

–table departments

-as-sequencetlle

-~target-dir=departments sequence

verify imported data

hdfs dfs -cat departments_sequence/part*

Step 3: Import departments table from mysql to hdfs as sequncetlle

sqoop import

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

~username=retail_dba

–password=cloudera

–table departments

–as-avrodatafile

–target-dir=departments_avro

verify imported data

hdfs dfs -cat departments avro/part*

Step 4: Import departments table from mysql to hdfs as sequncetlle

sqoop import

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

~username=retail_dba

–password=cloudera

-table departments

-as-parquetfile

-target-dir=departments_parquet

verify imported data

hdfs dfs -cat departmentsparquet/part*

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