How to list out the databases and tables of a particular database using Sqoop

Last updated on May 30 2022
Swati Dogra

Table of Contents

How to list out the databases and tables of a particular database using Sqoop

Sqoop – List Databases

This blog describes how to list out the databases using Sqoop. Sqoop list-databases tool parses and executes the ‘SHOW DATABASES’ query against the database server. Thereafter, it lists out the present databases on the server.

Syntax

The following syntax is used for Sqoop list-databases command.

$ sqoop list-databases (generic-args) (list-databases-args)

$ sqoop-list-databases (generic-args) (list-databases-args)

Sample Query

The following command is used to list all the databases in the MySQL database server.

$ sqoop list-databases \

--connect jdbc:mysql://localhost/ \

--username root

If the command executes successfully, then it will display the list of databases in your MySQL database server as follows.

...

13/05/31 16:45:58 INFO manager.MySQLManager: Preparing to use a MySQL streaming resultset.




mysql

test

userdb

db

This chapter describes how to list out the tables of a particular database in MySQL database server using Sqoop. Sqoop list-tables tool parses and executes the ‘SHOW TABLES’ query against a particular database. Thereafter, it lists out the present tables in a database.

Syntax

The following syntax is used for Sqoop list-tables command.

$ sqoop list-tables (generic-args) (list-tables-args)

$ sqoop-list-tables (generic-args) (list-tables-args)

Sample Query

The following command is used to list all the tables in the userdb database of MySQL database server.

$ sqoop list-tables \

--connect jdbc:mysql://localhost/userdb \

--username root

If the command is executes successfully, then it will display the list of tables in the userdb database as follows.

...

13/05/31 16:45:58 INFO manager.MySQLManager: Preparing to use a MySQL streaming resultset.




emp

emp_add

emp_contact


Sqoop – List Tables

This blog describes how to list out the tables of a particular database in MySQL database server using Sqoop. Sqoop list-tables tool parses and executes the ‘SHOW TABLES’ query against a particular database. Thereafter, it lists out the present tables in a database.

Syntax

The following syntax is used for Sqoop list-tables command.

$ sqoop list-tables (generic-args) (list-tables-args)

$ sqoop-list-tables (generic-args) (list-tables-args)

Sample Query

The following command is used to list all the tables in the userdb database of MySQL database server.

$ sqoop list-tables \

--connect jdbc:mysql://localhost/userdb \

--username root

If the command is executes successfully, then it will display the list of tables in the userdb database as follows.

...

13/05/31 16:45:58 INFO manager.MySQLManager: Preparing to use a MySQL streaming resultset.




emp

emp_add

emp_contact


So, this brings us to the end of blog. This Tecklearn ‘How to list out the databases and tables of a particular database using Sqoop’ helps you with commonly asked questions if you are looking out for a job in Apache Sqoop and Big Data Hadoop Developer.

If you wish to learn Sqoop and build a career in Big Data Hadoop domain, then check out our interactive, Big Data Hadoop Developer Training, that comes with 24*7 support to guide you throughout your learning period. Please find the link for course details:

https://www.tecklearn.com/course/big-data-spark-and-hadoop-developer/

Big Data Spark and Hadoop Developer Training

About the Course

Big Data analysis is emerging as a key advantage in business intelligence for many organizations. In this Big Data course, you will master MapReduce, Hive, Pig, Sqoop, Oozie and Flume, Spark framework and RDD, Scala and Spark SQL, Machine Learning using Spark, Spark Streaming, etc. It is a comprehensive Hadoop Big Data training course designed by industry experts considering current industry job requirements to help you learn Big Data Hadoop and Spark modules. This Cloudera Hadoop and Spark training will prepare you to clear Cloudera CCA175 Big Data certification.

Why Should you take Spark and Hadoop Developer Training?

  • Average salary for a Spark and Hadoop Developer ranges from approximately $106,366 to $127,619 per annum – Indeed.com.
  • Hadoop Market is expected to reach $99.31B by 2022 growing at a CAGR of 42.1% from 2015 – Forbes.
  • Amazon, Cloudera, Data Stax, DELL, EMC2, IBM, Microsoft & other MNCs worldwide use Hadoop

What you will Learn in this Course?

Introduction to Hadoop and the Hadoop Ecosystem

  • Problems with Traditional Large-scale Systems
  • Hadoop!
  • The Hadoop Ecosystem

Hadoop Architecture and HDFS

  • Distributed Processing on a Cluster
  • Storage: HDFS Architecture • Storage: Using HDFS
  • Resource Management: YARN Architecture
  • Resource Management: Working with YARN

Importing Relational Data with Apache Sqoop

  • Sqoop Overview
  • Basic Imports and Exports
  • Limiting Results
  • Improving Sqoop’s Performance
  • Sqoop 2

Introduction to Impala and Hive

  • Introduction to Impala and Hive
  • Why Use Impala and Hive?
  • Comparing Hive to Traditional Databases
  • Hive Use Cases

Modelling and Managing Data with Impala and Hive

  • Data Storage Overview
  • Creating Databases and Tables
  • Loading Data into Tables
  • HCatalog
  • Impala Metadata Caching

Data Formats

  • Selecting a File Format
  • Hadoop Tool Support for File Formats
  • Avro Schemas
  • Using Avro with Hive and Sqoop
  • Avro Schema Evolution
  • Compression

Data Partitioning

  • Partitioning Overview
  • Partitioning in Impala and Hive

Capturing Data with Apache Flume

  • What is Apache Flume?
  • Basic Flume Architecture
  • Flume Sources
  • Flume Sinks
  • Flume Channels
  • Flume Configuration

Spark Basics

  • What is Apache Spark?
  • Using the Spark Shell
  • RDDs (Resilient Distributed Datasets)
  • Functional Programming in Spark

Working with RDDs in Spark

  • A Closer Look at RDDs
  • Key-Value Pair RDDs
  • MapReduce
  • Other Pair RDD Operations

Writing and Deploying Spark Applications

  • Spark Applications vs. Spark Shell
  • Creating the Spark Context
  • Building a Spark Application (Scala and Java)
  • Running a Spark Application
  • The Spark Application Web UI
  • Configuring Spark Properties
  • Logging

Parallel Programming with Spark

  • Review: Spark on a Cluster
  • RDD Partitions
  • Partitioning of File-based RDDs
  • HDFS and Data Locality
  • Executing Parallel Operations
  • Stages and Tasks

Spark Caching and Persistence

  • RDD Lineage
  • Caching Overview
  • Distributed Persistence

Common Patterns in Spark Data Processing

  • Common Spark Use Cases
  • Iterative Algorithms in Spark
  • Graph Processing and Analysis
  • Machine Learning
  • Example: k-means

Preview: Spark SQL

  • Spark SQL and the SQL Context
  • Creating DataFrames
  • Transforming and Querying DataFrames
  • Saving DataFrames
  • Comparing Spark SQL with Impala

 

Got a question for us? Please mention it in the comments section and we will get back to you.

 

0 responses on "How to list out the databases and tables of a particular database using Sqoop"

Leave a Message

Your email address will not be published. Required fields are marked *