【发布时间】:2019-07-28 07:22:59
【问题描述】:
我正在使用 Cassandra 3.11.4 和 Spark 2.3.3。当我使用 joinWithCassandraTable 查询大量分区键(3 个月,其中分钟是分区键 = 3 * 30 * 24 * 60 分区键)时,我在 cassandra 下看到很多慢速超时日志 debug.log 喜欢:
<SELECT * FROM event_keyspace.event_table WHERE partitionkey1, partitionkey2 = value1, value2 AND column_key = column_value1 LIMIT 5000>, time 599 msec - slow timeout 500 msec
<SELECT * FROM event_keyspace.event_table WHERE partitionkey1, partitionkey2 = value5, value6 AND column_key = column_value5 LIMIT 5000>, time 591 msec - slow timeout 500 msec/cross-node
我在 joinWithCassandraTable 之前使用 repartitionByCassandraReplica。
我看到磁盘 IO 达到 100%。如果我更改将小时作为分区键而不是分钟的数据模型,则会创建不适用的大分区。
我怀疑这个限制 5000 可能会导致这种情况,但即使我设置了 input.fetch.size_in_rows,这个日志也没有改变。
sparkConf.set("spark.cassandra.input.fetch.size_in_rows", "20000");
我该如何设置这个 LIMIT 5000 子句?
【问题讨论】:
标签: apache-spark cassandra datastax datastax-java-driver spark-cassandra-connector