kylin-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From shaofeng...@apache.org
Subject [18/42] kylin git commit: fix NPE in OLAPEnumerator.setConnectionProperties()
Date Fri, 30 Dec 2016 02:31:10 GMT
fix NPE in OLAPEnumerator.setConnectionProperties()


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

Branch: refs/heads/sparkcubing-rebase
Commit: cccf3a9c1a8dd0c7ac326c958aafab050a3886cb
Parents: 84ec908
Author: Li Yang <liyang@apache.org>
Authored: Wed Dec 28 09:45:18 2016 +0800
Committer: Li Yang <liyang@apache.org>
Committed: Wed Dec 28 09:45:18 2016 +0800

----------------------------------------------------------------------
 .../org/apache/kylin/query/enumerator/OLAPEnumerator.java     | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kylin/blob/cccf3a9c/query/src/main/java/org/apache/kylin/query/enumerator/OLAPEnumerator.java
----------------------------------------------------------------------
diff --git a/query/src/main/java/org/apache/kylin/query/enumerator/OLAPEnumerator.java b/query/src/main/java/org/apache/kylin/query/enumerator/OLAPEnumerator.java
index e4fc937..f012638 100644
--- a/query/src/main/java/org/apache/kylin/query/enumerator/OLAPEnumerator.java
+++ b/query/src/main/java/org/apache/kylin/query/enumerator/OLAPEnumerator.java
@@ -25,6 +25,7 @@ import java.util.Properties;
 import org.apache.calcite.DataContext;
 import org.apache.calcite.jdbc.CalciteConnection;
 import org.apache.calcite.linq4j.Enumerator;
+import org.apache.commons.lang3.StringUtils;
 import org.apache.kylin.common.util.DateFormat;
 import org.apache.kylin.metadata.filter.CompareTupleFilter;
 import org.apache.kylin.metadata.filter.TupleFilter;
@@ -161,8 +162,10 @@ public class OLAPEnumerator implements Enumerator<Object[]> {
         Properties connProps = conn.getProperties();
 
         String propThreshold = connProps.getProperty(OLAPQuery.PROP_SCAN_THRESHOLD);
-        int threshold = Integer.valueOf(propThreshold);
-        olapContext.storageContext.setThreshold(threshold);
+        if (!StringUtils.isBlank(propThreshold)) {
+            int threshold = Integer.valueOf(propThreshold);
+            olapContext.storageContext.setThreshold(threshold);
+        }
     }
 
 }


Mime
View raw message