hbase创建一个学生信息表
时间: 2024-06-22 21:01:22 浏览: 124
学生信息表
HBase是一个分布式的、面向列的开源数据库,它可以在廉价的硬件上运行,并且可以处理大规模的非结构化数据。下面是创建一个学生信息表的步骤:
1. 打开HBase shell。
2. 创建一个名为student的表:create 'student', 'address', 'score'
3. 添加列族下的列限定符:alter 'student', {NAME => 'score', VERSIONS => 3}
4. 插入数据:put 'student', 'zhangsan', 'address:province', 'guangdong';put 'student', 'zhangsan', 'address:city', 'guangzhou';put 'student', 'zhangsan', 'address:street', 'yinglonglu';put 'student', 'zhangsan', 'score:Java', '85';put 'student', 'zhangsan', 'score:Hadoop', '80';put 'student', 'zhangsan', 'score:Math', '90';put 'student', 'lisi', 'address:province', 'guangxi';put 'student', 'lisi', 'address:city', 'guilin';put 'student', 'lisi', 'address:street', 'putuolu';put 'student', 'lisi', 'score:Java', '87';put 'student', 'lisi', 'score:Hadoop', '82';put 'student', 'lisi', 'score:Math', '91';put 'student', 'zhangsan', 'score:English', '69';put 'student', 'zhangsan', 'score:Computer', '95'
5. 查询数据:scan 'student'
阅读全文