使用HBASE shell创建学生表(Student)并输入内容
时间: 2024-03-05 19:52:36 浏览: 50
以下是使用 HBase shell 创建学生表 Student 并输入内容的示例:
1. 打开 HBase shell:在命令行中输入 `hbase shell` 并回车。
2. 创建表:输入 `create 'Student', 'info'` 并回车。此命令创建了名为 Student 的表和一个名为 info 的列族。
3. 输入数据:输入以下命令并回车,将数据插入到表中。
```
put 'Student', '1001', 'info:name', 'Alice'
put 'Student', '1001', 'info:age', '20'
put 'Student', '1001', 'info:gender', 'Female'
put 'Student', '1002', 'info:name', 'Bob'
put 'Student', '1002', 'info:age', '21'
put 'Student', '1002', 'info:gender', 'Male'
put 'Student', '1003', 'info:name', 'Cathy'
put 'Student', '1003', 'info:age', '22'
put 'Student', '1003', 'info:gender', 'Female'
```
以上命令向表 Student 中插入了 3 条记录,每个记录包含 3 个列,分别是 name、age 和 gender。
4. 验证数据:输入 `scan 'Student'` 并回车,可以查看表中的所有数据。
5. 退出 HBase shell:输入 `exit` 并回车,退出 HBase shell。
这样就完成了使用 HBase shell 创建学生表并输入内容的操作。
相关推荐
![docx](https://img-home.csdnimg.cn/images/20210720083331.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)