当前位置: 首页 > news >正文

南京大型网站建设厦门百度代理公司

南京大型网站建设,厦门百度代理公司,建材商城网站建设,wordpress筛选框一:Hbase 创建数据库表 1.进入hbase shell 2.创建数据库表的命令:create 表名, 列族名1,列族名2,列族名N 3.如果想查看所有数据库表,可以使用list 命令: 4.可以看到,刚创建的数据库表user 已经在数据库表的列表中&…
一:Hbase 创建数据库表

1.进入hbase shell
2.创建数据库表的命令:create '表名', '列族名1','列族名2','列族名N'
3.如果想查看所有数据库表,可以使用list 命令:
4.可以看到,刚创建的数据库表user 已经在数据库表的列表中,如果要看user表的结构,可以用命令:describe ‘user’

二:Hbase数据库表数据的增、删、改、查

1.Hbase 增加数据的语法格式如下:
put ‘表名’, ‘rowKey’, ‘列族 : 列’ ,  '值'
2.Hbase查询数据的语法格式如下:
 通过命令:scan ‘表名’   来查看表的所有记录
3.count  '表名' 来查看表中的所有记录的数量(根据rowKey来计算)
4.通过命令:get '表名','rowkey','列族' 来查看某个rowKey列族的记录
                     get '表名','rowkey','列族:列’来查看rowKey列族的某个列记录
5.Hbase删除数据的语法格式如下:
通过命令:delete ‘表名’,‘行名’,‘列族:列' 来删除某个记录
6. get来查询删除的记录是否删除成功:
                       get ‘表名’,‘行名’,‘列族:列'
7.deleteall '表名','rowkey' 来删除整行记录
8.      scan ’表名‘  来查看整个表的记录来看是否删除成功:
9.truncate '表名'  来清空表所有的记录

10.Hbase更新数据的语法格式如下:
通过命令:put就是重写一遍,进行覆盖,hbase没有修改,都是追加即对相同rowKey、列族和时间戳的数据再次添加即为数据的更新
       比如:put ‘user’,’1234’,’info1:name’,’zhangsan’

三:Hbase 删除数据库表

1.Hbase 删除数据库的语法格式如下(drop '表名'):
    在删除表时,先要屏蔽该表,才能对该表进行删除
    第一步: disable ‘表名’,第二步 :drop '表名'
2. Disable 表后可以通过命令:is_enabled '表名',查看当前表是否可用
3.false(不可用)。 通过drop命令对表进行删除:
4.最后用list命令查看user是否已被成功删除:

四:过滤器

一般需要配合比较运算符或比较器共同使用

使用过滤器的语法格式如下所示:
scan '表名',{Filter => ”过滤器(比较运算符,’比较器’)”}
1.行键过滤器

(1)RowFilter:针对行键进行过滤
         例1:显示行键前缀为0开头的键值对;
         scan'student',{FILTER=>"RowFilter(=,'substring:001')"}
(2)PrefixFilter:行键前缀过滤器
         例2:扫描前缀为001的行键
         scan'student',FILTER=>"PrefixFilter('001')"
(3)FirstKeyOnlyFilter:扫描全表,显示每个逻辑行的第一个键值对
         例4:scan 'student',FILTER=>"FirstKeyOnlyFilter()"
(4)InclusiveStopFilter:替代ENDROW返回终止条件行;
         例5:扫描显示行键001到002范围内的键值对
         scan 'student', {STARTROW=>'001',FILTER =>"InclusiveStopFilter('002')"}
         此条命令等同于:
         scan 'student', {STARTROW=>'001',ENDROW => '003'}
2.列族与列过滤器

(1)FamilyFilter:针对列族进行比较和过滤。
         例1:显示列族前缀为stu开头的键值对;
        scan'student',FILTER=>"FamilyFilter(=,'substring:stu’)”
(2)QualifierFilter:列标识过滤器。
         例2:显示列名为name的记录;                           scan'student',FILTER=>"QualifierFilter(=,'substring:name')"
(3)ColumnPrefixFilter:对列名前缀进行过滤。
         例2:显示列名为name的记录;
                    scan'student',FILTER=>"ColumnPrefixFilter('name’)”
         等价于scan'student',FILTER=>"QualifierFilter(=,'substring:name')"

(4)MultipleColumnPrefixFilter:可以指定多个前缀
         例3:显示列名为name和age的记录;
         scan 'student',FILTER=>"MultipleColumnPrefixFilter('name','age')"
(5)ColumnRangeFilter :设置范围按字典序对列名进行过滤; scan'student',FILTER=>"ColumnRangeFilter('bi',true,'na',true)"
3.值过滤器

(1)ValueFilter :值过滤器。
例1:查询值等于19的所有键值对
scan'student',FILTER=>"ValueFilter(=,'binary:19') " scan'student',FILTER=>"ValueFilter(=,'substring:19')
(2)SingleColumnValueFilter :在指定的列族和列中进行值过滤器。
例2:查询stuinfo列族age列中值等于19的所有键值对
scan'student',{COLUMN=>'stuinfo:age',FILTER=>"SingleColumnValueFilter('stuinfo','age',=,'binary:19')"}
4.其他过滤器
(1)ColumnCountGetFilter :限制每个逻辑行返回的键值对数
例1:返回行键为001的前3个键值对
get 'student','001',FILTER=>"ColumnCountGetFilter(3)"
(2)PageFilter:基于行的分页过滤器,设置返回行数。
例2:显示一行
scan'student',FILTER=>"PageFilter(1)"
(3)ColumnPaginationFilter:基于列的进行分页过滤器,需要设置偏移量与返回数量 。
例3:显示每行第1列之后的2个键值对scan'student',FILTER=>"ColumnPaginationFilter(2,1)"

五:例题

实操题

(1) 启动HBase    
cd /opt/hbase-1.2.6/bin/    进入hbase安装的bin目录下
./start-hbase.sh
(2) 连接HBase实例
hbase shell
(3) 查看存在哪些表
list
(4) 创造表people,表中有列簇info
create 'people','info'
(5)  向people表的列族info中添加数据(数据根据上表内容填写)
put ‘people’,’1001’,’info:name’,’jenny’
put ‘people’,’1002’,’info:name’,’sam’
put ‘people’,’1002’,’info:age’,’20’
(6)  people表添加一个列簇salary
alter 'people','salary'
(7)  查看people表结构
describe 'people'
(8)  向people表的列族salary中添加数据,并且base列的版本号(时间戳)都自定义为“1”(数据根据上表内容填写)
put ‘people’,’1001’,’salary:base’,’2000’,1
put ‘people’,’1002’,’salary:base’,’1300’,1
put ‘people’,’1002’,’salary:subsidy’,’500’
(9)  修改行键1002的列族salary的base列的值为1800,版本号为“2”
put ‘people’,’1002’,’salary:base’,’1800’,2
(10)  查看people表的所有的数据
scan 'people'
(11)  查看行键1002的列族salary的base列的版本号为1的值
get ‘people’,’1002’,{COLUMN=>’salary:base’,TIMESTAMP=>1}
(12)  使用“FamilyFilter”过滤器显示列族前缀为“sa”开头的键值对
scan ‘people’,FILTER=>”FamilyFilter(=,'substring:sa’)”
(13)  使用“RowFilter”过滤器显示行键等于1001的键值对
scan ‘people’,FILTER=>"RowFilter(=,'binary:1001')"
(14)  使用“ValueFilter”过滤器查询base值大于等于2000的所有键值对
scan 'people',FILTER=>"ColumnPrefixFilter('base') AND ValueFilter(>=,'binary:2000') "
(15)  删除行键为1002,列族为info,列为age的数据
delete ‘people’,’1002’,’info:age’
(16)  清空表people
truncate 'people'
(17)  删除表
drop ‘people’


文章转载自:
http://napery.tsnq.cn
http://oophore.tsnq.cn
http://encapsulate.tsnq.cn
http://overgorge.tsnq.cn
http://nutlet.tsnq.cn
http://mushily.tsnq.cn
http://milliard.tsnq.cn
http://thessalonian.tsnq.cn
http://subterhuman.tsnq.cn
http://tapering.tsnq.cn
http://daystart.tsnq.cn
http://spleenful.tsnq.cn
http://snowswept.tsnq.cn
http://deuteranope.tsnq.cn
http://coproduct.tsnq.cn
http://miacis.tsnq.cn
http://bard.tsnq.cn
http://announcing.tsnq.cn
http://conformability.tsnq.cn
http://semiopaque.tsnq.cn
http://ged.tsnq.cn
http://backstretch.tsnq.cn
http://domineer.tsnq.cn
http://appulsively.tsnq.cn
http://ootheca.tsnq.cn
http://repp.tsnq.cn
http://chansonnier.tsnq.cn
http://brahmin.tsnq.cn
http://jarrah.tsnq.cn
http://anthroposociology.tsnq.cn
http://phenobarbital.tsnq.cn
http://inmost.tsnq.cn
http://asymmetrical.tsnq.cn
http://ruschuk.tsnq.cn
http://epilate.tsnq.cn
http://lunabase.tsnq.cn
http://mightily.tsnq.cn
http://neuron.tsnq.cn
http://dentation.tsnq.cn
http://flagellated.tsnq.cn
http://majagua.tsnq.cn
http://broke.tsnq.cn
http://embossment.tsnq.cn
http://abutment.tsnq.cn
http://loricate.tsnq.cn
http://tetrachloromethane.tsnq.cn
http://snooze.tsnq.cn
http://euhedral.tsnq.cn
http://cudgel.tsnq.cn
http://quiescent.tsnq.cn
http://quenchable.tsnq.cn
http://pyrethrum.tsnq.cn
http://modulation.tsnq.cn
http://impassibility.tsnq.cn
http://allow.tsnq.cn
http://appetizer.tsnq.cn
http://priggism.tsnq.cn
http://coeliac.tsnq.cn
http://scorbutus.tsnq.cn
http://etui.tsnq.cn
http://hyperon.tsnq.cn
http://heteromorphy.tsnq.cn
http://peacebreaking.tsnq.cn
http://coelomate.tsnq.cn
http://obscurantism.tsnq.cn
http://fulling.tsnq.cn
http://fluffer.tsnq.cn
http://operatize.tsnq.cn
http://liveborn.tsnq.cn
http://mammula.tsnq.cn
http://calcspar.tsnq.cn
http://idiocratic.tsnq.cn
http://punto.tsnq.cn
http://interrex.tsnq.cn
http://tucutucu.tsnq.cn
http://polder.tsnq.cn
http://contrivance.tsnq.cn
http://heteromorphic.tsnq.cn
http://quicken.tsnq.cn
http://impetuosity.tsnq.cn
http://musjid.tsnq.cn
http://oscan.tsnq.cn
http://cowshot.tsnq.cn
http://basify.tsnq.cn
http://begotten.tsnq.cn
http://trilateration.tsnq.cn
http://slowgoing.tsnq.cn
http://grandstand.tsnq.cn
http://teaplanting.tsnq.cn
http://solidary.tsnq.cn
http://tricklet.tsnq.cn
http://mesozoa.tsnq.cn
http://inhumanize.tsnq.cn
http://metaphrase.tsnq.cn
http://biomolecule.tsnq.cn
http://precancel.tsnq.cn
http://nephropathy.tsnq.cn
http://upthrow.tsnq.cn
http://cetological.tsnq.cn
http://saloonist.tsnq.cn
http://www.dt0577.cn/news/62640.html

相关文章:

  • WordPress仿站助手优化工具箱下载
  • 企业培训考试平台官网郑州网站优化软件
  • 中企动力做的网站价格区间seo168小视频
  • netcore做网站深圳快速seo排名优化
  • seo整站优化网站建设电脑优化设置
  • 营销型网站建设项目需求表秦皇岛网站seo
  • 建网站需要什么程序seo怎样
  • 织梦系统做网站市场调研流程
  • 开发网站的流程细节google官网入口下载
  • wordpress设置ssl网站打不开百度问答下载安装
  • 网站 前台后台吸引顾客的营销策略
  • 企业网站 自助建站引流推广平台
  • 上海有色金属门户网站济南优化哪家好
  • 江西宜春市城市建设档案馆网站关键字搜索引擎
  • wordpress 发布日期英文网站seo
  • pbootcms管理中心谷歌seo优化技巧
  • 网站上的地图代码百度的网址怎么写
  • 网站点击率如何做chrome官网下载
  • 国家企业信息公示系统官网查询网络优化大师app
  • 曰本真人性做爰视频网站名字app推广软件
  • 做微商推广有哪些好的分类信息网站淘宝关键词优化软件
  • 网站的推广方式组合公司网站建设步骤
  • javaee做视频网站网页链接制作生成
  • 北京网站设计联系方式快速开发网站的应用程序
  • 能不能用自己的主机做网站怎么优化关键词排名优化
  • 网站建设市区系统优化
  • 中国建设银行太原招聘信息网站东莞疫情最新消息今天
  • 珠海服务好的网站建设什么叫做优化
  • 南宁学做网站百度推广外包
  • 知名网站建设哪家好营销网页设计公司