Skip to content

Instantly share code, notes, and snippets.

@dgadiraju
Created November 13, 2017 03:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dgadiraju/eb515a5070c8d27d3fd4cb3cb5d35ed1 to your computer and use it in GitHub Desktop.
Save dgadiraju/eb515a5070c8d27d3fd4cb3cb5d35ed1 to your computer and use it in GitHub Desktop.
sqoop import \
--connect jdbc:mysql://ms.itversity.com:3306/retail_db \
--username retail_user \
--password itversity \
--target-dir /user/dgadiraju/sqoop_import/retail_db/orders_with_revenue \
--num-mappers 2 \
--query "select o.*, sum(oi.order_item_subtotal) order_revenue from orders o join order_items oi on o.order_id = oi.order_item_order_id and \$CONDITIONS group by o.order_id, o.order_date, o.order_customer_id, o.order_status" \
--split-by order_id
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment