zoukankan      html  css  js  c++  java
  • Sqoop 命令

    1)list-databases     List available databases on a server
    sqoop list-databases --connect jdbc:db2://<server>:<port>/<database> --username username --password password

    2) list-tables        List available tables in a database
    sqoop list-tables --connect jdbc:db2://<server>:<port>/<database> --username username --password password
     
    3) create-hive-table  Import a table definition into Hive
    sqoop create-hive-table --connect jdbc:db2://<server>:<port>/<database> --username username --password password –table tablename  –hive-table hivetablename
    其中 –table tablename为db2中的数据库database中的表 –hive-table hivetablename 为hive中新建的表名称
     
    4) eval               Evaluate a SQL statement and display the results
    sqoop eval --connect jdbc:db2://<server>:<port>/<database> --username username --password password -query 'SELECT * FROM <tablename>'
     
    5) import             Import a table from a database to HDFS

    sqoop import --connect jdbc:db2://<server>:<port>/<database> --username username --password password --compress --compression-codec 'com.hadoop.compression.lzo.LzopCodec' -table tablename --hcatalog-database hiveschema --hcatalog-table hivetable -m 1

    其中 –table tablename为db2中的数据库database中的表 --hcatalog-database hiveschema 为hive中Schema --hcatalog-table hivetable为hive中表名称

    sqoop import --connect jdbc:db2://<server>:<port>/<database> --username username --password password --compress --compression-codec 'com.hadoop.compression.lzo.LzopCodec' -table tablename --columns <column> --hcatalog-database hiveschema --hcatalog-table hivetable --hive-partition-key <partition-name> --hive-partition-value <partition-value> -m 1 

    6) import-all-tables  Import tables from a database to HDFS

    7) export             Export an HDFS directory to a database table

    sqoop export --connect jdbc:db2://<server>:<port>/<database> --username username --password password  -table tablename --hcatalog-database hiveschema --hcatalog-table hivetable -m 1

    8) merge              Merge results of incremental imports

     

    9) job                Work with saved jobs

     

    10) metastore          Run a standalone Sqoop metastore

     sqoop version

    11) help               List available commands

    sqoop help

    sqoop COMMAND help

    12) codegen            Generate code to interact with database records

     

    13) version            Display version information

    sqoop version

  • 相关阅读:
    结合使用allure当中的方法 让用例执行结果内 显示详细描述信息
    pytest-repeat插件,指定用例重复运行、重复运行次数
    pytest-xdist 分布式执行用例
    token
    使用pytest-ordering 来自定义用例执行顺序
    用例编写规则、命令行执行用例、用例执行的先后顺序
    python 中的doctest单元测试框架
    pytest 对用例mark标记分类(且用例也可按照分类来执行)
    学习webpack基本配置(一)
    (剑指offer)数组中出现次数超过一半的数字
  • 原文地址:https://www.cnblogs.com/longjshz/p/5524344.html
Copyright © 2011-2022 走看看