PrestoDB v0.125 SELECT 只有 returns Cassandra 记录的子集

PrestoDB v0.125 SELECT only returns subset of Cassandra records

SELECT PrestoDB v0.125 中带有连接到 Datastax Cassandra 集群的 Cassandra 连接器的语句仅 return 200 行,即使 table 包含比这更多的行。像 SELECT COUNT() 这样的聚合查询在同一个 table 上也 return 结果只有 200。

(使用 pyhive 连接器和基本 presto CLI 查询时,此行为相同)。

文档没有多大帮助,但我猜测问题是分页和需要设置环境变量(文档没有解释): https://prestodb.io/docs/current/installation/cli.html

有谁知道如何取消 200 行的限制 returned?我需要什么具体的环境变量设置?

对于后来者 - 解决方案是在 cassandra.properties 连接器配置中用于 presto。关键设置是:

  • cassandra.limit-for-partition-key-select

这需要设置为高于您正在查询的 table 中的总行数,否则 select 查询将仅响应存储数据的一小部分(未找到所有分区键)。

我的配置文件的完整副本(可能有帮助!):

connector.name=cassandra
# Comma separated list of contact points
cassandra.contact-points=host1,host2
# Port running the native Cassandra protocol
cassandra.native-protocol-port=9042
# Limit of rows to read for finding all partition keys.
cassandra.limit-for-partition-key-select=2000000000
# maximum number of schema cache refresh threads, i.e. maximum number of parallel requests
cassandra.max-schema-refresh-threads=10
# schema cache time to live
cassandra.schema-cache-ttl=1h
# schema refresh interval
cassandra.schema-refresh-interval=2m
# Consistency level used for Cassandra queries (ONE, TWO, QUORUM, ...)
cassandra.consistency-level=ONE
# fetch size used for Cassandra queries
cassandra.fetch-size=5000
# fetch size used for partition key select query
cassandra.fetch-size-for-partition-key-select=20000