Getting Started with various Tools

32 / 44

Sqoop

Purpose: Sqoop is a command-line interface application for transferring data between relational databases and Hadoop.

Home Page: https://sqoop.apache.org/

Documentation: https://sqoop.apache.org/docs/1.99.7/index.html

Related resources to learn: https://cloudxlab.com/assessment/playlist-intro/13/sqoop?course_id=1&playlist_id=13

How to get started:

  1. In the web console tab on the right side of the screen, get help with sqoop using:

    sqoop help
    
  2. To import data from MySQL into HDFS using Sqoop, use:

    sqoop import --connect jdbc:mysql://172.31.13.154/sqoopex --table widgets -m 2 --username sqoopuser -P --split-by id
    
  3. To import data from MySQL into Hive using Sqoop, use:

    sqoop import --connect jdbc:mysql://172.31.13.154/sqoopex --table widgets -m 2 --hive-import --username sqoopuser -P --hive-database sqoop_testing
    
  4. To import data from MySQL into HBase using Sqoop, use:

    sqoop import --connect jdbc:mysql://172.31.13.154/sqoopex --table widgets --hbase-table 'widgets' --column-family cf2 --username sqoopuser -P --hbase-create-table --columns id,widget_name,price --hbase-row-key 'widget_name' -m 1
    
  5. To export data from Hive to MySQL using Sqoop, use:

    sqoop export --connect jdbc:mysql://172.31.13.154/sqoopex -m 1 --table sales_test --export-dir /apps/hive/warehouse/sales_test --input-fields-terminated-by ',' --username sqoopuser -P
    

No hints are availble for this assesment

Answer is not availble for this assesment

Loading comments...