Clickhouset通过JDBC直接查询Bitmap

2021-08-11  本文已影响0人  和平菌
ClickHouseStatement statement = null;
            try {
                statement = connection.createStatement();
                ClickHouseRowBinaryInputStream in = statement.executeQueryClickhouseRowBinaryStream(sql);
                ClickHouseBitmap bit = in.readBitmap(ClickHouseDataType.UInt64);
                Roaring64NavigableMap obj = (Roaring64NavigableMap) bit.unwrap();
                return new ExtRoaringBitmap(obj);
            } catch (Exception e) {
                log.error("查询位图错误 [ip:{}][sql:{}]", ip, sql, e);
                throw e;
            } finally {
                DbUtils.close(statement);
            }
上一篇下一篇

猜你喜欢

热点阅读