zoukankan      html  css  js  c++  java
  • 从hive导入到oracle(Hcatalog)

    1.使用catalog的情况下:
    1. sqoop export --table tableName2 #oracle表
    2. --connect jdbc:oracle:thin:@127.0.0.1:1521:ORCL
    3. --username username #oracle用户
    4. --password password #密码
    5. --hcatalog-database DB1 #catalog数据库
    6. --hcatalog-table tableName2 #catalog表
    7. --hcatalog-partition-keys p_month #
    8. --hcatalog-partition-values 2016-11
    9. --columns "serialno",
    10. "contractstatus",
    11. "rno",
    12. "rname",
    13. "stores",
    14. "sname",
    15. "etl_in_dt"

    2.不使用catalog
    1. sqoop export --table tableName -connect jdbc:oracle:thin:@127.0.0.1:1521:ORCL
    2. --username userNameA --password pwd --export-dir sourceFile --columns "c1,c2,c3"
    3. --input-fields-terminated-by '01' --input-lines-terminated-by ' '

    3.使用hcatalog要注意的地方
    import时,不支持:
    --hive-import
    --hive-overwrite
    import和export时不支持:
    --export-dir
    --target-dir
    --warehouse-dir
    --append
    --as-sequencefile
    --as-avrodatafile
    --as-parquetfile

    4.用hcatalog导入导出
    $SQOOP_HOME/bin/sqoop import --connect <jdbc-url> -table <table-name> --hcatalog-table txn <other sqoop options>
    $SQOOP_HOME/bin/sqoop export --connect <jdbc-url> -table <table-name> --hcatalog-table txn <other sqoop options>




























































  • 相关阅读:
    windows 保留7天的文件
    同步
    bytes数据类型的转码问题:
    hashlib,logging,configparser模块
    面向对象 ---封装
    面向对象 -----多态
    面向对象 ---继承
    面向对象的命名空间与组合
    常用模块:
    匿名函数:
  • 原文地址:https://www.cnblogs.com/skyrim/p/7455948.html
Copyright © 2011-2022 走看看