SELECT
*
FROM ALARM_HISTORY
WHERE DOMAIN IN ('BAREMETAL','CLOUD','CORE','FIBER','INFRA','PLATFORM','RAN','SECURITY','TRANSPORT')
AND ((actual_severity = 'MAJOR') AND (technology = 'LTE'))
ALLOW FILTERING;
When I am executing this query on cassandra getting error
SyntaxException: line 1:162 mismatched input ‘AND’ expecting ‘)’ (… ((actual_severity = ‘MAJOR’) [AND]…)
but when I am executing by removing the parentheses
SELECT
*
FROM ALARM_HISTORY
WHERE DOMAIN IN ('BAREMETAL','CLOUD','CORE','FIBER','INFRA','PLATFORM','RAN','SECURITY','TRANSPORT')
AND actual_severity = 'MAJOR'
AND technology = 'LTE'
ALLOW FILTERING;
it is successfully executed and returning the result
why this is happening..? , logically the query is same and should run both query.
if i am wrong at any point then plz correct me,i am new to cassandra.
Shantilal Barde is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
CQL is does not support parentheses in the same way that SQL does.
Sure, in SQL that first statement might be valid. But in CQL, parentheses are only valid in specific instances, like when using the IN
operator or calling a function. But simply adding them around items in the WHERE
clause will cause the CQL parser to throw the error shown above.