SQOOP-CREATE-HIVE(1)

NAME
sqoop-create-hive-table - Create a Hive table definition based on a database table definition.

SYNOPSIS

sqoop-create-hive-table <generic-options> <tool-options>

sqoop create-hive-table <generic-options> <tool-options>

DESCRIPTION

The create-hive-table tool populates a Hive metastore with a definition for a table based on a database table previously imported to HDFS, or one planned to be imported. This effectively performs the "--hive-import" step of sqoop-import without running the preceeding import.

If data was already loaded to HDFS, you can use this tool to finish the pipeline of importing the data to Hive. You can also create Hive tables with this tool; data then can be imported and populated into the target after a preprocessing step run by the user.

OPTIONS

The --connect and --table options are required.

  Database connection and common options

--connect (jdbc-uri)
    Specify JDBC connect string (required)

--connection-manager (class-name)
    Specify connection manager class name (optional)

--driver (class-name)
    Manually specify JDBC driver class to use

--connection-param-file (filename)
    Optional properties file that provides connection parameters

--hadoop-home (dir)
    Override $HADOOP_HOME

--help
    Print usage instructions

--password (password)
    Set authentication password (Note: This is very insecure. You should use -P instead.)

-P
    Prompt for user password

--username (username)
    Set authentication username

--verbose
    Print more information while working

  Hive options

--hive-home (dir)
    Override $HIVE_HOME

--hive-overwrite
    Overwrites existing data in the hive table if it exists.

--create-hive-table
    If set, then the job will fail if the target hive table exits. By default this property is false.

--hive-table (table-name)
    When used with --hive-import, overrides the destination table name

--table (table-name)
    The table to read (required)

  Output line formatting options

The delimiters used to separate fields and records can be specified on the command line, as can a quoting character and an escape character (for quoting delimiters inside a values). Data imported with --as-textfile will be formatted according to these parameters. Classes generated by Sqoop will encode this information, so using toString() from a data record stored --as-sequencefile will reproduce your specified formatting.

The (char) argument for each argument in this section can be specified either as a normal character (e.g., --fields-terminated-by ,) or via an escape sequence. Arguments of the form \0xhhh will be interpreted as a hexidecimal representation of a character with hex number hhh. Arguments of the form \0ooo will be treated as an octal representation of a character represented by octal number ooo. The special escapes \n, \r, \", \b, \t, and \\ act as they do inside Java strings. \0 will be treated as NUL. This will insert NUL characters between fields or lines (if used for --fields-terminated-by or --lines-terminated-by), or will disable enclosing/escaping if used for one of the --enclosed-by, --optionally-enclosed-by, or --escaped-by arguments.

The default delimiters are , for fields, \n for records, no quote character, and no escape character. Note that this can lead to ambiguous/unparsible records if you import database records containing commas or newlines in the field data. For unambiguous parsing, both must be enabled, e.g., via --mysql-delimiters.

--fields-terminated-by (char)
    Sets the field separator character

--lines-terminated-by (char)
    Sets the end-of-line character

--optionally-enclosed-by (char)
    Sets a field-enclosing character which may be used if a value contains delimiter characters.

--enclosed-by (char)
    Sets a field-enclosing character which will be used for all fields.

--escaped-by (char)
    Sets the escape character

--mysql-delimiters
    Uses MySQL’s default delimiter set:

    fields: , lines: \n escaped-by: \ optionally-enclosed-by: '

ENVIRONMENT

See sqoop(1)

AUTHOR

Sqoop Team
    Author.