Skip to content

Instantly share code, notes, and snippets.

@prasku5
Created November 19, 2018 07:40
Show Gist options
  • Save prasku5/ba418329820e74de8dd16b86e594b287 to your computer and use it in GitHub Desktop.
Save prasku5/ba418329820e74de8dd16b86e594b287 to your computer and use it in GitHub Desktop.
sqoop export --connect jdbc:mysql://localhost/retail_export --username root
--export-dir /user/hive/warehouse/test_hive_import.db/order_items // Source
--table order_items_export // Destination table.
--update-mode allowinsert //when the source HDFS data has any changes it will over write in destination table
--update-key 'order_item_id,order_id' ---> comma seperated.
-m 1
--input-fields-terminated-by '\001'
--input-null-non-string "null"
--input-null-string "null"
--columns order_item_id ,order_item_order_id, order_item_product_id , order_item_quantity , order_item_subtotal ,order_item_product_price
// we are selecting only required columns.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment