关于Cassandra数据库中非主键列的谓词

时间:2019-10-02 17:41:25

标签: java spring-boot cassandra spring-data-jpa

我正在尝试对非主键列执行In查询,但Cassandra给出错误消息,即来自服务器的错误:code = 2200 [Invalid query] message =“非主键列(listing_category)上的IN谓词为尚不支持”,因此我已经在表上创建了索引,但是仍然存在该错误,因此请帮助我解决该错误。

我的表结构如下,

CREATE TABLE eyerne.eye_property_feeds (
    property_id uuid,
    created_date timestamp,
    added_by text,
    address text,
    amenities list<text>,
    apartment_number text,
    city text,
    create_as text,
    created_by text,
    deals_and_cost_optimizations list<text>,
    deposit_fees double,
    description text,
    features map<text, text>,
    heating_system text,
    help_from_agent boolean,
    house_number int,
    is_foreclosure boolean,
    is_openhouse boolean,
    is_publish boolean,
    is_resale boolean,
    keywords list<text>,
    latitude decimal,
    listing_category text,
    longitude decimal,
    lot_size double,
    mls_agent_id text,
    mls_listing_id text,
    mls_source_id text,
    no_of_bathrooms int,
    no_of_bedrooms int,
    no_of_parking_spaces int,
    notify_deals_and_cost_optimisation boolean,
    openhouse_days list<int>,
    openhouse_end_date date,
    openhouse_end_hours time,
    openhouse_start_date date,
    openhouse_start_hours time,
    photos list<text>,
    price double,
    property_status text,
    property_sub_type text,
    property_type text,
    renovation_year int,
    room_count int,
    size_in_feet double,
    state text,
    street text,
    updated_by text,
    updated_date timestamp,
    user_profile_mysql_id int,
    videos list<text>,
    visibility text,
    visitor_limit int,
    year_build int,
    zipcode text,
    PRIMARY KEY (property_id, created_date)
) WITH CLUSTERING ORDER BY (created_date DESC)
    AND bloom_filter_fp_chance = 0.01
    AND caching = {'keys': 'ALL', 'rows_per_partition': 'NONE'}
    AND comment = ''
    AND compaction = {'class': 'org.apache.cassandra.db.compaction.SizeTieredCompactionStrategy', 'max_threshold': '32', 'min_threshold': '4'}
    AND compression = {'chunk_length_in_kb': '64', 'class': 'org.apache.cassandra.io.compress.LZ4Compressor'}
    AND crc_check_chance = 1.0
    AND dclocal_read_repair_chance = 0.1
    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 = '99PERCENTILE';
CREATE INDEX listing_index ON eyerne.eye_property_feeds (listing_category);

我正在尝试执行查询SELECT * FROM eye_property_feeds WHERE user_profile_mysql_id=107 AND listing_category IN ('RENT','SELL') ALLOW FILTERING;,但它给出错误消息为来自服务器的错误:代码= 2200 [无效查询] message =“非主键列(listing_category)上的谓词不是还受支持”

0 个答案:

没有答案