Skip to content

Instantly share code, notes, and snippets.

@nickwhite917
Created February 15, 2017 19:59
Show Gist options
  • Select an option

  • Save nickwhite917/600313b7bd3f08aa7d0073b01c1309fd to your computer and use it in GitHub Desktop.

Select an option

Save nickwhite917/600313b7bd3f08aa7d0073b01c1309fd to your computer and use it in GitHub Desktop.
Sqoop from DB2 to Hive.
# Example command to run: ./sqoop_warehouse_to_hive_db warehouse_table_name table_partition_column
echo "Running sqoop import on table: $1 with key $2. If this is not correct, exit now with CTRL-C - Nick"
sleep 5
sqoop import --connect jdbc:db2://server.host.name:port/DatabaseName --username user123 --password pass456 \
--table $1 --split-by $2 --fields-terminated-by '\t' \
--hive-overwrite --hive-import --hive-table $1 --hive-database warehouse
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment