【问题标题】:PrestoDB v0.125 SELECT only returns subset of Cassandra recordsPrestoDB v0.125 SELECT 仅返回 Cassandra 记录的子集
【发布时间】:2016-02-16 14:59:41
【问题描述】:

PrestoDB v0.125 中使用 Cassandra 连接器连接到 Datastax Cassandra 集群的 SELECT 语句仅返回 200 行,即使表包含的行数比这多得多。对同一个表进行 SELECT COUNT() 之类的聚合查询也只返回 200 个结果。

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

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

有谁知道我可以如何删除返回的 200 行的限制?我需要什么特定的环境变量设置?

【问题讨论】:

    标签: cassandra presto


    【解决方案1】:

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

    • cassandra.limit-for-partition-key-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
    

    【讨论】:

      猜你喜欢
      • 2017-01-08
      • 2014-11-06
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-06-08
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多