Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Hadoop Essentials

You're reading from   Hadoop Essentials Delve into the key concepts of Hadoop and get a thorough understanding of the Hadoop ecosystem

Arrow left icon
Product type Paperback
Published in Apr 2015
Publisher Packt
ISBN-13 9781784396688
Length 194 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Author (1):
Arrow left icon
Shiva Achari Shiva Achari
Author Profile Icon Shiva Achari
Shiva Achari
Arrow right icon
View More author details
Toc

Table of Contents (9) Chapters Close

Preface 1. Introduction to Big Data and Hadoop FREE CHAPTER 2. Hadoop Ecosystem 3. Pillars of Hadoop – HDFS, MapReduce, and YARN 4. Data Access Components – Hive and Pig 5. Storage Component – HBase 6. Data Ingestion in Hadoop – Sqoop and Flume 7. Streaming and Real-time Analysis – Storm and Spark Index

Imports


Sqoop import is executed in two steps:

  1. Gather metadata

  2. Submit map only job

The following figure explains the import in to Sqoop:

Sqoop import provides the following options:

  • Import an entire table:

    sqoop import \
    --connect jdbc:mysql://mysql.example.com/sqoop \
    --username sqoop \
    --password sqoop \
    --table cities
  • Import a subset of data:

    sqoop import \
    --connect jdbc:mysql://mysql.example.com/sqoop \
    --username sqoop \
    --password sqoop \
    --table cities \
    --where "country = 'USA'"
  • Change file format, by default the data will be saved in tab separated csv format but Sqoop provides option for saving the data in Hadoop SequenceFile, Avro binary format and Parquet file:

    sqoop import \
    --connect jdbc:mysql://mysql.example.com/sqoop \
    --username sqoop \
    --password sqoop \
    --table cities \
    --as-sequencefile
    
    sqoop import \
    --connect jdbc:mysql://mysql.example.com/sqoop \
    --username sqoop \
    --password sqoop \
    --table cities \
    --as-avrodatafile
  • Compressing imported data:

    sqoop import \
    --connect jdbc...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image