You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kylin.apache.org by li...@apache.org on 2015/03/21 01:29:15 UTC

[1/2] incubator-kylin git commit: fix export result bug

Repository: incubator-kylin
Updated Branches:
  refs/heads/0.6 07381b832 -> ba90f9e37


fix export result bug


Project: http://git-wip-us.apache.org/repos/asf/incubator-kylin/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-kylin/commit/5d48db72
Tree: http://git-wip-us.apache.org/repos/asf/incubator-kylin/tree/5d48db72
Diff: http://git-wip-us.apache.org/repos/asf/incubator-kylin/diff/5d48db72

Branch: refs/heads/0.6
Commit: 5d48db72063d38a838fa0525f327f69ae830f3db
Parents: 07381b8
Author: jiazhong <ji...@ebay.com>
Authored: Thu Mar 19 17:42:08 2015 +0800
Committer: jiazhong <ji...@ebay.com>
Committed: Thu Mar 19 17:42:08 2015 +0800

----------------------------------------------------------------------
 webapp/app/partials/query/query_detail.html | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/5d48db72/webapp/app/partials/query/query_detail.html
----------------------------------------------------------------------
diff --git a/webapp/app/partials/query/query_detail.html b/webapp/app/partials/query/query_detail.html
index 1b65419..824aa60 100644
--- a/webapp/app/partials/query/query_detail.html
+++ b/webapp/app/partials/query/query_detail.html
@@ -69,7 +69,7 @@
             <span ng-if="curQuery.graph.show"><i class="fa fa-list-ul"></i> Grid</span>
         </button>
         <a class="btn btn-default btn-xs"
-           href="{{config.service.url}}query/format/csv?sql={{sanitate(curQuery.sql)}}&project={{state.selectedProject}}" target="_blank"><i
+           href="{{config.service.url}}query/format/csv?sql={{sanitate(curQuery.sql)}}&project={{curQuery.project}}" target="_blank"><i
                 class="fa fa-cloud-download"></i> Export</a>
         <a class="btn btn-default btn-xs"
            ng-click="refreshUi();"><i


[2/2] incubator-kylin git commit: KYLIN-648

Posted by li...@apache.org.
KYLIN-648


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

Branch: refs/heads/0.6
Commit: ba90f9e3718a4e477d0d0628b1ba78560c0de582
Parents: 5d48db7
Author: Li, Yang <ya...@ebay.com>
Authored: Thu Mar 19 22:23:22 2015 +0800
Committer: Li, Yang <ya...@ebay.com>
Committed: Thu Mar 19 22:23:22 2015 +0800

----------------------------------------------------------------------
 query/src/test/resources/query/sql/query77.sql     |  4 ++++
 .../storage/hbase/HBaseStorageEngine.java          | 17 +++++++++++------
 2 files changed, 15 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/ba90f9e3/query/src/test/resources/query/sql/query77.sql
----------------------------------------------------------------------
diff --git a/query/src/test/resources/query/sql/query77.sql b/query/src/test/resources/query/sql/query77.sql
new file mode 100644
index 0000000..f1d8fb2
--- /dev/null
+++ b/query/src/test/resources/query/sql/query77.sql
@@ -0,0 +1,4 @@
+select sum(PRICE), LSTG_FORMAT_NAME
+from test_kylin_fact
+where (LSTG_FORMAT_NAME in ('ABIN')) or  (LSTG_FORMAT_NAME>='FP-GTC' and LSTG_FORMAT_NAME<='Others')
+group by LSTG_FORMAT_NAME

http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/ba90f9e3/storage/src/main/java/com/kylinolap/storage/hbase/HBaseStorageEngine.java
----------------------------------------------------------------------
diff --git a/storage/src/main/java/com/kylinolap/storage/hbase/HBaseStorageEngine.java b/storage/src/main/java/com/kylinolap/storage/hbase/HBaseStorageEngine.java
index 2f274b7..b47ae5f 100644
--- a/storage/src/main/java/com/kylinolap/storage/hbase/HBaseStorageEngine.java
+++ b/storage/src/main/java/com/kylinolap/storage/hbase/HBaseStorageEngine.java
@@ -106,7 +106,7 @@ public class HBaseStorageEngine implements IStorageEngine {
         context.setExactAggregation(isExactAggregation);
 
         // translate filter for scan range and compose returning groups for coprocessor, note:
-        // - columns on evaluate-able filter have to return
+        // - columns on non-evaluatable filter have to return
         // - columns on loosened filter (due to derived translation) have to return
         Set<TblColRef> groupsCopD = Sets.newHashSet(groupsD);
         groupsCopD.addAll(context.getOtherMandatoryColumns()); // TODO: this is tricky, to generalize
@@ -392,7 +392,7 @@ public class HBaseStorageEngine implements IStorageEngine {
         List<Collection<ColumnValueRange>> result = Lists.newArrayList();
 
         if (flatFilter == null) {
-            result.add(Collections.<ColumnValueRange>emptyList());
+            result.add(Collections.<ColumnValueRange> emptyList());
             return result;
         }
 
@@ -432,7 +432,7 @@ public class HBaseStorageEngine implements IStorageEngine {
         }
         if (globalAlwaysTrue) {
             orAndRanges.clear();
-            orAndRanges.add(Collections.<ColumnValueRange>emptyList());
+            orAndRanges.add(Collections.<ColumnValueRange> emptyList());
         }
         return orAndRanges;
     }
@@ -518,8 +518,10 @@ public class HBaseStorageEngine implements IStorageEngine {
             List<Pair<byte[], byte[]>> newFuzzyKeys = new ArrayList<Pair<byte[], byte[]>>(mergeSize);
             List<Collection<ColumnValueRange>> newFlatOrAndFilter = Lists.newLinkedList();
 
+            boolean hasNonFuzzyRange = false;
             for (int k = from; k <= to; k++) {
                 HBaseKeyRange nextRange = keyRanges.get(k);
+                hasNonFuzzyRange = hasNonFuzzyRange || nextRange.getFuzzyKeys().isEmpty();
                 newFuzzyKeys.addAll(nextRange.getFuzzyKeys());
                 newFlatOrAndFilter.addAll(nextRange.getFlatOrAndFilter());
                 if (Bytes.compareTo(stopKey, nextRange.getStopKey()) < 0) {
@@ -532,12 +534,15 @@ public class HBaseStorageEngine implements IStorageEngine {
                     partitionColumnEndDate = nextRange.getPartitionColumnEndDate();
                 }
             }
+            
+            // if any range is non-fuzzy, then all fuzzy keys must be cleared
+            if (hasNonFuzzyRange) {
+                newFuzzyKeys.clear();
+            }
 
             partitionColumnStartDate = (partitionColumnStartDate == Long.MAX_VALUE) ? 0 : partitionColumnStartDate;
             partitionColumnEndDate = (partitionColumnEndDate == 0) ? Long.MAX_VALUE : partitionColumnEndDate;
-            keyRange =
-
-                    new HBaseKeyRange(cubeSegment, cuboid, startKey, stopKey, newFuzzyKeys, newFlatOrAndFilter, partitionColumnStartDate, partitionColumnEndDate);
+            keyRange = new HBaseKeyRange(cubeSegment, cuboid, startKey, stopKey, newFuzzyKeys, newFlatOrAndFilter, partitionColumnStartDate, partitionColumnEndDate);
         }
         return keyRange;
     }