Tested on Aqua Data Studio 14.0-alpha-18 Build #: 32464 on Ubuntu 12.04( Mongo DB 2.4.3) and Windows XP ( Mongo DB 2.0.9).
IN clause with expressions( e.g. SELECT valuation FROM baseball WHERE valuation IN(1+1,9+1) gives "Can't serialize class" exception. In turn next command in Mongo shell works correct: db.baseball.find({valuation: {$in:[1+1,9+1]},{baseball:1}). See attached screenshot.
|
138 KB
Under MongoShell, those math expressions are evaluated by the Javascript before sending the query to MongoDB Server (i.e. the server actually receives the db.baseball.find({valuation: {$in:[2, 10]})
query).
Math expressions are supported by MongoSQL on WHERE filters only if there is a $where equivalent for that query. For this case, it is not possible to use the $where operator.
Supporting such queries would require implementing the math operation (i.e. perform the addition etc) on the JDBC driver. I can only improve the error message thrown for this scenario.
The IN operator now returns a proper error message. However, NOT IN still returns the "can't serialize class" error message (MongoExpressionBuilder.java line 300).
select * from aTbl where a IN (1+1, 2+1) go >[Error] Script lines: 1-2 -------------------------- Arithmetic operations not supported under the 'IN' operator. select * from aTbl where a NOT IN (1+1, 2+1) go >[Error] Script lines: 3-4 -------------------------- Can't serialize class com.aquafold.library.common.parsers.unsql.BinaryMathExpression
The IN operator now returns a proper error message. However, NOT IN still returns the "can't serialize class" error message (MongoExpressionBuilder.java line 300).
select * from aTbl where a IN (1+1, 2+1) go >[Error] Script lines: 1-2 -------------------------- Arithmetic operations not supported under the 'IN' operator. select * from aTbl where a NOT IN (1+1, 2+1) go >[Error] Script lines: 3-4 -------------------------- Can't serialize class com.aquafold.library.common.parsers.unsql.BinaryMathExpression
Verified in Aqua Data Studio Aqua Data Studio 14.0.0-beta-68 Build #: 33238 on Ubuntu 12.04( Mongo DB 2.4.3) and Windows XP ( Mongo DB 2.0.9).
Verified in Aqua Data Studio Aqua Data Studio 14.0.0-beta-68 Build #: 33238 on Ubuntu 12.04( Mongo DB 2.4.3) and Windows XP ( Mongo DB 2.0.9).
Issue #9025 |
Closed |
Fixed |
Resolved |
Completion |
No due date |
Fixed Build ADS 14.0.0-beta-68 (mongo-jdbc 1.2.5) |
No time estimate |
Under MongoShell, those math expressions are evaluated by the Javascript before sending the query to MongoDB Server (i.e. the server actually receives the
db.baseball.find({valuation: {$in:[2, 10]})
query).Math expressions are supported by MongoSQL on WHERE filters only if there is a $where equivalent for that query. For this case, it is not possible to use the $where operator.
Supporting such queries would require implementing the math operation (i.e. perform the addition etc) on the JDBC driver. I can only improve the error message thrown for this scenario.