ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject [01/18] incubator-ignite git commit: ignite-sprint-3 - map query sort fix (IGNITE-682)
Date Mon, 06 Apr 2015 21:45:20 GMT
Repository: incubator-ignite
Updated Branches:
  refs/heads/ignite-683-1 8b3856195 -> 8b4b56245


ignite-sprint-3 - map query sort fix (IGNITE-682)


Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/88268bf8
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/88268bf8
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/88268bf8

Branch: refs/heads/ignite-683-1
Commit: 88268bf8f1cf3c612bf0e68a471097817af9de87
Parents: af5c9d3
Author: S.Vladykin <svladykin@gridgain.com>
Authored: Mon Apr 6 16:55:01 2015 +0300
Committer: S.Vladykin <svladykin@gridgain.com>
Committed: Mon Apr 6 16:55:01 2015 +0300

----------------------------------------------------------------------
 .../processors/query/h2/sql/GridSqlQuerySplitter.java         | 2 ++
 .../processors/query/h2/sql/GridQueryParsingTest.java         | 1 +
 .../internal/processors/query/h2/sql/IgniteVsH2QueryTest.java | 7 +++++++
 3 files changed, 10 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/88268bf8/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/sql/GridSqlQuerySplitter.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/sql/GridSqlQuerySplitter.java
b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/sql/GridSqlQuerySplitter.java
index 47e5e05..77e0cc8 100644
--- a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/sql/GridSqlQuerySplitter.java
+++ b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/sql/GridSqlQuerySplitter.java
@@ -110,6 +110,8 @@ public class GridSqlQuerySplitter {
 
         // -- ORDER BY
         if (!srcQry.sort().isEmpty()) {
+            mapQry.clearSort();
+
             for (GridSqlSortColumn sortCol : srcQry.sort().values())
                 rdcQry.addSort(column(((GridSqlAlias)mapExps.get(sortCol.column())).alias()),
sortCol);
         }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/88268bf8/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/h2/sql/GridQueryParsingTest.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/h2/sql/GridQueryParsingTest.java
b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/h2/sql/GridQueryParsingTest.java
index eada55a..7c76ddb 100644
--- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/h2/sql/GridQueryParsingTest.java
+++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/h2/sql/GridQueryParsingTest.java
@@ -172,6 +172,7 @@ public class GridQueryParsingTest extends GridCommonAbstractTest {
         checkQuery("select count(*) as a from Person");
         checkQuery("select count(*) as a, count(p.*), count(p.name) from Person p");
         checkQuery("select count(distinct p.name) from Person p");
+        checkQuery("select name, count(*) cnt from Person group by name order by cnt desc
limit 10");
 
         checkQuery("select p.name, avg(p.old), max(p.old) from Person p group by p.name");
         checkQuery("select p.name n, avg(p.old) a, max(p.old) m from Person p group by p.name");

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/88268bf8/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/h2/sql/IgniteVsH2QueryTest.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/h2/sql/IgniteVsH2QueryTest.java
b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/h2/sql/IgniteVsH2QueryTest.java
index 0506ddf..1f4771a 100644
--- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/h2/sql/IgniteVsH2QueryTest.java
+++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/h2/sql/IgniteVsH2QueryTest.java
@@ -538,6 +538,13 @@ public class IgniteVsH2QueryTest extends GridCommonAbstractTest {
     }
 
     /**
+     * @throws SQLException If failed.
+     */
+    public void testAggregateOrderBy() throws SQLException {
+        compareOrderedQueryRes0("select firstName name, count(*) cnt from \"part\".Person
group by name order by cnt desc");
+    }
+
+    /**
      * @throws Exception If failed.
      */
     public void testNullParamSubstitution() throws Exception {


Mime
View raw message