我試圖用>=
操作檢索表中的文本數據,但是,沒有檢索雖然試圖用=
它成功返回卡桑德拉大於「>」問題卡桑德拉
這是查詢的樣本
select * from s.vechile_information where datetimelong >= '1493215758000' and vechile_customerid = '123' and vechileId = '32' allow filetring;
但除去>
當它工作正常
select * from s.vechile_information where datetimelong = '1493215758000' and vechile_customerid = '123' and vechileId = '32' allow filetring;
這是表結構
CREATE TABLE fcs.vehicle_information (
vehicle_customerId text,
vehicleid text,
cityid text,
cityname text,
citynamear text,
createdby text,
dateTimeLong text,
description text,
driverid text,
drivername text,
drivernamear text,
groupofvehicles text,
groupofvehiclesystemid text,
insexpirygregoriandate bigint,
name text,
namear text,
platenumber text,
vehiclestatus text,
PRIMARY KEY (vehicle_customerId, vehicleid)
) ;
CREATE CUSTOM INDEX dateTimeLongvehicle_information ON fcs.vehicle_information (dateTimeLong) USING 'org.apache.cassandra.index.sasi.SASIIndex' WITH OPTIONS = {'analyzer_class' : 'org.apache.cassandra.index.sasi.analyzer.NonTokenizingAnalyzer', 'case_sensitive' : 'false'};
經過一個更多的情景後,問題仍然存在,我想知道爲什麼這種行爲。
這個新的表結構
CREATE TABLE fcs.devicetracking_log (
customerid text,
vehiclesystemid text,
datetime text,
uniqueid text,
logaction int,
logid uuid,
cid int,
altitude double,
angle double,
assignmentname text,
assignmentsystemid text,
cityid text,
cityname text,
citynamear text,
coloronmap text,
departmentid text,
departmentname text,
departmentnamear text,
departmentsystemid text,
device text,
direction double,
drivername text,
drivernamear text,
driversystemid text,
groupofvehicles text,
groupofvehiclesystemid text,
gsm_signal bigint,
id text,
lastcid int,
lastidledate bigint,
lastoverspeednotificationtime bigint,
laststoppeddate bigint,
latitude double,
longitude double,
message_id bigint,
mileage double,
overspeedallowedperiod int,
overspeedmaximumspeed int,
receivingdate bigint,
regionid text,
regionname text,
regionnamear text,
report text,
rtc_datetime bigint,
rtctime bigint,
satellites int,
speed double,
uid text,
valid text,
vehiclename text,
vehiclenamear text,
vehicleplatenumber text,
PRIMARY KEY (customerid, vehiclesystemid, datetime, uniqueid, logaction, logid, cid)
) ;
CREATE CUSTOM INDEX ciddevicetrackinglog ON fcs.devicetracking_log (cid) USING 'org.apache.cassandra.index.sasi.SASIIndex' WITH OPTIONS = {'analyzer_class' : 'org.apache.cassandra.index.sasi.analyzer.NonTokenizingAnalyzer', 'case_sensitive' : 'false'};
CREATE CUSTOM INDEX citydevicetracking_log ON fcs.devicetracking_log (cityid) USING 'org.apache.cassandra.index.sasi.SASIIndex' WITH OPTIONS = {'analyzer_class' : 'org.apache.cassandra.index.sasi.analyzer.NonTokenizingAnalyzer', 'case_sensitive' : 'false'};
CREATE CUSTOM INDEX datetimedevicetrackinglog ON fcs.devicetracking_log (datetime) USING 'org.apache.cassandra.index.sasi.SASIIndex' WITH OPTIONS = {'analyzer_class' : 'org.apache.cassandra.index.sasi.analyzer.NonTokenizingAnalyzer', 'case_sensitive' : 'false'};
CREATE CUSTOM INDEX departmentdevicetracking_log ON fcs.devicetracking_log (departmentid) USING 'org.apache.cassandra.index.sasi.SASIIndex' WITH OPTIONS = {'analyzer_class' : 'org.apache.cassandra.index.sasi.analyzer.NonTokenizingAnalyzer', 'case_sensitive' : 'false'};
CREATE CUSTOM INDEX regiondevicetracking_log ON fcs.devicetracking_log (regionid) USING 'org.apache.cassandra.index.sasi.SASIIndex' WITH OPTIONS = {'analyzer_class' : 'org.apache.cassandra.index.sasi.analyzer.NonTokenizingAnalyzer', 'case_sensitive' : 'false'};
CREATE CUSTOM INDEX speeddevicetracking_log ON fcs.devicetracking_log (speed) USING 'org.apache.cassandra.index.sasi.SASIIndex' WITH OPTIONS = {'analyzer_class' : 'org.apache.cassandra.index.sasi.analyzer.NonTokenizingAnalyzer', 'case_sensitive' : 'false'};
CREATE CUSTOM INDEX vehiclenameardevicetracking_log ON fcs.devicetracking_log (vehiclenamear) USING 'org.apache.cassandra.index.sasi.SASIIndex' WITH OPTIONS = {'analyzer_class' : 'org.apache.cassandra.index.sasi.analyzer.NonTokenizingAnalyzer', 'case_sensitive' : 'false'};
CREATE CUSTOM INDEX vehiclenamedevicetrackinglog ON fcs.devicetracking_log (vehiclename) USING 'org.apache.cassandra.index.sasi.SASIIndex' WITH OPTIONS = {'analyzer_class' : 'org.apache.cassandra.index.sasi.analyzer.NonTokenizingAnalyzer', 'case_sensitive' : 'false'};
CREATE CUSTOM INDEX vehiclesystemiddevicetrackinglog ON fcs.devicetracking_log (vehiclesystemid) USING 'org.apache.cassandra.index.sasi.SASIIndex' WITH OPTIONS = {'analyzer_class' : 'org.apache.cassandra.index.sasi.analyzer.NonTokenizingAnalyzer', 'case_sensitive' : 'false'};
select語句如下。
select * from fcs.devicetracking_log where customerId='179_gov' and regionid='0000015b648d225c-0242ac11000e0001' and dateTime>='1493208398000' allow filtering;
但在使用=
再增加一個條件時,它的工作原理
,也或刪除的情況下regionid它會正常工作
and vehiclesystemid='0000015b64937c79-0242ac1100090001'
任何一個能幫助我嗎? 這是一個生產問題
你的表格結構是什麼? –
@AshrafulIslam我用表結構編輯了這個問題,因爲它太長而不能寫在評論上了。 –
你正在使用哪個cassandra版本? 我已經插入了這個數據INSERT INTO vehicle_information(vehicle_customerid,vehicleid,datetimelong)VALUES('123','32','1493215758000');'並用'select * from vehicle_information查詢where'datetimelong> ='1493215758000'和vehicle_customerid ='123'和vehicleid ='32'ALLOW FILTERING;'返回結果 –