[ 
https://issues.apache.org/jira/browse/CALCITE-194?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16505158#comment-16505158
 ] 

Volodymyr Vysotskyi commented on CALCITE-194:
---------------------------------------------

[~ikryvenko], with these changes, MongoAdapterIT tests fail:
{noformat}
[INFO] Results:
[INFO] 
[ERROR] Errors: 
[ERROR]   MongoAdapterIT.testFilterPair:732->checkPredicate:755 » Runtime 
exception whil...
[ERROR]   MongoAdapterIT.testFilterRedundant:315 » Runtime exception while 
executing [se...
[ERROR]   MongoAdapterIT.testFilterSort:231 » Runtime exception while executing 
[select ...
[ERROR]   MongoAdapterIT.testFilterSortDesc:264 » Runtime exception while 
executing [sel...
[ERROR]   MongoAdapterIT.testSort:172 » Runtime exception while executing 
[select * from...
[INFO] 
[ERROR] Tests run: 32, Failures: 0, Errors: 5, Skipped: 6
{noformat}
Stack trace for one of the failures:
{noformat}
[ERROR] testFilterSort(org.apache.calcite.test.MongoAdapterIT)  Time elapsed: 
2.732 s  <<< ERROR!
java.lang.RuntimeException: 
exception while executing [select * from zips
where city = 'SPRINGFIELD' and id >= '70000'
order by state, id]
        at 
org.apache.calcite.test.MongoAdapterIT.testFilterSort(MongoAdapterIT.java:231)
Caused by: java.lang.RuntimeException: With materializationsEnabled=false, 
limit=0
        at 
org.apache.calcite.test.MongoAdapterIT.testFilterSort(MongoAdapterIT.java:231)
Caused by: java.sql.SQLException: 
Error while executing SQL "select * from zips
where city = 'SPRINGFIELD' and id >= '70000'
order by state, id": While running MongoDB query [{
  "$match": {
    "city": "SPRINGFIELD",
    "_id": {
      "$gte": "70000"
    }
  }
},
{$project: {CITY: '$city', LONGITUDE: { $arrayElemAt: [ '$loc', 0 ] }, 
LATITUDE: { $arrayElemAt: [ '$loc', 1 ] }, POP: '$pop', STATE: '$state', ID: 
'$_id'}},
{$sort: {STATE: 1, ID: 1}}]
        at 
org.apache.calcite.test.MongoAdapterIT.testFilterSort(MongoAdapterIT.java:231)
Caused by: java.lang.RuntimeException: 
While running MongoDB query [{
  "$match": {
    "city": "SPRINGFIELD",
    "_id": {
      "$gte": "70000"
    }
  }
},
{$project: {CITY: '$city', LONGITUDE: { $arrayElemAt: [ '$loc', 0 ] }, 
LATITUDE: { $arrayElemAt: [ '$loc', 1 ] }, POP: '$pop', STATE: '$state', ID: 
'$_id'}},
{$sort: {STATE: 1, ID: 1}}]
        at 
org.apache.calcite.test.MongoAdapterIT.testFilterSort(MongoAdapterIT.java:231)
Caused by: com.mongodb.MongoCommandException: Command failed with error 15999: 
'exception: invalid operator '$arrayElemAt'' on server localhost:27017. The 
full response is { "errmsg" : "exception: invalid operator '$arrayElemAt'", 
"code" : 15999, "ok" : 0.0 }
        at 
org.apache.calcite.test.MongoAdapterIT.testFilterSort(MongoAdapterIT.java:231)
{noformat}

> Array items in MongoDB adapter
> ------------------------------
>
>                 Key: CALCITE-194
>                 URL: https://issues.apache.org/jira/browse/CALCITE-194
>             Project: Calcite
>          Issue Type: Bug
>            Reporter: GitHub Import
>            Assignee: Igor Kryvenko
>            Priority: Major
>              Labels: github-import
>             Fix For: 1.17.0
>
>
> When MongoDB issue <a 
> href="https://jira.mongodb.org/browse/SERVER-4589";>SERVER-4589</a>, 
> "aggregation: need an array indexing operator" is fixed, we will be able to 
> implement
> ```sql
> SELECT loc[0] AS longitude, loc[1] AS latitude FROM zips
> ```
> in the MongoDB adapter. Meantime, look for `Bug.OPTIQnnn_FIXED` in the code.
> ---------------- Imported from GitHub ----------------
> Url: https://github.com/julianhyde/optiq/issues/194
> Created by: [julianhyde|https://github.com/julianhyde]
> Labels: bug, 
> Created at: Wed Mar 19 00:03:01 CET 2014
> State: open



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to