mirror of
https://github.com/apache/sqoop.git
synced 2025-05-02 23:21:22 +08:00
SQOOP-3324: Document SQOOP-816: Sqoop add support for external Hive tables
(Fero Szabo via Szabolcs Vasas)
This commit is contained in:
parent
2ca85527fd
commit
6c0b320128
@ -39,3 +39,7 @@ Hive options
|
||||
Override default mapping for SQL types or input field types into Hive types for configured columns.
|
||||
If specify commas in this argument, use URL encoded keys and values, for example,
|
||||
use DECIMAL(1%2C1) instead of DECIMAL(1,1), NUMERIC(1%2C%202) instead of NUMERIC(1, 2).
|
||||
|
||||
--external-table-dir::
|
||||
Used to specify that the Hive table is an external one,
|
||||
needs to be specified along with +\--hive-import+.
|
@ -48,5 +48,7 @@ Argument Description
|
||||
+\--hs2-user+ The user for creating the JDBC connection to HiveServer2. The default is the current OS user.
|
||||
+\--hs2-keytab+ The path to the keytab file of the user connecting to HiveServer2. If you choose another \
|
||||
HiveServer2 user (with --hs2-user) then --hs2-keytab has to be also specified otherwise it can be omitted.
|
||||
+\--external-table-dir+ Used to specify that the table is external, not managed. \
|
||||
Has to be specified with the +\--hive-import+ option.
|
||||
--------------------------------------------------------------------------
|
||||
|
||||
|
@ -111,3 +111,18 @@ with this codec, Sqoop will automatically index the files for splitting and
|
||||
configuring a new Hive table with the correct InputFormat. This feature
|
||||
currently requires that all partitions of a table be compressed with the lzop
|
||||
codec.
|
||||
|
||||
The user can specify the +\--external-table-dir+ option in the sqoop command to
|
||||
work with an external Hive table (instead of a managed table, i.e. the default behavior).
|
||||
To import data into an external table, one has to specify +\--hive-import+ in the command
|
||||
line arguments. Table creation is also supported with the use of +\--create-hive-table+.
|
||||
|
||||
Importing into an external Hive table:
|
||||
----
|
||||
$ sqoop import --hive-import --connect $CONN --table $TABLENAME --username $USER --password $PASS --external-table-dir /tmp/external_table_example
|
||||
----
|
||||
|
||||
Create an external Hive table:
|
||||
----
|
||||
$ sqoop import --hive-import --create-hive-table --connect $CONN --table $TABLENAME --username $USER --password $PASS --external-table-dir /tmp/foobar_example --hive-table foobar
|
||||
----
|
||||
|
Loading…
Reference in New Issue
Block a user