怎样把json数据存到hbase

问问题描述

怎样把json数据存到hbase,麻烦给回复

答精选答案

最佳答案

HBASE中的表示按column family来存储的 建立一个有3个column family的表 create 't1', {NAME => 'f1', VERSIONS => 1}, {NAME => 'f2', VERSIONS => 1}, {NAME => 'f3', VERSIONS => 1} 定义表的时候只需要指定column family的名字,列名在put的时候动态指定 插入数据 下面插入没有指定column的名字 put 't1', 'r1', 'f1', 'v1' put 't1', 'r2', 'f2', 'v2' put 't1', 'r3', 'f3', 'v3' 下面插入指定column的名字 put 't1', 'r4', 'f1:c1', 'v1' put 't1', 'r5', 'f2:c2', 'v2' put 't1', 'r6', 'f3:c3', 'v3' hbase(main):245:0> scan 't1' ROW COLUMN+CELL r1 column=f1:, timestamp=1335407967324, value=v1 r2 column=f2:, timestamp=1335408004559, value=v2 r4 column=f1:c1, timestamp=1335408640777, value=v1 r5 column=f2:c1, timestamp=1335408640822, value=v2 r6 column=f1:c6, timestamp=1335412392258, value=v3 r6 column=f2

本文来自作者[诗坊集]投稿,不代表公众科技网立场,如若转载,请注明出处:https://www.cpst.net.cn/gongchengkaoshi1/202609/1991662.html

赞 (0)

发表回复

本站作者后才能评论

评论列表(4条)

  • 诗坊集
    诗坊集 2026年09月30日

    我是公众科技网的签约作者“诗坊集”!

  • 诗坊集
    诗坊集 2026年09月30日

    希望本篇文章《怎样把json数据存到hbase》能对你有所帮助!

  • 诗坊集
    诗坊集 2026年09月30日

    本站[公众科技网]内容主要涵盖:教育咨询,知识百科

  • 诗坊集
    诗坊集 2026年09月30日

    本文概览:HBASE中的表示按column family来存储的 建立一个有3个column family的表 create 't1', {NAME => 'f1', VERSIONS => 1}, {NAME => 'f2', VERSIONS => 1}, {NAME => 'f3', VERSIONS => 1} 定义表的时候只需要指定column family的名字,列名在put的时候动态指定 插入数据 下面插入没有指定column的名字 put 't1', 'r1', 'f1', 'v1' put 't1

联系我们

联系:143 0457 151

工作时间:周一至周五,9:30-18:30,节假日休息

关注我们