hbase中預分割槽表中資料的查詢(二)

2021-09-25 18:59:56 字數 1998 閱讀 1458

在上一遍博文中介紹了建立建立預分割槽,並實現新增資料操作,本篇博文,介紹不同角度的查詢

/**

* scan 設定時間範圍查詢

* @param htable

* @throws ioexception

*/private static void scanbyrangequery(table htable,string startrow,string endrow) throws ioexception }}

public static void main(string agrs)

/**

* scan 正則過濾器,根據使用者id查詢使用者

* 提取rowkey以01結尾資料

* filter filter = new rowfilter(comparefilter.compareop.equal,new regexstringcomparator(".*01$"));

* 提取rowkey以包含201407的資料

* filter filter = new rowfilter(comparefilter.compareop.equal,new substringcomparator("201407"));

* 提取rowkey以123開頭的資料

* filter filter = new rowfilter(comparefilter.compareop.equal,new binaryprefixcomparator("123".getbytes()));

* @param htable

* @throws ioexception

*/private static void scanbyregexfilter(table htable,string userid) throws ioexception }}

public static void main(string agrs)

/**

* scan 通過rowkey過濾器進行檢視

* @param htable

* @throws ioexception

*/private static void scanbyrowkeyfilter(table htable,string rowkey) throws ioexception

}}public static void main(string agrs)

/**

* scan 字首過濾器

* @param htable

* @throws ioexception

*/private static void scanbyprefixquery(table htable,string prefix) throws ioexception }}

public static void main(string agrs)

/**

* scan 包含過濾器

* @param htable

* @throws ioexception

*/private static void scanbycontainsfilter(table htable,string startrow,string param) throws ioexception }}

public static void main(string agrs)

/**

* scan 設定時間範圍查詢

* @param htable

* @throws ioexception

*/private static void scanbyrangetimequery(table htable,string startrow,string endrow) throws ioexception }}

public static void main(string agrs)

postgresql中的分割槽表

在早期的版本中pg中的分割槽表都是通過繼承的方式建立的,通過繼承的方式來建立分割槽表的這種方式用起來不是很方便。mydb create table parent id int primary key,name varchar 100 create table mydb create index id...

Hbase表的建立過程以及預分割槽與RowKey設計

hbase表的建立過程 1.首先獲得乙個conf物件 configuration conf hbaseconfiguration.create 2.配置zookeeper節點與埠號 conf.set hbase.zookeeper.quorum node01,node02,node03 conf.s...

ORACLE建立分割槽表及分割槽表的資料遷移

對於目前資料量較大的表,report ap stat hour 2個月有1900萬 client offline history 2個月有4800萬 如果儲存超過一年資料將達數億,對這種級別的資料索引優化已經達不到要求的 15秒之內完成查詢 因此需要進行按月分表,使用oracle11g的新特性int...