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'

    
    
    
    

    向学生表添加课程列族;

  • 相关阅读:
    HDU 3729【二分匹配】
    51nod 1456【强连通,缩点,并查集】
    51nod1459【二级最短路】
    51nod1640 【最小生成树】
    CodeForces660B【模拟—水】
    CodeForces691C 【模拟】
    Codeforces698B【并查集+拆环】
    CodeForces717C 【数学】
    Codeforces710C【数学】
    HDU5904【瞎搞】
  • 原文地址:https://www.cnblogs.com/YY0302/p/9009334.html
Copyright © 2011-2022 走看看