Guest User

Untitled

a guest
Dec 12th, 2017
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.42 KB | None | 0 0
  1. # Baseline import
  2. sqoop import \
  3. --connect jdbc:mysql://ms.itversity.com:3306/retail_db \
  4. --username retail_user \
  5. --password itversity \
  6. --target-dir /user/dgadiraju/sqoop_import/retail_db/orders \
  7. --num-mappers 2 \
  8. --query "select * from orders where \$CONDITIONS and order_date like '2013-%'" \
  9. --split-by order_id
  10.  
  11. # Query can be used to load data based on condition
  12. sqoop import \
  13. --connect jdbc:mysql://ms.itversity.com:3306/retail_db \
  14. --username retail_user \
  15. --password itversity \
  16. --target-dir /user/dgadiraju/sqoop_import/retail_db/orders \
  17. --num-mappers 2 \
  18. --query "select * from orders where \$CONDITIONS and order_date like '2014-01%'" \
  19. --split-by order_id \
  20. --append
  21.  
  22. # where in conjunction with table can be used to get data based up on a condition
  23. sqoop import \
  24. --connect jdbc:mysql://ms.itversity.com:3306/retail_db \
  25. --username retail_user \
  26. --password itversity \
  27. --target-dir /user/dgadiraju/sqoop_import/retail_db/orders \
  28. --num-mappers 2 \
  29. --table orders \
  30. --where "order_date like '2014-02%'" \
  31. --append
  32.  
  33. # Incremental load using arguments specific to incremental load
  34. sqoop import \
  35. --connect jdbc:mysql://ms.itversity.com:3306/retail_db \
  36. --username retail_user \
  37. --password itversity \
  38. --target-dir /user/dgadiraju/sqoop_import/retail_db/orders \
  39. --num-mappers 2 \
  40. --table orders \
  41. --check-column order_date \
  42. --incremental append \
  43. --last-value '2014-02-28'
Add Comment
Please, Sign In to add comment