how to check number of partitions count in amazon keyspaces ?
is there a way to create dashboard to check no. of partitions creation
whether no. of partition key is equal to no. of partitions ?
how to check number of partitions count in amazon keyspaces ?
is there a way to create dashboard to check no. of partitions creation
whether no. of partition key is equal to no. of partitions ?
You will want to use AWS Glue and the Spark Cassandra connector. You can use the following to grab the distinct keys of any combination of columns. The script below reads a list of comma separated column names to use with distinct count. You will want to make sure you first enable the MurMur3 partitioner
val tableName = args("TABLE_NAME")
val keyspaceName = args("KEYSPACE_NAME")
val tableDf = sparkSession.read
.format("org.apache.spark.sql.cassandra")
.options(Map( "table" -> tableName, "keyspace" -> keyspaceName, "pushdown" -> "false"))
.load()
val distinctKeys = args("DISTINCT_KEYS").filterNot(_.isWhitespace).split(",")
logger.info("distinctKeys: " + distinctKeys.mkString(", "))
val results = tableDf.select(distinctKeys.head, distinctKeys.tail:_*).distinct().count()
logger.info("Total number of distinct keys: " + results)
The full example can be found here.