Sunday, 22 May 2016

Sqoop & SQL Server #3 - Getting Help with Sqoop

Getting Help
Sqoop commands are issued in a Terminal session. A number of commands exist. To access help and see details of commands use the following;
     
sqoop help

Remember Linux is case sensitive to be careful to type commands in the correct case.

The following table is returned.

Available commands:
     codegen                     Generate code to interact with database records
     create-hive-table           Import a table definition into Hive
     eval                        Evaluate a SQL statement and display the results
     export                      Export an HDFS directory to a database table
     help                        List available commands
     import                      Import a table from a database to HDFS
     import-all-tables           Import tables from a database to HDFS
     job                         Work with saved jobs
     list-databases              List available databases on a server
     list-tables                 List available tables in a database
     merge                       Merge results of incremental imports
     metastore                   Run a standalone Sqoop metastore
     version                     Display version information

Each command has specific arguments. The help command can display these arguments when you use the commands as a parameter. For example here is the syntax for displaying the arguments for the frequently used import command.

sqoop help list-databases


Common arguments:
  --connect <jdbc-uri>                       Specify JDBC connect  string
  --connection-manager <class-name>          Specify connection manager  class name
  --connection-param-file <properties-file>  Specify connection parameters file
  --driver <class-name>                      Manually specify JDBC  driver class to use
  --hadoop-home <hdir>                       Override $HADOOP_MAPRED_HOME_ARG
  --hadoop-mapred-home <dir>                 Override $HADOOP_MAPRED_HOME_ARG
  --help                                     Print usage instructions
  -P                                         Read password from console
  --password <password>                      Set authentication  password
  --password-alias <password-alias>          Credential provider password alias
  --password-file <password-file>            Set authentication password file path
  --relaxed-isolation                        Use read-uncommitted isolation for imports
  --skip-dist-cache                          Skip copying jars to distributed cache
  --username <username>                      Set authentication username
  --verbose                                  Print more information while working

No comments:

Post a Comment