Details
-
Bug
-
Status: Open
-
Major
-
Resolution: Unresolved
-
None
-
None
-
None
Description
Mongo adapter fails on query
select state, city from zips where city='MANSFIELD' and state in ('AR', 'TX', 'MA') order by state
with
java.lang.AssertionError: cannot translate OR(=(CAST(ITEM($0, 'state')):VARCHAR(2) CHARACTER SET "ISO-8859-1" COLLATE "ISO-8859-1$en_US$primary", 'AR'), =(CAST(ITEM($0, 'state')):VARCHAR(2) CHARACTER SET "ISO-8859-1" COLLATE "ISO-8859-1$en_US$primary", 'TX'), =(CAST(ITEM($0, 'state')):VARCHAR(2) CHARACTER SET "ISO-8859-1" COLLATE "ISO-8859-1$en_US$primary", 'MA')) at org.apache.calcite.adapter.mongodb.MongoFilter$Translator.translateMatch2(MongoFilter.java:181) at org.apache.calcite.adapter.mongodb.MongoFilter$Translator.translateAnd(MongoFilter.java:116) at org.apache.calcite.adapter.mongodb.MongoFilter$Translator.translateOr(MongoFilter.java:98) at org.apache.calcite.adapter.mongodb.MongoFilter$Translator.translateMatch(MongoFilter.java:91)
literal case like
select state, city from zips where city='MANSFIELD' and 1=0 order by state
fails with
java.lang.AssertionError: cannot translate op null call =(1, 0)
at org.apache.calcite.adapter.mongodb.MongoFilter$Translator.translateBinary(MongoFilter.java:198)
at org.apache.calcite.adapter.mongodb.MongoFilter$Translator.translateMatch2(MongoFilter.java:169)
at org.apache.calcite.adapter.mongodb.MongoFilter$Translator.translateAnd(MongoFilter.java:116)
at org.apache.calcite.adapter.mongodb.MongoFilter$Translator.translateOr(MongoFilter.java:98)
at org.apache.calcite.adapter.mongodb.MongoFilter$Translator.translateMatch(MongoFilter.java:91)
Attachments
Issue Links
- is related to
-
CALCITE-270 Generate complex conditions against MongoDB
- Open
- relates to
-
CALCITE-2331 Evaluation of predicate "(A or B) and C" fails for Elasticsearch adapter
- Closed