zoukankan      html  css  js  c++  java
  • sqoop1.4.6从mysql导入hdfshivehbase实例

    //验证sqoop是否连接到mysql数据库
    sqoop list-tables --connect 'jdbc:mysql://n1/guizhou_test?useUnicode=true&characterEncoding=utf-8' --username root --password root
    //导入整表到hdfs
    sqoop import --connect 'jdbc:mysql://n1/guizhou_test?useUnicode=true&characterEncoding=utf-8' --username root --password root --table family --target-dir /guizhou/family/
    //根据sql导入到hdfs
    sqoop import --connect 'jdbc:mysql://n1/guizhou_test?useUnicode=true&characterEncoding=utf-8' --username root --password root --query 'select * from family where familyid>66043 and $CONDITIONS' --split-by familyid -m 3 --target-dir /guizhou/family2
    //根据sql导入到hive
    sqoop import --connect 'jdbc:mysql://n1/guizhou_test?useUnicode=true&characterEncoding=utf-8' --username root --password root --query 'select * from family where familyid>66043 and $CONDITIONS' --split-by familyid --hive-import -m 5 --target-dir /guizhou/family4 --hive-table family3

    //根据sql导入到hbase
    sqoop import --connect 'jdbc:mysql://n1/guizhou_test?useUnicode=true&characterEncoding=utf-8' --username root --password root --query 'select * from family where familyid>66043 and $CONDITIONS' --split-by familyid -m 5 --hbase-table family --column-family cf --hbase-row-key "RID"--hbase-create-table

  • 相关阅读:
    DLL注入实践
    程序编译保护机制
    加密配置文件总结
    PCL点云配准(3)
    PCL点云分割(3)
    ubuntu Ros环境halcon的一个程序
    opencv2/nonfree/nonfree.hpp:没有那个文件或目录
    深度图像计算三维点云
    利用深度学习的点云语义分割(一)
    3D 特征点概述(2)
  • 原文地址:https://www.cnblogs.com/mowei/p/6774326.html
Copyright © 2011-2022 走看看