You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kylin.apache.org by sh...@apache.org on 2018/10/12 03:24:53 UTC
[kylin] branch master updated: KYLIN-3597 fix security
vulnerability in GTFilterScanner.java
This is an automated email from the ASF dual-hosted git repository.
shaofengshi pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/kylin.git
The following commit(s) were added to refs/heads/master by this push:
new 99cbaaa KYLIN-3597 fix security vulnerability in GTFilterScanner.java
99cbaaa is described below
commit 99cbaaa9938cc7c64c311b54dae6b3ce003c658e
Author: shaofengshi <sh...@apache.org>
AuthorDate: Fri Oct 12 11:23:49 2018 +0800
KYLIN-3597 fix security vulnerability in GTFilterScanner.java
---
.../org/apache/kylin/gridtable/GTFilterScanner.java | 4 ++--
.../kylin/storage/gtrecord/DictGridTableTest.java | 21 ---------------------
2 files changed, 2 insertions(+), 23 deletions(-)
diff --git a/core-cube/src/main/java/org/apache/kylin/gridtable/GTFilterScanner.java b/core-cube/src/main/java/org/apache/kylin/gridtable/GTFilterScanner.java
index 89d29e3..3aa9aae 100644
--- a/core-cube/src/main/java/org/apache/kylin/gridtable/GTFilterScanner.java
+++ b/core-cube/src/main/java/org/apache/kylin/gridtable/GTFilterScanner.java
@@ -138,7 +138,7 @@ public class GTFilterScanner extends GTForwardingScanner {
public static class FilterResultCache {
static final int CHECKPOINT = 10000;
static final double HIT_RATE_THRESHOLD = 0.5;
- public static boolean DEFAULT_OPTION = true; // enable cache by default
+ public static final boolean DEFAULT_OPTION = true; // enable cache by default
private boolean enabled = DEFAULT_OPTION;
ImmutableBitSet colsInFilter;
int count;
@@ -192,7 +192,7 @@ public class GTFilterScanner extends GTForwardingScanner {
}
private ImmutableBitSet collectColumnsInFilter(TupleFilter filter) {
- Set<TblColRef> columnsInFilter = new HashSet<TblColRef>();
+ Set<TblColRef> columnsInFilter = new HashSet<>();
TupleFilter.collectColumns(filter, columnsInFilter);
BitSet result = new BitSet();
for (TblColRef col : columnsInFilter)
diff --git a/core-storage/src/test/java/org/apache/kylin/storage/gtrecord/DictGridTableTest.java b/core-storage/src/test/java/org/apache/kylin/storage/gtrecord/DictGridTableTest.java
index 14c5eef..b8de556 100644
--- a/core-storage/src/test/java/org/apache/kylin/storage/gtrecord/DictGridTableTest.java
+++ b/core-storage/src/test/java/org/apache/kylin/storage/gtrecord/DictGridTableTest.java
@@ -64,7 +64,6 @@ import org.apache.kylin.metadata.model.TblColRef.InnerDataTypeEnum;
import org.junit.After;
import org.junit.Assert;
import org.junit.Before;
-import org.junit.Ignore;
import org.junit.Test;
import com.google.common.collect.Lists;
@@ -359,26 +358,6 @@ public class DictGridTableTest extends LocalFileMetadataTestCase {
"[null, 30, null, null, 52.5]");
}
- @Test
- @Ignore
- public void testFilterScannerPerf() throws IOException {
- GridTable table = newTestPerfTable();
- GTInfo info = table.getInfo();
-
- CompareTupleFilter fComp1 = compare(info.colRef(0), FilterOperatorEnum.GT, enc(info, 0, "2015-01-14"));
- CompareTupleFilter fComp2 = compare(info.colRef(1), FilterOperatorEnum.GT, enc(info, 1, "10"));
- LogicalTupleFilter filter = and(fComp1, fComp2);
-
- FilterResultCache.DEFAULT_OPTION = false;
- testFilterScannerPerfInner(table, info, filter);
- FilterResultCache.DEFAULT_OPTION = true;
- testFilterScannerPerfInner(table, info, filter);
- FilterResultCache.DEFAULT_OPTION = false;
- testFilterScannerPerfInner(table, info, filter);
- FilterResultCache.DEFAULT_OPTION = true;
- testFilterScannerPerfInner(table, info, filter);
- }
-
@SuppressWarnings("unused")
private void testFilterScannerPerfInner(GridTable table, GTInfo info, LogicalTupleFilter filter)
throws IOException {