zoukankan      html  css  js  c++  java
  • 熟悉HBase基本操作

    1.以下关系型数据库中的表和数据,要求将其转换为适合于HBase存储的表并插入数据:

    学生表(Student)(不包括最后一列)

    put 'Student','188','S_No','2015001'

    put 'Student','190','S_No','2015003'

    put 'Student','200','S_No','2015003'

    put 'Student','188','S_Name','Zhangsan'

    put 'Student','190','S_Name','Mary'

    put 'Student','200','S_Name','Lisi'

    put 'Student','188','S_Sex','male'

    put 'Student','190','S_Sex','female'

    put 'Student','200','S_Sex','male'

    put 'Student','188','S_Age','23'

    put 'Student','190','S_Age,'22'

    put 'Student','200','S_Age','24'

    2.用Hadoop提供的HBase Shell命令完成相同任务:

    (1)列出HBase所有的表的相关信息;list

    (2)在终端打印出学生表的所有记录数据;

    (3)向学生表添加课程列族;

    alter 'Student','NAME'=>'course'

    (4)向课程列族添加数学列并登记成绩为85;

    put 'Student','s003','course:Math','85'

    (5)删除课程列;

    disable 'Student'

    dorp 'Student','course'

    (6)统计表的行数;count 's1'

    count 'Student'

    (7)清空指定的表的所有记录数据;truncate 's1'

    truncate 'Student'

    
    
    
    

    向学生表添加课程列族;

  • 相关阅读:
    word上怎么打钩
    POI操作excel常用方法总结
    web.xml中Filter过滤器标签说明
    IDEA使用操作说明(自己总结)
    windows 64位上oracle 11g安装
    List<T>与List<?>的区别
    java分页之假分页
    CDN之Web Cache
    HTTP之缓存技术
    HTTP之Cookie和Session
  • 原文地址:https://www.cnblogs.com/YY0302/p/9009334.html
Copyright © 2011-2022 走看看