[JBoss JIRA] (TEIID-2990) MongoDB: Usage of lookup() function throws an exception
by Filip Elias (JIRA)
Filip Elias created TEIID-2990:
----------------------------------
Summary: 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
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: {} } ] }
--
This message was sent by Atlassian JIRA
(v6.2.3#6260)
10 years, 7 months
[JBoss JIRA] (TEIID-2989) Support odata batching
by Steven Hawkins (JIRA)
Steven Hawkins created TEIID-2989:
-------------------------------------
Summary: Support odata batching
Key: TEIID-2989
URL: https://issues.jboss.org/browse/TEIID-2989
Project: Teiid
Issue Type: Enhancement
Components: OData
Reporter: Steven Hawkins
Assignee: Steven Hawkins
Fix For: 8.8
We nearly have support for OData batching, but the ODataBatchingProvider is registered as a class and not as an instance. Otherwise it appears that a multipart/mixed post to an entity/$batch will allow for batching in OData4j.
--
This message was sent by Atlassian JIRA
(v6.2.3#6260)
10 years, 7 months
[JBoss JIRA] (TEIID-2988) MongoDB: Function substring - starting index and number of arguments
by Filip Elias (JIRA)
Filip Elias created TEIID-2988:
----------------------------------
Summary: MongoDB: Function substring - starting index and number of arguments
Key: TEIID-2988
URL: https://issues.jboss.org/browse/TEIID-2988
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
Two minor bugs in function substring()
Mongo's function $substr takes only 3 arguments so this query fails:
SELECT intkey, SUBSTRING(BQT1.SmallA.stringkey, 1) FROM BQT1.SmallA ORDER BY intkey
Exception:13:18:48,220 ERROR [org.teiid.CONNECTOR] (Worker38_QueryProcessorQueue345) Connector worker process failed for atomic-request=omsmHP0o16Sa.40.0.86: com.mongodb.CommandFailureException: { "serverUsed" : "localhost/127.0.0.1:27017" , "errmsg" : "exception: the $substr operator requires 3 operand(s)" , "code" : 16020 , "ok" : 0.0}
at com.mongodb.CommandResult.getException(CommandResult.java:71)
at com.mongodb.CommandResult.throwOnError(CommandResult.java:110)
at com.mongodb.DBCollection.aggregate(DBCollection.java:1308)
Generated mongo command:
{ aggregate: "smalla", pipeline: [ { $project: { c_0: "$INTKEY", c_1: { $substr: [ "$STRINGKEY", 1 ] } } }, { $sort: { c_0: 1 } } ] }
Mongo's $substr function second argument represents number of bytes to skip, not the starting index. The function substring(StringKey,1,1) returns the second letter, but it should return the first letter.
--
This message was sent by Atlassian JIRA
(v6.2.3#6260)
10 years, 7 months
[JBoss JIRA] (TEIID-2988) MongoDB: Function substring - starting index and number of arguments
by RH Bugzilla Integration (JIRA)
[ https://issues.jboss.org/browse/TEIID-2988?page=com.atlassian.jira.plugin... ]
RH Bugzilla Integration updated TEIID-2988:
-------------------------------------------
Bugzilla Update: Perform
Bugzilla References: https://bugzilla.redhat.com/show_bug.cgi?id=1105101
> MongoDB: Function substring - starting index and number of arguments
> --------------------------------------------------------------------
>
> Key: TEIID-2988
> URL: https://issues.jboss.org/browse/TEIID-2988
> 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
>
>
> Two minor bugs in function substring()
> Mongo's function $substr takes only 3 arguments so this query fails:
> SELECT intkey, SUBSTRING(BQT1.SmallA.stringkey, 1) FROM BQT1.SmallA ORDER BY intkey
> Exception:13:18:48,220 ERROR [org.teiid.CONNECTOR] (Worker38_QueryProcessorQueue345) Connector worker process failed for atomic-request=omsmHP0o16Sa.40.0.86: com.mongodb.CommandFailureException: { "serverUsed" : "localhost/127.0.0.1:27017" , "errmsg" : "exception: the $substr operator requires 3 operand(s)" , "code" : 16020 , "ok" : 0.0}
> at com.mongodb.CommandResult.getException(CommandResult.java:71)
> at com.mongodb.CommandResult.throwOnError(CommandResult.java:110)
> at com.mongodb.DBCollection.aggregate(DBCollection.java:1308)
> Generated mongo command:
> { aggregate: "smalla", pipeline: [ { $project: { c_0: "$INTKEY", c_1: { $substr: [ "$STRINGKEY", 1 ] } } }, { $sort: { c_0: 1 } } ] }
> Mongo's $substr function second argument represents number of bytes to skip, not the starting index. The function substring(StringKey,1,1) returns the second letter, but it should return the first letter.
--
This message was sent by Atlassian JIRA
(v6.2.3#6260)
10 years, 7 months
[JBoss JIRA] (TEIID-2987) MongoDB: No rows are returned when a function is used in a where clause
by Ramesh Reddy (JIRA)
[ https://issues.jboss.org/browse/TEIID-2987?page=com.atlassian.jira.plugin... ]
Ramesh Reddy updated TEIID-2987:
--------------------------------
Fix Version/s: 8.7.1
8.8
> MongoDB: No rows are returned when a function is used in a where clause
> -----------------------------------------------------------------------
>
> Key: TEIID-2987
> URL: https://issues.jboss.org/browse/TEIID-2987
> Project: Teiid
> Issue Type: Bug
> Components: Misc. Connectors
> Affects Versions: 8.4.1
> Environment: Teiid 8.4.1
> Reporter: Filip Elias
> Assignee: Ramesh Reddy
> Fix For: 8.7.1, 8.8
>
>
> Teiid will return no rows when a function which is pushed down is used in a where clause.
> These queries should return few rows, but the result is empty:
> Query:
> SELECT intkey, stringnum FROM BQT1.SmallA WHERE concat(stringkey, stringnum) = '7-17' ORDER BY intkey
> Generated mongo command:
> {aggregate: "smalla", pipeline: [ { $match: { _m0: "7-17" } }, { $project: { c_0: "$INTKEY", c_1: "$STRINGNUM" } }, { $sort: { c_0: 1 } } ] }
> Query:
> select intKey from bqt1.smalla where intKey+intKey >20
> Generated mongo command:
> {aggregate: "smalla", pipeline: [ { $match: { _m0: { $gt: 20 } } }, { $project: { _m1: "$INTKEY" } } ] }
--
This message was sent by Atlassian JIRA
(v6.2.3#6260)
10 years, 7 months
[JBoss JIRA] (TEIID-2987) MongoDB: No rows are returned when a function is used in a where clause
by RH Bugzilla Integration (JIRA)
[ https://issues.jboss.org/browse/TEIID-2987?page=com.atlassian.jira.plugin... ]
RH Bugzilla Integration updated TEIID-2987:
-------------------------------------------
Bugzilla Update: Perform
Bugzilla References: https://bugzilla.redhat.com/show_bug.cgi?id=1105087
> MongoDB: No rows are returned when a function is used in a where clause
> -----------------------------------------------------------------------
>
> Key: TEIID-2987
> URL: https://issues.jboss.org/browse/TEIID-2987
> Project: Teiid
> Issue Type: Bug
> Components: Misc. Connectors
> Affects Versions: 8.4.1
> Environment: Teiid 8.4.1
> Reporter: Filip Elias
> Assignee: Ramesh Reddy
>
> Teiid will return no rows when a function which is pushed down is used in a where clause.
> These queries should return few rows, but the result is empty:
> Query:
> SELECT intkey, stringnum FROM BQT1.SmallA WHERE concat(stringkey, stringnum) = '7-17' ORDER BY intkey
> Generated mongo command:
> {aggregate: "smalla", pipeline: [ { $match: { _m0: "7-17" } }, { $project: { c_0: "$INTKEY", c_1: "$STRINGNUM" } }, { $sort: { c_0: 1 } } ] }
> Query:
> select intKey from bqt1.smalla where intKey+intKey >20
> Generated mongo command:
> {aggregate: "smalla", pipeline: [ { $match: { _m0: { $gt: 20 } } }, { $project: { _m1: "$INTKEY" } } ] }
--
This message was sent by Atlassian JIRA
(v6.2.3#6260)
10 years, 7 months
[JBoss JIRA] (TEIID-2983) MongoDB: Function "count()" returns sum instead of number of rows
by Ramesh Reddy (JIRA)
[ https://issues.jboss.org/browse/TEIID-2983?page=com.atlassian.jira.plugin... ]
Ramesh Reddy commented on TEIID-2983:
-------------------------------------
Is there a way re-write multiple aggregate statement above? right now I can only think that that needs to split into two statements.
MongoDB can group by multiple elements in a group, then we can do a sum like
{code}
{$group:{ "_id" : {col1:"foo", col2:"foo2"} , "_m0" : { "$sum" : 1}}}
{code}
but not sure the it equals to
select count(foo1), count(foo2) from bar
Right now I set to ignore the second aggregation on hind sight, but may be I can throw an exception in that case to show translator does not have support. I probably should also support DISTINCT case there.
> MongoDB: Function "count()" returns sum instead of number of rows
> -----------------------------------------------------------------
>
> Key: TEIID-2983
> URL: https://issues.jboss.org/browse/TEIID-2983
> Project: Teiid
> Issue Type: Bug
> Components: Misc. Connectors
> Affects Versions: 8.7.1
> Reporter: Van Halbert
> Assignee: Ramesh Reddy
> Labels: Beta1
> Fix For: 8.7.1, 8.8
>
>
> Function "count()" returns sum of rows instead of number of rows
> Query [1] returns sum of values of all rows of IntKey column.
> Query [2] correctly returns number of rows
>
> [1] SELECT COUNT(IntKey) FROM BQT1.SmallA
> [2] SELECT COUNT(*) FROM BQT1.SmallA
--
This message was sent by Atlassian JIRA
(v6.2.3#6260)
10 years, 7 months
[JBoss JIRA] (TEIID-2987) MongoDB: No rows are returned when a function is used in a where clause
by Filip Elias (JIRA)
Filip Elias created TEIID-2987:
----------------------------------
Summary: MongoDB: No rows are returned when a function is used in a where clause
Key: TEIID-2987
URL: https://issues.jboss.org/browse/TEIID-2987
Project: Teiid
Issue Type: Bug
Components: Misc. Connectors
Affects Versions: 8.4.1
Environment: Teiid 8.4.1
Reporter: Filip Elias
Assignee: Ramesh Reddy
Teiid will return no rows when a function which is pushed down is used in a where clause.
These queries should return few rows, but the result is empty:
Query:
SELECT intkey, stringnum FROM BQT1.SmallA WHERE concat(stringkey, stringnum) = '7-17' ORDER BY intkey
Generated mongo command:
{aggregate: "smalla", pipeline: [ { $match: { _m0: "7-17" } }, { $project: { c_0: "$INTKEY", c_1: "$STRINGNUM" } }, { $sort: { c_0: 1 } } ] }
Query:
select intKey from bqt1.smalla where intKey+intKey >20
Generated mongo command:
{aggregate: "smalla", pipeline: [ { $match: { _m0: { $gt: 20 } } }, { $project: { _m1: "$INTKEY" } } ] }
--
This message was sent by Atlassian JIRA
(v6.2.3#6260)
10 years, 7 months
[JBoss JIRA] (TEIID-2983) MongoDB: Function "count()" returns sum instead of number of rows
by Steven Hawkins (JIRA)
[ https://issues.jboss.org/browse/TEIID-2983?page=com.atlassian.jira.plugin... ]
Steven Hawkins commented on TEIID-2983:
---------------------------------------
Or even just:
select count(foo1), count(foo2) from bar
If they both contribute to the where clause the counts can be incorrect.
> Can suggest what may be better?
It seems like only count\(*) is supported and not count in general.
> MongoDB: Function "count()" returns sum instead of number of rows
> -----------------------------------------------------------------
>
> Key: TEIID-2983
> URL: https://issues.jboss.org/browse/TEIID-2983
> Project: Teiid
> Issue Type: Bug
> Components: Misc. Connectors
> Affects Versions: 8.7.1
> Reporter: Van Halbert
> Assignee: Ramesh Reddy
> Labels: Beta1
> Fix For: 8.7.1, 8.8
>
>
> Function "count()" returns sum of rows instead of number of rows
> Query [1] returns sum of values of all rows of IntKey column.
> Query [2] correctly returns number of rows
>
> [1] SELECT COUNT(IntKey) FROM BQT1.SmallA
> [2] SELECT COUNT(*) FROM BQT1.SmallA
--
This message was sent by Atlassian JIRA
(v6.2.3#6260)
10 years, 7 months
[JBoss JIRA] (TEIID-2983) MongoDB: Function "count()" returns sum instead of number of rows
by Ramesh Reddy (JIRA)
[ https://issues.jboss.org/browse/TEIID-2983?page=com.atlassian.jira.plugin... ]
Ramesh Reddy commented on TEIID-2983:
-------------------------------------
[~shawkins] More then single aggregate you mean like
{code}
select count(foo1), avg(foo2) from bar
{code}
Can suggest what may be better?
> MongoDB: Function "count()" returns sum instead of number of rows
> -----------------------------------------------------------------
>
> Key: TEIID-2983
> URL: https://issues.jboss.org/browse/TEIID-2983
> Project: Teiid
> Issue Type: Bug
> Components: Misc. Connectors
> Affects Versions: 8.7.1
> Reporter: Van Halbert
> Assignee: Ramesh Reddy
> Labels: Beta1
> Fix For: 8.7.1, 8.8
>
>
> Function "count()" returns sum of rows instead of number of rows
> Query [1] returns sum of values of all rows of IntKey column.
> Query [2] correctly returns number of rows
>
> [1] SELECT COUNT(IntKey) FROM BQT1.SmallA
> [2] SELECT COUNT(*) FROM BQT1.SmallA
--
This message was sent by Atlassian JIRA
(v6.2.3#6260)
10 years, 7 months