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'

    
    
    
    

    向学生表添加课程列族;

  • 相关阅读:
    数据结构总结——线段树
    [bzoj2131]免费的馅饼 树状数组优化dp
    [机房练习赛7.26] YYR字符串
    博客已搬家
    AFO
    COGS-2551 新型武器
    UVALive-3716 DNA Regions
    UVALive-4850 Installations
    UVALive-3983 Robotruck
    UVA-10859 Placing Lampposts
  • 原文地址:https://www.cnblogs.com/YY0302/p/9009334.html
Copyright © 2011-2022 走看看