1
내가 가지고 시계열의 키 스페이스에 다음과 같은 테이블 :쿼리 카산드라
CREATE TABLE underlying_data (
symbol text,
ask decimal,
bid decimal,
ts bigint,
PRIMARY KEY ((symbol))
) WITH
bloom_filter_fp_chance=0.010000 AND
caching='KEYS_ONLY' AND
comment='' AND
dclocal_read_repair_chance=0.100000 AND
gc_grace_seconds=864000 AND
index_interval=128 AND
read_repair_chance=0.000000 AND
replicate_on_write='true' AND
populate_io_cache_on_flush='false' AND
default_time_to_live=0 AND
speculative_retry='99.0PERCENTILE' AND
memtable_flush_period_in_ms=0 AND
compaction={'class': 'SizeTieredCompactionStrategy'} AND
compression={'sstable_compression': 'LZ4Compressor'};
CREATE INDEX underlying_data_ts_idx ON underlying_data (ts);
cqlsh:timeseries>
내가 같은 일부 항목을 삽입 한 후 C에서 #이 테이블을 조회하려고 :
static long ninetySeventyTicks = new DateTime(1970, 1, 1).Ticks;
Cluster cluster = Cluster.Builder().AddContactPoint("127.0.0.1").Build();
ISession session = cluster.Connect("timeseries");
RowSet result = session.Execute("SELECT symbol, ts FROM underlying_data WHERE ts > "
+ ninetySeventyTicks.ToString()
+ " and symbol = 'SPX'"
//+ "AllowFiltering"
+ ";");
rows = result.GetRows();
을하지만 내가 얻을 예외 :
Message = "No indexed columns present in by-columns clause with Equal operator"
이 예제는 쿼리 캐싱 랜드에있는 책에서 복사했습니다. 유일한 차이점은이 책은 C# 드라이버가 아닌 CQL을 사용한다는 것입니다.
이 방법이 효과가 있습니까? 그렇다면 해결책은 무엇입니까?