[teiid-issues] [JBoss JIRA] (TEIID-2990) MongoDB: Usage of lookup() function throws an exception

Ramesh Reddy (JIRA) issues at jboss.org
Thu Jun 5 12:02:15 EDT 2014


     [ https://issues.jboss.org/browse/TEIID-2990?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Ramesh Reddy updated TEIID-2990:
--------------------------------

    Description: 
Exception[1] is thrown when function lookup() is used in SQL query. 

Mongo translator doesn't support selection of constants only, which causes the exception(select 1, select 'hi' from smalla).

{code}
[1]  3:59:20,997 ERROR [org.teiid.CONNECTOR] (Worker5_QueryProcessorQueue6) Connector worker process failed for atomic-request=Ef2Z7E0246by.1.5.3: com.mongodb.CommandFailureException: { "serverUsed" : "localhost/127.0.0.1:27017" , "errmsg" : "exception: $projection requires at least one output field" , "code" : 16403 , "ok" : 0.0}
	at com.mongodb.CommandResult.getException(CommandResult.java:71)
{code}

Server log is in the attachment.

Sample query:
{code}
SELECT BQT1.SmallA.IntKey FROM BQT1.SmallA, BQT1.SmallB WHERE BQT1.SmallA.IntKey= lookup('BQT1.SmallB', 'IntKey', 'StringKey', BQT1.SmallA.StringKey) ORDER BY IntKey
{code}
Generated mongo commands:

{code}
{ aggregate: "smalla", pipeline: [ { $project: { _m0: "$INTKEY", _m1: "$STRINGKEY" } } ] }
{code}
and 
{code}
{ aggregate: "smallb", pipeline: [ { $project: {} } ] }
{code}



  was:
Exception[1] is thrown when function lookup() is used in SQL query. 

Mongo translator doesn't support selection of constants only, which causes the exception(select 1, select 'hi' from smalla).

[1]  3:59:20,997 ERROR [org.teiid.CONNECTOR] (Worker5_QueryProcessorQueue6) Connector worker process failed for atomic-request=Ef2Z7E0246by.1.5.3: com.mongodb.CommandFailureException: { "serverUsed" : "localhost/127.0.0.1:27017" , "errmsg" : "exception: $projection requires at least one output field" , "code" : 16403 , "ok" : 0.0}
	at com.mongodb.CommandResult.getException(CommandResult.java:71)

Server log is in the attachment.

Sample query:
SELECT BQT1.SmallA.IntKey FROM BQT1.SmallA, BQT1.SmallB WHERE BQT1.SmallA.IntKey= lookup('BQT1.SmallB', 'IntKey', 'StringKey', BQT1.SmallA.StringKey) ORDER BY IntKey

Generated mongo commands:

{ aggregate: "smalla", pipeline: [ { $project: { _m0: "$INTKEY", _m1: "$STRINGKEY" } } ] }

and 

{ aggregate: "smallb", pipeline: [ { $project: {} } ] }






> MongoDB: Usage of lookup() function throws an exception
> -------------------------------------------------------
>
>                 Key: TEIID-2990
>                 URL: https://issues.jboss.org/browse/TEIID-2990
>             Project: Teiid
>          Issue Type: Bug
>          Components: Misc. Connectors
>    Affects Versions: 8.4.1
>            Reporter: Filip Elias
>            Assignee: Ramesh Reddy
>             Fix For: 8.7.1, 8.8
>
>         Attachments: server.log
>
>
> Exception[1] is thrown when function lookup() is used in SQL query. 
> Mongo translator doesn't support selection of constants only, which causes the exception(select 1, select 'hi' from smalla).
> {code}
> [1]  3:59:20,997 ERROR [org.teiid.CONNECTOR] (Worker5_QueryProcessorQueue6) Connector worker process failed for atomic-request=Ef2Z7E0246by.1.5.3: com.mongodb.CommandFailureException: { "serverUsed" : "localhost/127.0.0.1:27017" , "errmsg" : "exception: $projection requires at least one output field" , "code" : 16403 , "ok" : 0.0}
> 	at com.mongodb.CommandResult.getException(CommandResult.java:71)
> {code}
> Server log is in the attachment.
> Sample query:
> {code}
> SELECT BQT1.SmallA.IntKey FROM BQT1.SmallA, BQT1.SmallB WHERE BQT1.SmallA.IntKey= lookup('BQT1.SmallB', 'IntKey', 'StringKey', BQT1.SmallA.StringKey) ORDER BY IntKey
> {code}
> Generated mongo commands:
> {code}
> { aggregate: "smalla", pipeline: [ { $project: { _m0: "$INTKEY", _m1: "$STRINGKEY" } } ] }
> {code}
> and 
> {code}
> { aggregate: "smallb", pipeline: [ { $project: {} } ] }
> {code}



--
This message was sent by Atlassian JIRA
(v6.2.3#6260)


More information about the teiid-issues mailing list