• hive sqoop,sqoop-hive import data


    https://segmentfault.com/a/1190000002532293

    https://www.zybuluo.com/aitanjupt/note/209968

    create table dep(id int,name string) row format delimited fields terminated by ' ';


    11 sssssssss
    22 ttttttttt
    33 vvvvvvvvv


    load data local inpath '/opt/people.txt' into table hive.dep;

    mysql -uroot -proot

    use metastore;
    select * from TBLS where TBL_NAME='dep';


    hive -e "select * from hive.dep limit 3"


    hdfs dfs -ls /


    sqoop import --connect jdbc:mysql://127.0.0.1:3306/metastore --username root --password root --table TBLS

    测试MySQL连接
    sqoop list-databases --connect jdbc:mysql://127.0.0.1:3306/mysql --username root --password root

    检验SQL语句

    sqoop eval --connect jdbc:mysql://ucampus-test.cmtmrzrxlu53.rds.cn-northwest-1.amazonaws.com.cn:3306/ucampus --username ucauser --password 'Key!go003' --query "SELECT * from base_course"


    sqoop import --connect jdbc:mysql://ucampus-test.cmtmrzrxlu53.rds.cn-northwest-1.amazonaws.com.cn:3306/ucampus --username ucauser --password 'Key!go003' --query "SELECT * from stu_student where sch_id=4 AND $CONDITIONS" --split-by date --target-dir /user/hive/warehouse/anqi_wang


    --fields-terminated-by " " --lines-terminated-by " " -m 1 --hive-import --hive-overwrite --create-hive-table --hive-table book --delete-target-dir


    sqoop import --connect jdbc:mysql://localhost:3306/sqoop
    --username root
    -P
    --split-by id
    --columns id,name
    --table customer
    --target-dir /user/cloudera/ingest/raw/customers
    --fields-terminated-by ","
    --hive-import
    --create-hive-table
    --hive-table sqoop_workspace.customers


    sqoop import --connect jdbc:mysql://ucampus-test.cmtmrzrxlu53.rds.cn-northwest-1.amazonaws.com.cn:3306/ucampus --username ucauser --password 'Key!go003' ---driver com.mysql.jdbc.Driver --split-by id --columns id,name --table stu_student --target-dir /user/hive/warehouse/hive/dep --fields-terminated-by "," --hive-import --create-hive-table --hive-table hive.dep

    cd /usr/lib/sqoop/lib/
    yum install unzip
    wget http://www.java2s.com/Code/JarDownload/java-json/java-json.jar.zip
    unzip java-json.jar.zip

    cp /usr/lib/hive/lib/hive-common-1.1.0-cdh5.9.1.jar /usr/lib/sqoop/lib/
    cp /usr/lib/hive/lib/hive-shims-*.jar /usr/lib/sqoop/lib

    sqoop import --connect jdbc:mysql://ucampus-test.cmtmrzrxlu53.rds.cn-northwest-1.amazonaws.com.cn:3306/ucampus --username ucauser --password 'Key!go003' --driver com.mysql.jdbc.Driver --split-by id --columns id,name --table stu_student --target-dir /user/hive/warehouse/hive/dep3 --fields-terminated-by "," --hive-import --create-hive-table --hive-table hive.dep3

  • 相关阅读:
    dsp1
    数字信号处理中的常用方法
    近一星期的学习计划4-8 到 4-15
    近一个月的学习计划!4-8
    离散时间与系统-1
    python _列表
    2016-1-19
    fushioncharts 使用教程要点---使用JSON数据方式
    使用easeui dialog弹出框中使用CKeditor多次加载后无法编辑问题
    MVC之路随记3--Html辅助方法
  • 原文地址:https://www.cnblogs.com/SZLLQ2000/p/10709770.html
Copyright © 2020-2023  润新知