小编Ala*_*ava的帖子

如何在clickhouse中进行分页

您能建议我如何在 click house 中进行分页吗?在弹性搜索中的示例中,我执行如下聚合查询。这里弹性搜索采用参数分区号和分区大小并给出结果。假设我们总共有 100 条记录,如果我们给分区大小为 10、分区号为 2,那么我们将获得 11-20 条最新记录。

考虑到插入表中的数据,我们如何在 Click House 中做到这一点。

SearchResponse response = elasticClient.prepareSearch(index)
    .setTypes(documentType)
    .setQuery(boolQueryBuilder)
    .setSize(0)
    .addAggregation(AggregationBuilders.terms("unique_uids")
    .field(Constants.UID_NAME)
    .includeExclude(new IncludeExclude(partition,numPartitions))
    .size(Integer.MAX_VALUE))
    .get();
Run Code Online (Sandbox Code Playgroud)

clickhouse

4
推荐指数
1
解决办法
7228
查看次数

标签 统计

clickhouse ×1