[teiid-issues] [JBoss JIRA] (TEIID-3316) MongoDB: Getting "unrecognized field \"cursor" when connecting to MongoDB using Teiid 8.9.1

Ivan Chan (JIRA) issues at jboss.org
Wed Feb 18 19:58:49 EST 2015


    [ https://issues.jboss.org/browse/TEIID-3316?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13041645#comment-13041645 ] 

Ivan Chan commented on TEIID-3316:
----------------------------------

I think the issue is Teiid with MongoDB version 2.4.8.   It works with MongoDB version 2.6.6.

Update:  I have tried to do a simple test without nested/ array JSON document with Teiid 8.10 CR1 against MongoDB version 2.4.8.  But it still doesn't work with different exception:

Caused by: java.lang.NullPointerException
        at org.teiid.translator.mongodb.MongoDBQueryExecution.close(MongoDBQueryExecution.java:144)
        at org.teiid.translator.mongodb.MongoDBQueryExecution.cancel(MongoDBQueryExecution.java:150)
        at org.teiid.dqp.internal.datamgr.ConnectorWorkItem.cancel(ConnectorWorkItem.java:191)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:601)
        at org.teiid.dqp.internal.datamgr.ConnectorManager$1.invoke(ConnectorManager.java:209)
        at $Proxy183.cancel(Unknown Source)
        at org.teiid.dqp.internal.process.DataTierTupleSource.fullyCloseSource(DataTierTupleSource.java:323)
        at org.teiid.dqp.internal.process.DataTierTupleSource.exceptionOccurred(DataTierTupleSource.java:378)
        at org.teiid.dqp.internal.process.DataTierTupleSource.nextTuple(DataTierTupleSource.java:154)
        at org.teiid.query.processor.relational.AccessNode.nextBatchDirect(AccessNode.java:369)
        at org.teiid.query.processor.relational.RelationalNode.nextBatch(RelationalNode.java:278)
        at org.teiid.query.processor.relational.RelationalPlan.nextBatch(RelationalPlan.java:145)
        at org.teiid.query.processor.QueryProcessor.nextBatchDirect(QueryProcessor.java:151)
        at org.teiid.query.processor.QueryProcessor.nextBatch(QueryProcessor.java:114)
        at org.teiid.query.processor.BatchCollector.collectTuples(BatchCollector.java:164)

JSON Data:

{ "_id": { "$oid" : "52d7945f4acacbbae9c86304" }, 
"id": "fDxEleBZwLDLmIQH", 
"store_sales": 7.44, 
"product_category": "Jams and Jellies", 
"product_department": "Baking Goods", 
"product_family": "Food", 
"product_subcategory": "Jam", 
"store_city": "Los Angeles", 
"store_cost": 2.976, 
"store_country": "USA", 
"store_state": "CA", 
"the_date": "09/09/2012 0:00 -07:00", 
"unit_sales": 4 }

Schema:

CREATE FOREIGN TABLE sales (
    saleID integer PRIMARY KEY,
    product_category varchar(255),
    product_family varchar(255),
    store_city varchar(255))
OPTIONS(UPDATABLE 'TRUE');

SQL:

select "store_city" from "MongoDB_26"."sales" limit 1000 

However, everything works fine if I run against with MongoDB version 2.6.6

> MongoDB:  Getting "unrecognized field \"cursor" when connecting to MongoDB using Teiid 8.9.1
> --------------------------------------------------------------------------------------------
>
>                 Key: TEIID-3316
>                 URL: https://issues.jboss.org/browse/TEIID-3316
>             Project: Teiid
>          Issue Type: Bug
>          Components: Misc. Connectors
>    Affects Versions: 8.9.1
>         Environment: Teiid 8.9.1 with MongoDB shell version: 2.4.8 using MongoDB Driver mongo-java-driver-2.12.3.jar
>            Reporter: Ivan Chan
>            Assignee: Ramesh Reddy
>             Fix For: 8.10
>
>
> I am getting the following erroe when connecting to MongoDB using Teiid 8.9.1: 
> Caused by: com.mongodb.CommandFailureException: { "serverUsed" : "donetsk:27017" , "ok" : 0.0 , "errmsg" : "unrecognized field \"cursor"}
>         at com.mongodb.CommandResult.getException(CommandResult.java:76)
>         at com.mongodb.CommandResult.throwOnError(CommandResult.java:131)
>         at com.mongodb.DBCollectionImpl.aggregate(DBCollectionImpl.java:100)
>         at com.mongodb.DBCollection.aggregate(DBCollection.java:1571)
>         at org.teiid.translator.mongodb.MongoDBQueryExecution.execute(MongoDBQueryExecution.java:111)



--
This message was sent by Atlassian JIRA
(v6.3.11#6341)


More information about the teiid-issues mailing list