filter方法去除數(shù)組中某個元素 hbase讀取數(shù)據(jù)怎么轉(zhuǎn)換json?
hbase讀取數(shù)據(jù)怎么轉(zhuǎn)換json?代碼示例:Configurationconf();(hbase.zookeeper.quorum,hadoop1,hadoop2,hadoop3);HTableta
hbase讀取數(shù)據(jù)怎么轉(zhuǎn)換json?
代碼示例:
Configurationconf();
(hbase.zookeeper.quorum,hadoop1,hadoop2,hadoop3);
HTabletablenextHTable(conf,DataCollection1);
(scan1);
Scanscan1fifthScan();
fifthPrefixFilter((row));
Filterfilter3newPrefixFilter((2017-01-01));
(filter3);
();
ResultScannerscanner1(scan1);
(scan2);
intcount0;
JSONArrayarrayfutureJSONArray();
for(Resultr:scanner1){
(sssss);
JSONObjectmapOfColValuesnextJSONObject();//創(chuàng)建json對象應(yīng)該是一個{name:wp}
for(KeyValuekv:r.raw()){
((row:s,family:s,qualifier:s,qualifiervalue:s,timestamp:s.,
(()),
(()),
(()),
(()),
()));
((()),(()));
}
(mapOfColValues);
count;
(count);
}
();
();
();
(count);
(-------------finished----------------);
map方法怎么去掉數(shù)組里的某一個項?
map肯定不能徹底刪除元素,用filter刪出
filter函數(shù)怎樣提取多列不連續(xù)的值?
filter函數(shù)其他提取多列不嘗試的值方法追加
FILTER函數(shù):FILTER函數(shù)是兩個篩選后函數(shù),它這個可以根據(jù)我們可以設(shè)置的條件來篩選數(shù)據(jù),
語法:FILTER(array,include,[if_empty])
第一參數(shù):可以表示想要篩選后的數(shù)據(jù)區(qū)域
第二參數(shù):再次篩選的條件,它是一個布爾值
第三參數(shù):if_empty,據(jù)條件假如找不到結(jié)果,就直接返回第三參數(shù)的值,它是一個可選參數(shù)