• Spark SQL Query Explain Plan

    DSE 5.0.6, Spark 1.6.2 Example 1 CREATE TABLE avm.transactions ( txn_status text, txn_date date, user_name text, merchant_name text, txn_amt int, txn_id uuid, txn_time timestamp, PRIMARY KEY ((txn_status, txn_date), txn_time, txn_id) WITH CLUSTERING ORDER BY (txn_time DESC) ) From cqlsh, below query works cassandra@cqlsh:avm> select * from transactions where txn_status IN ('SUCCESS','FAILED') and txn_date IN ('2017-07-16', '2017-07-17') limit 10; Below query does a Full Table Scan(FTS) spark-sql>select * from transactions where txn_date IN (cast('2017-07-16' as date),cast('2017-07-17' as date)) and event_name in ('SUCCESS','FAILED') AND MERCHANT_NAME='merchant1' limit 10 Below query does not do FTS, because leading partition key column is txn_status