hbase and or 连用查询空串空字段
private static void loadAllData2IfStatus(String tableName) { try { Table table = HbaseUtil.getTable(tableName); Scan scan = new Scan(); FilterList allFilters = new FilterList(FilterList.Operator.MUST_PASS_ONE); // 按照平台类型 allFilters.addFilter(new PrefixFilter(Bytes.toBytes("9" + "#"))); FilterList allFilters2 = new FilterList(FilterList.Operator.MUST_PASS_ALL); SingleColumnValueFilter filterCompanyName = new SingleColumnValueFilter("info".getBytes(), "companyName".getBytes(), CompareFilter.CompareOp.EQUAL, "".getBytes()); filterCompanyName.setFilterIfMissing(false); allFilters2.addFilter(filterCompanyName); allFilters2.addFilter(allFilters); scan.setFilter(allFilters2); ResultScanner rs = table.getScanner(scan); int count = 0; for (Result result : rs) { count++; String shopType = Bytes.toString(result.getValue("info".getBytes(), "shopType".getBytes())); String companyName = Bytes.toString(result.getValue("info".getBytes(), "companyName".getBytes())); String busLicURL = Bytes.toString(result.getValue("info".getBytes(), "busLicURL".getBytes())); //busLicURL fodLicURL if (StringUtils.isEmpty(busLicURL) || "-1".equals(busLicURL)) { continue; } if (StringUtils.isNotEmpty(companyName)) { continue; } if (ArrayUtil.contains(shopTypes, shopType)) { resultUrl.add(result); processLicense(); } } System.out.println(count); } catch (Exception e) { e.printStackTrace(); } }