• hbase 查询空串空字段


    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();
        }
    }
    故乡明
  • 相关阅读:
    OWIN启动项的检测
    Katana概述
    update-database时出现Cannot attach the file
    数据并行
    SpinLock(自旋锁)
    屏障
    同步操作
    T4文本模板
    托管线程中的取消
    监视器
  • 原文地址:https://www.cnblogs.com/luweiweicode/p/14072570.html
Copyright © 2020-2023  润新知