scylladb / python-driver

ScyllaDB Python Driver, originally DataStax Python Driver for Apache Cassandra
https://python-driver.docs.scylladb.com
Apache License 2.0
70 stars 42 forks source link

cqlengine tests are failing when scylla 5.2 and up is used [Order by currently only supports the ordering of columns following their declared order in the PRIMARY KEY] #343

Open fruch opened 1 month ago

fruch commented 1 month ago

seems like this change shoved away those tests with the @requirescollectionindexes

and we weren't running them with scylla 5.1

but those two still fails, and need to be investigated:

fruch commented 1 month ago

the test model is:

class TestModel(Model):

    test_id = columns.Integer(primary_key=True)
    attempt_id = columns.Integer(primary_key=True)
    description = columns.Text()
    expected_result = columns.Integer()
    test_result = columns.Integer()

the schema:

CREATE TABLE cqlengine_test.test_model (
    test_id int,
    attempt_id int,
    description text,
    expected_result int,
    test_result int,
    PRIMARY KEY (test_id, attempt_id)
) WITH CLUSTERING ORDER BY (attempt_id ASC)
    AND bloom_filter_fp_chance = 0.01
    AND caching = {'keys': 'ALL', 'rows_per_partition': 'ALL'}
    AND comment = ''
    AND compaction = {'class': 'SizeTieredCompactionStrategy'}
    AND compression = {'sstable_compression': 'org.apache.cassandra.io.compress.LZ4Compressor'}
    AND crc_check_chance = 1.0
    AND dclocal_read_repair_chance = 0.0
    AND default_time_to_live = 0
    AND gc_grace_seconds = 864000
    AND max_index_interval = 2048
    AND memtable_flush_period_in_ms = 0
    AND min_index_interval = 128
    AND read_repair_chance = 0.0
    AND speculative_retry = '99.0PERCENTILE';

and this is the query

q = TestModel.objects(test_id=0).order_by('attempt_id')
# SELECT "attempt_id", "description", "expected_result", "test_result" FROM cqlengine_test.test_model WHERE "test_id" = %(0)s ORDER BY "attempt_id" ASC LIMIT 10000
fruch commented 1 month ago

@nyh can you give me a hand understanding this one ?

is that a scylla limitation ? is there a way around it ? is this limitation documented anywhere ?

Lorak-mmk commented 3 weeks ago

@nyh ping