[JBoss JIRA] (TEIID-2725) Group by doesn't work with MongoDB
by Ramesh Reddy (JIRA)
[ https://issues.jboss.org/browse/TEIID-2725?page=com.atlassian.jira.plugin... ]
Ramesh Reddy resolved TEIID-2725.
---------------------------------
Labels: Beta1 (was: teiid)
Resolution: Done
The MongDB expression needs to be
{code}
$group:{ "_id" : "$grade" , "c_1" : { "$sum" : "$score"}}
$project: { "c_0" : "$_id" , "c_1" : 1}
$sort: { "c_0" : 1}
{code}
Correct the translator code to produce above query. Added a unit test
> Group by doesn't work with MongoDB
> ----------------------------------
>
> Key: TEIID-2725
> URL: https://issues.jboss.org/browse/TEIID-2725
> Project: Teiid
> Issue Type: Bug
> Components: Query Engine
> Affects Versions: 8.6
> Environment: Teiid with MongoDB
> Reporter: Ivan Chan
> Assignee: Ramesh Reddy
> Labels: Beta1
> Fix For: 8.6
>
>
> Group by SQL with/ without aggregate function returns incorrect values:
> For example:
> Original SQL:
> select "grade", sum("score") as "sum_score" from "mongoDBDS"."grades" group by "grade" order by "grade"
>
> Transform query:
> SELECT grades.grade AS c_0, SUM(grades.score) AS c_1 FROM grades GROUP BY grades.grade ORDER BY c_0
> $group:{ "_id" : "$grade" , "c_1" : { "$sum" : "$score"}}
> $project:{ "c_0" : "$grade" , "c_1" : 1}
> $sort:{ "c_0" : 1}
> Expected Result:
> grade score
> A 187
> F 55
> Actual Result: (INCORRECT)
> grade score
> 242
> It only returns SUM(score) and group by fields are ignore.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
11 years, 4 months
[JBoss JIRA] (TEIID-2725) Group by doesn't work with MongoDB
by Ramesh Reddy (JIRA)
[ https://issues.jboss.org/browse/TEIID-2725?page=com.atlassian.jira.plugin... ]
Ramesh Reddy edited comment on TEIID-2725 at 11/4/13 9:17 AM:
--------------------------------------------------------------
The MongoDB expression needs to be
{code}
$group:{ "_id" : "$grade" , "c_1" : { "$sum" : "$score"}}
$project: { "c_0" : "$_id" , "c_1" : 1}
$sort: { "c_0" : 1}
{code}
Correct the translator code to produce above query. Added a unit test
was (Author: rareddy):
The MongDB expression needs to be
{code}
$group:{ "_id" : "$grade" , "c_1" : { "$sum" : "$score"}}
$project: { "c_0" : "$_id" , "c_1" : 1}
$sort: { "c_0" : 1}
{code}
Correct the translator code to produce above query. Added a unit test
> Group by doesn't work with MongoDB
> ----------------------------------
>
> Key: TEIID-2725
> URL: https://issues.jboss.org/browse/TEIID-2725
> Project: Teiid
> Issue Type: Bug
> Components: Query Engine
> Affects Versions: 8.6
> Environment: Teiid with MongoDB
> Reporter: Ivan Chan
> Assignee: Ramesh Reddy
> Labels: Beta1
> Fix For: 8.6
>
>
> Group by SQL with/ without aggregate function returns incorrect values:
> For example:
> Original SQL:
> select "grade", sum("score") as "sum_score" from "mongoDBDS"."grades" group by "grade" order by "grade"
>
> Transform query:
> SELECT grades.grade AS c_0, SUM(grades.score) AS c_1 FROM grades GROUP BY grades.grade ORDER BY c_0
> $group:{ "_id" : "$grade" , "c_1" : { "$sum" : "$score"}}
> $project:{ "c_0" : "$grade" , "c_1" : 1}
> $sort:{ "c_0" : 1}
> Expected Result:
> grade score
> A 187
> F 55
> Actual Result: (INCORRECT)
> grade score
> 242
> It only returns SUM(score) and group by fields are ignore.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
11 years, 4 months
[JBoss JIRA] (TEIID-2722) Cassandra: ORDER BY should do it in memory instead of trying to push down Cassandra in some cases
by Ramesh Reddy (JIRA)
[ https://issues.jboss.org/browse/TEIID-2722?page=com.atlassian.jira.plugin... ]
Ramesh Reddy updated TEIID-2722:
--------------------------------
Fix Version/s: 8.6
Assignee: Ramesh Reddy (was: Steven Hawkins)
> Cassandra: ORDER BY should do it in memory instead of trying to push down Cassandra in some cases
> --------------------------------------------------------------------------------------------------
>
> Key: TEIID-2722
> URL: https://issues.jboss.org/browse/TEIID-2722
> Project: Teiid
> Issue Type: Bug
> Components: Query Engine
> Affects Versions: 8.6
> Environment: Teiid 8.6 Alpha with Cassandra 1.2.11
> Reporter: Ivan Chan
> Assignee: Ramesh Reddy
> Labels: teiid
> Fix For: 8.6
>
>
> When I tried to join 2 tables together from same keyspace using Teiid 8.6 Alpha with Cassandra 1.2.11. It broke down SQL into 2 CQLs. However, teiid SQL transformer adds order by clause to the CQL which is not supported.
> Original SQL:
> select "cassandraDS_users"."user_id" as "cassandraDS_users_user_id",
> "cassandraDS_invoice"."sale" as "cassandraDS_invoice_sale"
> from "cassandraDS"."invoice" "cassandraDS_invoice"
> inner join "cassandraDS"."users" "cassandraDS_users" on ("cassandraDS_invoice"."user_id" = "cassandraDS_users"."user_id")
> Break Down CQL:
> SELECT cassandraDS.invoice.user_id, cassandraDS.invoice.sale FROM cassandraDS.i
> nvoice ORDER BY cassandraDS.invoice.user_id
> SELECT cassandraDS.users.user_id FROM cassandraDS.users ORDER BY cassandraDS.us
> ers.user_id
> Error from CQL Driver:
> com.datastax.driver.core.exceptions.InvalidQueryException: ORDER BY is only supported when the partition key is restricted by an EQ or an IN.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
11 years, 4 months
[JBoss JIRA] (TEIID-2725) Group by doesn't work with MongoDB
by Ramesh Reddy (JIRA)
[ https://issues.jboss.org/browse/TEIID-2725?page=com.atlassian.jira.plugin... ]
Ramesh Reddy updated TEIID-2725:
--------------------------------
Fix Version/s: 8.6
> Group by doesn't work with MongoDB
> ----------------------------------
>
> Key: TEIID-2725
> URL: https://issues.jboss.org/browse/TEIID-2725
> Project: Teiid
> Issue Type: Bug
> Components: Query Engine
> Affects Versions: 8.6
> Environment: Teiid with MongoDB
> Reporter: Ivan Chan
> Assignee: Ramesh Reddy
> Labels: teiid
> Fix For: 8.6
>
>
> Group by SQL with/ without aggregate function returns incorrect values:
> For example:
> Original SQL:
> select "grade", sum("score") as "sum_score" from "mongoDBDS"."grades" group by "grade" order by "grade"
>
> Transform query:
> SELECT grades.grade AS c_0, SUM(grades.score) AS c_1 FROM grades GROUP BY grades.grade ORDER BY c_0
> $group:{ "_id" : "$grade" , "c_1" : { "$sum" : "$score"}}
> $project:{ "c_0" : "$grade" , "c_1" : 1}
> $sort:{ "c_0" : 1}
> Expected Result:
> grade score
> A 187
> F 55
> Actual Result: (INCORRECT)
> grade score
> 242
> It only returns SUM(score) and group by fields are ignore.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
11 years, 4 months
[JBoss JIRA] (TEIID-2725) Group by doesn't work with MongoDB
by Ramesh Reddy (JIRA)
[ https://issues.jboss.org/browse/TEIID-2725?page=com.atlassian.jira.plugin... ]
Ramesh Reddy reassigned TEIID-2725:
-----------------------------------
Assignee: Ramesh Reddy (was: Steven Hawkins)
> Group by doesn't work with MongoDB
> ----------------------------------
>
> Key: TEIID-2725
> URL: https://issues.jboss.org/browse/TEIID-2725
> Project: Teiid
> Issue Type: Bug
> Components: Query Engine
> Affects Versions: 8.6
> Environment: Teiid with MongoDB
> Reporter: Ivan Chan
> Assignee: Ramesh Reddy
> Labels: teiid
>
> Group by SQL with/ without aggregate function returns incorrect values:
> For example:
> Original SQL:
> select "grade", sum("score") as "sum_score" from "mongoDBDS"."grades" group by "grade" order by "grade"
>
> Transform query:
> SELECT grades.grade AS c_0, SUM(grades.score) AS c_1 FROM grades GROUP BY grades.grade ORDER BY c_0
> $group:{ "_id" : "$grade" , "c_1" : { "$sum" : "$score"}}
> $project:{ "c_0" : "$grade" , "c_1" : 1}
> $sort:{ "c_0" : 1}
> Expected Result:
> grade score
> A 187
> F 55
> Actual Result: (INCORRECT)
> grade score
> 242
> It only returns SUM(score) and group by fields are ignore.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
11 years, 4 months
[JBoss JIRA] (TEIID-2725) Group by doesn't work with MongoDB
by Ivan Chan (JIRA)
Ivan Chan created TEIID-2725:
--------------------------------
Summary: Group by doesn't work with MongoDB
Key: TEIID-2725
URL: https://issues.jboss.org/browse/TEIID-2725
Project: Teiid
Issue Type: Bug
Components: Query Engine
Affects Versions: 8.6
Environment: Teiid with MongoDB
Reporter: Ivan Chan
Assignee: Steven Hawkins
Group by SQL with/ without aggregate function returns incorrect values:
For example:
Original SQL:
select "grade", sum("score") as "sum_score" from "mongoDBDS"."grades" group by "grade" order by "grade"
Transform query:
SELECT grades.grade AS c_0, SUM(grades.score) AS c_1 FROM grades GROUP BY grades.grade ORDER BY c_0
$group:{ "_id" : "$grade" , "c_1" : { "$sum" : "$score"}}
$project:{ "c_0" : "$grade" , "c_1" : 1}
$sort:{ "c_0" : 1}
Expected Result:
grade score
A 187
F 55
Actual Result: (INCORRECT)
grade score
242
It only returns SUM(score) and group by fields are ignore.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
11 years, 4 months
[JBoss JIRA] (TEIID-2722) Cassandra: ORDER BY should do it in memory instead of trying to push down Cassandra in some cases
by Steven Hawkins (JIRA)
[ https://issues.jboss.org/browse/TEIID-2722?page=com.atlassian.jira.plugin... ]
Steven Hawkins commented on TEIID-2722:
---------------------------------------
TEIID-2717 did change the metadata so that only primary key columns are searchable, so this narrows the issue somewhat. It looks like for now we should simply disable the cassandra translator advertising support for order by altogether.
> Cassandra: ORDER BY should do it in memory instead of trying to push down Cassandra in some cases
> --------------------------------------------------------------------------------------------------
>
> Key: TEIID-2722
> URL: https://issues.jboss.org/browse/TEIID-2722
> Project: Teiid
> Issue Type: Bug
> Components: Query Engine
> Affects Versions: 8.6
> Environment: Teiid 8.6 Alpha with Cassandra 1.2.11
> Reporter: Ivan Chan
> Assignee: Steven Hawkins
> Labels: teiid
>
> When I tried to join 2 tables together from same keyspace using Teiid 8.6 Alpha with Cassandra 1.2.11. It broke down SQL into 2 CQLs. However, teiid SQL transformer adds order by clause to the CQL which is not supported.
> Original SQL:
> select "cassandraDS_users"."user_id" as "cassandraDS_users_user_id",
> "cassandraDS_invoice"."sale" as "cassandraDS_invoice_sale"
> from "cassandraDS"."invoice" "cassandraDS_invoice"
> inner join "cassandraDS"."users" "cassandraDS_users" on ("cassandraDS_invoice"."user_id" = "cassandraDS_users"."user_id")
> Break Down CQL:
> SELECT cassandraDS.invoice.user_id, cassandraDS.invoice.sale FROM cassandraDS.i
> nvoice ORDER BY cassandraDS.invoice.user_id
> SELECT cassandraDS.users.user_id FROM cassandraDS.users ORDER BY cassandraDS.us
> ers.user_id
> Error from CQL Driver:
> com.datastax.driver.core.exceptions.InvalidQueryException: ORDER BY is only supported when the partition key is restricted by an EQ or an IN.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
11 years, 4 months
[JBoss JIRA] (TEIID-2724) Suggestion for Cassandra: implement fallback plan if push-down CQL fails
by Steven Hawkins (JIRA)
[ https://issues.jboss.org/browse/TEIID-2724?page=com.atlassian.jira.plugin... ]
Steven Hawkins updated TEIID-2724:
----------------------------------
Issue Type: Enhancement (was: Bug)
Priority: Minor (was: Major)
Defaulting to no filtering seems dangerous. It would be best to attempt to capture under what scenarios push down is appropriate. If this proves too difficult (for instance introducing too much extension metadata/capabilities) then we could add an option for this.
> Suggestion for Cassandra: implement fallback plan if push-down CQL fails
> -------------------------------------------------------------------------
>
> Key: TEIID-2724
> URL: https://issues.jboss.org/browse/TEIID-2724
> Project: Teiid
> Issue Type: Enhancement
> Components: Query Engine
> Affects Versions: 8.6
> Environment: Teiid 8.6 with Cassandra
> Reporter: Ivan Chan
> Assignee: Steven Hawkins
> Priority: Minor
> Labels: teiid
>
> Sometimes push down sql doesn't work in Cassandra database because most of the time filtering only works on petition key or index column. For example, it won't be possible to apply "IN" clause on non-petition key column. Therefore, I suggest if push down sql fails to execute, I would like to see Teiid to the filtering using Teiid in-memory engine. Thanks.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
11 years, 4 months