我试图用>=
操作检索表中的文本数据,但是,没有检索虽然试图用=
它成功返回卡桑德拉大于“>”问题卡桑德拉
这是查询的样本
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;'返回结果 –