Monday, November 30, 2015

Sqoop - use case example

  1. command
    1. hdfs dfs -rm -r -skipTrash /user/hive/warehouse/member_company;
      sqoop --options-file mysql2hdfs.option --query "SELECT * FROM test WHERE count > 10 and \$CONDITIONS" --target-dir /user/hive/warehouse/member_company
    2. sqoop export --connect jdbc:mysql://10.0.2.a/test?characterEncoding=utf-8 --username root --password 'yourpassword' --table r_input --export-dir /result/r_input --input-fields-terminated-by '\001' --outdir /tmp/sqoop-mungeol/code/
  2. options
    1. import
      --connect
      jdbc:mysql://10.0.1.b:3306/test
      --username
      test
      --password
      tkfkadlselqlt
      --split-by
      mem_idx
      -m
      3
      --outdir
      /tmp/sqoop-mungeol/code/

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.