From 6c0b3201280f3c7c4c56530909fbb2977e58542e Mon Sep 17 00:00:00 2001 From: Szabolcs Vasas Date: Thu, 17 May 2018 16:12:05 +0200 Subject: [PATCH] SQOOP-3324: Document SQOOP-816: Sqoop add support for external Hive tables (Fero Szabo via Szabolcs Vasas) --- src/docs/man/hive-args.txt | 4 ++++ src/docs/user/hive-args.txt | 2 ++ src/docs/user/hive.txt | 15 +++++++++++++++ 3 files changed, 21 insertions(+) diff --git a/src/docs/man/hive-args.txt b/src/docs/man/hive-args.txt index 438c1dc4..c2115eac 100644 --- a/src/docs/man/hive-args.txt +++ b/src/docs/man/hive-args.txt @@ -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+. \ No newline at end of file diff --git a/src/docs/user/hive-args.txt b/src/docs/user/hive-args.txt index 75095641..8af9a1c5 100644 --- a/src/docs/user/hive-args.txt +++ b/src/docs/user/hive-args.txt @@ -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. -------------------------------------------------------------------------- diff --git a/src/docs/user/hive.txt b/src/docs/user/hive.txt index f8f7c27e..75a389be 100644 --- a/src/docs/user/hive.txt +++ b/src/docs/user/hive.txt @@ -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 +----