Bug 1105121 - MongoDB: Usage of lookup() function throws an exception
Summary: MongoDB: Usage of lookup() function throws an exception
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: JBoss Data Virtualization 6
Classification: JBoss
Component: Teiid
Version: 6.0.0
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: ER1
: 6.1.0
Assignee: Van Halbert
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-06-05 12:36 UTC by Filip Elias
Modified: 2016-02-10 08:49 UTC (History)
3 users (show)

Fixed In Version:
Clone Of:
Environment:
DV6 + rollup
Last Closed: 2016-02-10 08:49:31 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
Server log with the exception (39.04 KB, text/x-log)
2014-06-05 12:37 UTC, Filip Elias
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker TEIID-2990 0 Major Closed MongoDB: Usage of lookup() function throws an exception 2015-06-22 15:27:43 UTC

Description Filip Elias 2014-06-05 12:36:28 UTC
Exception[1] is thrown when function lookup() is used in SQL query. 

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

[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: {} } ] }

Comment 1 Filip Elias 2014-06-05 12:37:06 UTC
Created attachment 902527 [details]
Server log with the exception

Comment 2 JBoss JIRA Server 2014-06-05 20:13:09 UTC
Ramesh Reddy <rareddy> updated the status of jira TEIID-2990 to Resolved

Comment 3 JBoss JIRA Server 2015-06-22 15:27:44 UTC
Steven Hawkins <shawkins> updated the status of jira TEIID-2990 to Closed


Note You need to log in before you can comment on or make changes to this bug.