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 2016/12/07 09:55:00 UTC
[1/6] kylin git commit: KYLIN-1875 Normalize table and column names
in JSON
Repository: kylin
Updated Branches:
refs/heads/master 081ed0d50 -> 365caaebd
KYLIN-1875 Normalize table and column names in JSON
Project: http://git-wip-us.apache.org/repos/asf/kylin/repo
Commit: http://git-wip-us.apache.org/repos/asf/kylin/commit/967ef180
Tree: http://git-wip-us.apache.org/repos/asf/kylin/tree/967ef180
Diff: http://git-wip-us.apache.org/repos/asf/kylin/diff/967ef180
Branch: refs/heads/master
Commit: 967ef18062048e199cd0dd351ba82618a10b08e5
Parents: 081ed0d
Author: Li Yang <li...@apache.org>
Authored: Tue Nov 29 20:32:04 2016 +0800
Committer: Li Yang <li...@apache.org>
Committed: Wed Dec 7 17:53:35 2016 +0800
----------------------------------------------------------------------
.../kylin/job/dataGen/FactTableGenerator.java | 22 +++++++++---
.../org/apache/kylin/cube/model/CubeDesc.java | 1 +
.../apache/kylin/cube/model/DimensionDesc.java | 19 +++++-----
.../model/validation/rule/FunctionRule.java | 37 ++++----------------
.../kylin/metadata/model/DataModelDesc.java | 13 ++++++-
.../kylin/metadata/model/FunctionDesc.java | 5 +--
.../metadata/model/ModelDimensionDesc.java | 19 +++++++---
.../kylin/metadata/model/PartitionDesc.java | 4 +--
8 files changed, 64 insertions(+), 56 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/kylin/blob/967ef180/assembly/src/test/java/org/apache/kylin/job/dataGen/FactTableGenerator.java
----------------------------------------------------------------------
diff --git a/assembly/src/test/java/org/apache/kylin/job/dataGen/FactTableGenerator.java b/assembly/src/test/java/org/apache/kylin/job/dataGen/FactTableGenerator.java
index 677b713..011035b 100644
--- a/assembly/src/test/java/org/apache/kylin/job/dataGen/FactTableGenerator.java
+++ b/assembly/src/test/java/org/apache/kylin/job/dataGen/FactTableGenerator.java
@@ -81,8 +81,7 @@ public class FactTableGenerator {
// table(appear as fk in fact table)
TreeMap<String, LinkedList<String>> lookupTableKeys = new TreeMap<>(String.CASE_INSENSITIVE_ORDER);
- // possible values of lookupTableKeys, extracted from existing lookup
- // tables.
+ // possible values of lookupTableKeys, extracted from existing lookup tables.
// The key is in the format of tablename/columnname
TreeMap<String, ArrayList<String>> feasibleValues = new TreeMap<>(String.CASE_INSENSITIVE_ORDER);
@@ -244,7 +243,7 @@ public class FactTableGenerator {
JoinDesc join = dim.getJoin();
if (join != null) {
String lookupTable = dim.getTableRef().getTableIdentity();
- for (String column : join.getPrimaryKey()) {
+ for (String column : dropAlias(join.getPrimaryKey())) {
if (!lookupTableKeys.containsKey(lookupTable)) {
lookupTableKeys.put(lookupTable, new LinkedList<String>());
}
@@ -297,8 +296,8 @@ public class FactTableGenerator {
for (DimensionDesc dim : dimensions) {
JoinDesc jDesc = dim.getJoin();
if (jDesc != null) {
- String[] fks = jDesc.getForeignKey();
- String[] pks = jDesc.getPrimaryKey();
+ String[] fks = dropAlias(jDesc.getForeignKey());
+ String[] pks = dropAlias(jDesc.getPrimaryKey());
int num = fks.length;
for (int i = 0; i < num; ++i) {
String value = dim.getTableRef().getTableIdentity() + "/" + pks[i];
@@ -343,6 +342,19 @@ public class FactTableGenerator {
return createTable(this.rowCount, factTableCol2LookupCol, lookupCol2factTableCol, usedCols);
}
+ private String[] dropAlias(String[] aliasDotCol) {
+ String[] result = new String[aliasDotCol.length];
+ for (int i = 0; i < aliasDotCol.length; i++) {
+ String str = aliasDotCol[i];
+ int cut = str.lastIndexOf('.');
+ if (cut >= 0) {
+ str = str.substring(cut + 1);
+ }
+ result[i] = str;
+ }
+ return result;
+ }
+
private String normToTwoDigits(int v) {
if (v < 10)
return "0" + v;
http://git-wip-us.apache.org/repos/asf/kylin/blob/967ef180/core-cube/src/main/java/org/apache/kylin/cube/model/CubeDesc.java
----------------------------------------------------------------------
diff --git a/core-cube/src/main/java/org/apache/kylin/cube/model/CubeDesc.java b/core-cube/src/main/java/org/apache/kylin/cube/model/CubeDesc.java
index 853571c..f95cceb 100644
--- a/core-cube/src/main/java/org/apache/kylin/cube/model/CubeDesc.java
+++ b/core-cube/src/main/java/org/apache/kylin/cube/model/CubeDesc.java
@@ -543,6 +543,7 @@ public class CubeDesc extends RootPersistentEntity implements IEngineAware {
initMeasureColumns();
rowkey.init(this);
+
validateAggregationGroups(); // check if aggregation group is valid
for (AggregationGroup agg : this.aggregationGroups) {
agg.init(this, rowkey);
http://git-wip-us.apache.org/repos/asf/kylin/blob/967ef180/core-cube/src/main/java/org/apache/kylin/cube/model/DimensionDesc.java
----------------------------------------------------------------------
diff --git a/core-cube/src/main/java/org/apache/kylin/cube/model/DimensionDesc.java b/core-cube/src/main/java/org/apache/kylin/cube/model/DimensionDesc.java
index 1106103..cd75228 100644
--- a/core-cube/src/main/java/org/apache/kylin/cube/model/DimensionDesc.java
+++ b/core-cube/src/main/java/org/apache/kylin/cube/model/DimensionDesc.java
@@ -21,7 +21,6 @@ package org.apache.kylin.cube.model;
import java.util.Arrays;
import org.apache.commons.lang.NotImplementedException;
-import org.apache.kylin.common.util.StringUtil;
import org.apache.kylin.metadata.model.DataModelDesc;
import org.apache.kylin.metadata.model.JoinDesc;
import org.apache.kylin.metadata.model.JoinTableDesc;
@@ -54,16 +53,13 @@ public class DimensionDesc {
private TblColRef[] columnRefs;
public void init(CubeDesc cubeDesc) {
+ DataModelDesc model = cubeDesc.getModel();
+
if (name != null)
name = name.toUpperCase();
- if (table != null)
- table = table.toUpperCase();
-
- DataModelDesc model = cubeDesc.getModel();
- tableRef = model.findTable(this.getTable());
- if (tableRef == null)
- throw new IllegalStateException("Can't find table " + table + " for dimension " + name);
+ tableRef = model.findTable(table);
+ table = tableRef.getAlias();
join = null;
for (JoinTableDesc joinTable : model.getJoinTables()) {
@@ -73,11 +69,16 @@ public class DimensionDesc {
}
}
+ if (column != null && !"{FK}".equals(column)) {
+ column = model.findColumn(table, column).getName();
+ }
if (derived != null && derived.length == 0) {
derived = null;
}
if (derived != null) {
- StringUtil.toUpperCaseArray(derived, derived);
+ for (int i = 0; i < derived.length; i++) {
+ derived[i] = model.findColumn(table, derived[i]).getName();
+ }
}
if (derived != null && join == null) {
throw new IllegalStateException("Derived can only be defined on lookup table, cube " + cubeDesc + ", " + this);
http://git-wip-us.apache.org/repos/asf/kylin/blob/967ef180/core-cube/src/main/java/org/apache/kylin/cube/model/validation/rule/FunctionRule.java
----------------------------------------------------------------------
diff --git a/core-cube/src/main/java/org/apache/kylin/cube/model/validation/rule/FunctionRule.java b/core-cube/src/main/java/org/apache/kylin/cube/model/validation/rule/FunctionRule.java
index 1ed7325..36631ce 100644
--- a/core-cube/src/main/java/org/apache/kylin/cube/model/validation/rule/FunctionRule.java
+++ b/core-cube/src/main/java/org/apache/kylin/cube/model/validation/rule/FunctionRule.java
@@ -31,12 +31,10 @@ import org.apache.kylin.cube.model.validation.IValidatorRule;
import org.apache.kylin.cube.model.validation.ResultLevel;
import org.apache.kylin.cube.model.validation.ValidateContext;
import org.apache.kylin.measure.topn.TopNMeasureType;
-import org.apache.kylin.metadata.MetadataManager;
-import org.apache.kylin.metadata.model.ColumnDesc;
+import org.apache.kylin.metadata.model.DataModelDesc;
import org.apache.kylin.metadata.model.FunctionDesc;
import org.apache.kylin.metadata.model.MeasureDesc;
import org.apache.kylin.metadata.model.ParameterDesc;
-import org.apache.kylin.metadata.model.TableDesc;
import com.google.common.collect.Lists;
@@ -153,35 +151,12 @@ public class FunctionRule implements IValidatorRule<CubeDesc> {
* @param value
*/
private void validateColumnParameter(ValidateContext context, CubeDesc cube, String value) {
- String factTable = cube.getModel().getRootFactTable().getTableIdentity();
- if (StringUtils.isEmpty(factTable)) {
- context.addResult(ResultLevel.ERROR, "Fact table can not be null.");
- return;
- }
- TableDesc table = MetadataManager.getInstance(cube.getConfig()).getTableDesc(factTable);
- if (table == null) {
- context.addResult(ResultLevel.ERROR, "Fact table can not be found: " + cube);
- return;
- }
- // Prepare column set
- Set<String> set = new HashSet<String>();
- ColumnDesc[] cdesc = table.getColumns();
- for (int i = 0; i < cdesc.length; i++) {
- ColumnDesc columnDesc = cdesc[i];
- set.add(columnDesc.getName());
- }
-
- String[] items = value.split(",");
- for (int i = 0; i < items.length; i++) {
- String item = items[i].trim();
- if (StringUtils.isEmpty(item)) {
- continue;
- }
- if (!set.contains(item)) {
- context.addResult(ResultLevel.ERROR, "Column [" + item + "] does not exist in factable table" + factTable);
- }
+ DataModelDesc model = cube.getModel();
+ try {
+ model.findColumn(value);
+ } catch (IllegalArgumentException e) {
+ context.addResult(ResultLevel.ERROR, e.getMessage());
}
-
}
/**
http://git-wip-us.apache.org/repos/asf/kylin/blob/967ef180/core-metadata/src/main/java/org/apache/kylin/metadata/model/DataModelDesc.java
----------------------------------------------------------------------
diff --git a/core-metadata/src/main/java/org/apache/kylin/metadata/model/DataModelDesc.java b/core-metadata/src/main/java/org/apache/kylin/metadata/model/DataModelDesc.java
index d917571..898ff74 100644
--- a/core-metadata/src/main/java/org/apache/kylin/metadata/model/DataModelDesc.java
+++ b/core-metadata/src/main/java/org/apache/kylin/metadata/model/DataModelDesc.java
@@ -282,7 +282,7 @@ public class DataModelDesc extends RootPersistentEntity {
initTableAlias(tables);
initJoinColumns();
initJoinsTree();
- ModelDimensionDesc.capicalizeStrings(dimensions);
+ initDimensionsAndMetrics();
initPartitionDesc();
}
@@ -354,6 +354,15 @@ public class DataModelDesc extends RootPersistentEntity {
}
}
+ private void initDimensionsAndMetrics() {
+ for (ModelDimensionDesc dim : dimensions) {
+ dim.init(this);
+ }
+ for (int i = 0; i < metrics.length; i++) {
+ metrics[i] = findColumn(metrics[i]).getIdentity();
+ }
+ }
+
private void initPartitionDesc() {
if (this.partitionDesc != null)
this.partitionDesc.init(this);
@@ -381,6 +390,7 @@ public class DataModelDesc extends RootPersistentEntity {
if (col == null || col.getTableRef().equals(dimTable) == false) {
throw new IllegalStateException("Can't find column " + pks[i] + " in table " + dimTable.getTableIdentity());
}
+ pks[i] = col.getIdentity();
pkCols[i] = col;
}
join.setPrimaryKeyColumns(pkCols);
@@ -393,6 +403,7 @@ public class DataModelDesc extends RootPersistentEntity {
if (col == null) {
throw new IllegalStateException("Can't find column " + fks[i] + " in table " + this.getRootFactTable());
}
+ fks[i] = col.getIdentity();
fkCols[i] = col;
}
join.setForeignKeyColumns(fkCols);
http://git-wip-us.apache.org/repos/asf/kylin/blob/967ef180/core-metadata/src/main/java/org/apache/kylin/metadata/model/FunctionDesc.java
----------------------------------------------------------------------
diff --git a/core-metadata/src/main/java/org/apache/kylin/metadata/model/FunctionDesc.java b/core-metadata/src/main/java/org/apache/kylin/metadata/model/FunctionDesc.java
index 7b41552..dfa6f3b 100644
--- a/core-metadata/src/main/java/org/apache/kylin/metadata/model/FunctionDesc.java
+++ b/core-metadata/src/main/java/org/apache/kylin/metadata/model/FunctionDesc.java
@@ -77,14 +77,11 @@ public class FunctionDesc {
expression = expression.toUpperCase();
returnDataType = DataType.getType(returnType);
- for (ParameterDesc p = parameter; p != null; p = p.getNextParameter()) {
- p.setValue(p.getValue().toUpperCase());
- }
-
ArrayList<TblColRef> colRefs = Lists.newArrayList();
for (ParameterDesc p = parameter; p != null; p = p.getNextParameter()) {
if (p.isColumnType()) {
TblColRef colRef = model.findColumn(p.getValue());
+ p.setValue(colRef.getIdentity());
colRefs.add(colRef);
}
}
http://git-wip-us.apache.org/repos/asf/kylin/blob/967ef180/core-metadata/src/main/java/org/apache/kylin/metadata/model/ModelDimensionDesc.java
----------------------------------------------------------------------
diff --git a/core-metadata/src/main/java/org/apache/kylin/metadata/model/ModelDimensionDesc.java b/core-metadata/src/main/java/org/apache/kylin/metadata/model/ModelDimensionDesc.java
index d196155..6460f71 100644
--- a/core-metadata/src/main/java/org/apache/kylin/metadata/model/ModelDimensionDesc.java
+++ b/core-metadata/src/main/java/org/apache/kylin/metadata/model/ModelDimensionDesc.java
@@ -50,13 +50,24 @@ public class ModelDimensionDesc {
this.columns = columns;
}
+ void init(DataModelDesc model) {
+ table = table.toUpperCase();
+ if (columns != null) {
+ StringUtil.toUpperCaseArray(columns, columns);
+ }
+
+ if (model != null) {
+ table = model.findTable(table).getAlias();
+ for (int i = 0; i < columns.length; i++) {
+ columns[i] = model.findColumn(table, columns[i]).getName();
+ }
+ }
+ }
+
public static void capicalizeStrings(List<ModelDimensionDesc> dimensions) {
if (dimensions != null) {
for (ModelDimensionDesc modelDimensionDesc : dimensions) {
- modelDimensionDesc.setTable(modelDimensionDesc.getTable().toUpperCase());
- if (modelDimensionDesc.getColumns() != null) {
- StringUtil.toUpperCaseArray(modelDimensionDesc.getColumns(), modelDimensionDesc.getColumns());
- }
+ modelDimensionDesc.init(null);
}
}
}
http://git-wip-us.apache.org/repos/asf/kylin/blob/967ef180/core-metadata/src/main/java/org/apache/kylin/metadata/model/PartitionDesc.java
----------------------------------------------------------------------
diff --git a/core-metadata/src/main/java/org/apache/kylin/metadata/model/PartitionDesc.java b/core-metadata/src/main/java/org/apache/kylin/metadata/model/PartitionDesc.java
index 0261f41..9925990 100644
--- a/core-metadata/src/main/java/org/apache/kylin/metadata/model/PartitionDesc.java
+++ b/core-metadata/src/main/java/org/apache/kylin/metadata/model/PartitionDesc.java
@@ -66,11 +66,11 @@ public class PartitionDesc {
if (StringUtils.isEmpty(partitionDateColumn))
return;
- partitionDateColumn = partitionDateColumn.toUpperCase();
partitionDateColumnRef = model.findColumn(partitionDateColumn);
+ partitionDateColumn = partitionDateColumnRef.getIdentity();
if (StringUtils.isBlank(partitionTimeColumn) == false) {
- partitionTimeColumn = partitionTimeColumn.toUpperCase();
partitionTimeColumnRef = model.findColumn(partitionTimeColumn);
+ partitionTimeColumn = partitionTimeColumnRef.getIdentity();
}
partitionConditionBuilder = (IPartitionConditionBuilder) ClassUtil.newInstance(partitionConditionBuilderClz);
}
[4/6] kylin git commit: KYLIN-1875 Support measure on
non-root-fact-table
Posted by li...@apache.org.
KYLIN-1875 Support measure on non-root-fact-table
Project: http://git-wip-us.apache.org/repos/asf/kylin/repo
Commit: http://git-wip-us.apache.org/repos/asf/kylin/commit/79e48011
Tree: http://git-wip-us.apache.org/repos/asf/kylin/tree/79e48011
Diff: http://git-wip-us.apache.org/repos/asf/kylin/diff/79e48011
Branch: refs/heads/master
Commit: 79e48011bd3f4696a916f0bfee244ec28355f3b3
Parents: 64d9b8b
Author: Li Yang <li...@apache.org>
Authored: Thu Dec 1 18:59:08 2016 +0800
Committer: Li Yang <li...@apache.org>
Committed: Wed Dec 7 17:53:38 2016 +0800
----------------------------------------------------------------------
.../kylin/metadata/project/ProjectL2Cache.java | 26 +++++++++++++-------
.../template/cube_desc/kylin_sales_cube.json | 18 +++++++-------
.../kylin/query/relnode/OLAPTableScan.java | 4 +++
3 files changed, 30 insertions(+), 18 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/kylin/blob/79e48011/core-metadata/src/main/java/org/apache/kylin/metadata/project/ProjectL2Cache.java
----------------------------------------------------------------------
diff --git a/core-metadata/src/main/java/org/apache/kylin/metadata/project/ProjectL2Cache.java b/core-metadata/src/main/java/org/apache/kylin/metadata/project/ProjectL2Cache.java
index 82c0de3..14d7843 100644
--- a/core-metadata/src/main/java/org/apache/kylin/metadata/project/ProjectL2Cache.java
+++ b/core-metadata/src/main/java/org/apache/kylin/metadata/project/ProjectL2Cache.java
@@ -25,6 +25,7 @@ import java.util.Set;
import org.apache.kylin.metadata.MetadataManager;
import org.apache.kylin.metadata.model.ColumnDesc;
+import org.apache.kylin.metadata.model.DataModelDesc;
import org.apache.kylin.metadata.model.ExternalFilterDesc;
import org.apache.kylin.metadata.model.FunctionDesc;
import org.apache.kylin.metadata.model.MeasureDesc;
@@ -126,17 +127,17 @@ class ProjectL2Cache {
return Collections.unmodifiableSet(tableCache.realizations);
}
- public List<MeasureDesc> listEffectiveRewriteMeasures(String project, String factTable, boolean onlyRewriteMeasure) {
- Set<IRealization> realizations = getRealizationsByTable(project, factTable);
+ public List<MeasureDesc> listEffectiveRewriteMeasures(String project, String table, boolean onlyRewriteMeasure) {
+ Set<IRealization> realizations = getRealizationsByTable(project, table);
List<MeasureDesc> result = Lists.newArrayList();
for (IRealization r : realizations) {
- if (r.getModel().isFactTable(factTable) && r.isReady()) {
- for (MeasureDesc m : r.getMeasures()) {
- FunctionDesc func = m.getFunction();
- if (onlyRewriteMeasure) {
- if (func.needRewrite())
- result.add(m);
- } else {
+ if (!r.isReady())
+ continue;
+
+ for (MeasureDesc m : r.getMeasures()) {
+ FunctionDesc func = m.getFunction();
+ if (belongToTable(func, table, r.getModel())) {
+ if (!onlyRewriteMeasure || func.needRewrite()) {
result.add(m);
}
}
@@ -145,6 +146,13 @@ class ProjectL2Cache {
return result;
}
+ private boolean belongToTable(FunctionDesc func, String table, DataModelDesc model) {
+ // measure belong to the first column parameter's table
+ List<TblColRef> cols = func.getParameter().getColRefs();
+ String belongTo = cols.isEmpty() ? model.getRootFactTable().getTableIdentity() : cols.get(0).getTable();
+ return belongTo.equals(table);
+ }
+
// ============================================================================
// build the cache
// ----------------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/kylin/blob/79e48011/examples/sample_cube/template/cube_desc/kylin_sales_cube.json
----------------------------------------------------------------------
diff --git a/examples/sample_cube/template/cube_desc/kylin_sales_cube.json b/examples/sample_cube/template/cube_desc/kylin_sales_cube.json
index 48eef46..2a27305 100644
--- a/examples/sample_cube/template/cube_desc/kylin_sales_cube.json
+++ b/examples/sample_cube/template/cube_desc/kylin_sales_cube.json
@@ -103,26 +103,26 @@
"returntype" : "decimal(19,4)"
}
}, {
- "name" : "GMV_MIN",
+ "name" : "BUYER_LEVEL_SUM",
"function" : {
- "expression" : "MIN",
+ "expression" : "SUM",
"parameter" : {
"type" : "column",
- "value" : "PRICE",
+ "value" : "BUYER_ACCOUNT.ACCOUNT_BUYER_LEVEL",
"next_parameter" : null
},
- "returntype" : "decimal(19,4)"
+ "returntype" : "bigint"
}
}, {
- "name" : "GMV_MAX",
+ "name" : "SELLER_LEVEL_SUM",
"function" : {
- "expression" : "MAX",
+ "expression" : "SUM",
"parameter" : {
"type" : "column",
- "value" : "PRICE",
+ "value" : "SELLER_ACCOUNT.ACCOUNT_SELLER_LEVEL",
"next_parameter" : null
},
- "returntype" : "decimal(19,4)"
+ "returntype" : "bigint"
}
}, {
"name" : "TRANS_CNT",
@@ -224,7 +224,7 @@
"name" : "F1",
"columns" : [ {
"qualifier" : "M",
- "measure_refs" : [ "GMV_SUM", "GMV_MIN", "GMV_MAX", "TRANS_CNT" ]
+ "measure_refs" : [ "GMV_SUM", "BUYER_LEVEL_SUM", "SELLER_LEVEL_SUM", "TRANS_CNT" ]
} ]
}, {
"name" : "F2",
http://git-wip-us.apache.org/repos/asf/kylin/blob/79e48011/query/src/main/java/org/apache/kylin/query/relnode/OLAPTableScan.java
----------------------------------------------------------------------
diff --git a/query/src/main/java/org/apache/kylin/query/relnode/OLAPTableScan.java b/query/src/main/java/org/apache/kylin/query/relnode/OLAPTableScan.java
index 14758c9..b157f34 100644
--- a/query/src/main/java/org/apache/kylin/query/relnode/OLAPTableScan.java
+++ b/query/src/main/java/org/apache/kylin/query/relnode/OLAPTableScan.java
@@ -236,6 +236,10 @@ public class OLAPTableScan extends TableScan implements OLAPRel, EnumerableRel {
TblColRef colRef = TblColRef.columnForUnknownModel(tableRef, sourceColumn);
columns.add(colRef);
}
+
+ if (columns.size() != rowType.getFieldCount()) {
+ throw new IllegalStateException("RowType=" + rowType.getFieldCount() + ", ColumnRowType=" + columns.size());
+ }
return new ColumnRowType(columns);
}
[6/6] kylin git commit: KYLIN-1875 minor, test fixes
Posted by li...@apache.org.
KYLIN-1875 minor, test fixes
Project: http://git-wip-us.apache.org/repos/asf/kylin/repo
Commit: http://git-wip-us.apache.org/repos/asf/kylin/commit/365caaeb
Tree: http://git-wip-us.apache.org/repos/asf/kylin/tree/365caaeb
Diff: http://git-wip-us.apache.org/repos/asf/kylin/diff/365caaeb
Branch: refs/heads/master
Commit: 365caaebd841917f161dab37b0af7c055626194c
Parents: 92e4d46
Author: Yang Li <li...@apache.org>
Authored: Fri Dec 2 06:32:25 2016 +0800
Committer: Li Yang <li...@apache.org>
Committed: Wed Dec 7 17:53:46 2016 +0800
----------------------------------------------------------------------
.../metadata/filter/ColumnTupleFilter.java | 1 +
.../kylin/metadata/model/DataModelDesc.java | 2 +-
.../apache/kylin/metadata/model/TblColRef.java | 2 +-
.../template/model_desc/kylin_sales_model.json | 4 +++
.../apache/kylin/query/ITKylinQueryTest.java | 2 +-
.../resources/query/sql_subquery/query02.sql | 31 ++++++++++++++++++++
.../query/sql_subquery/query02.sql.disable | 25 ----------------
7 files changed, 39 insertions(+), 28 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/kylin/blob/365caaeb/core-metadata/src/main/java/org/apache/kylin/metadata/filter/ColumnTupleFilter.java
----------------------------------------------------------------------
diff --git a/core-metadata/src/main/java/org/apache/kylin/metadata/filter/ColumnTupleFilter.java b/core-metadata/src/main/java/org/apache/kylin/metadata/filter/ColumnTupleFilter.java
index c8a8f07..ecb8e61 100644
--- a/core-metadata/src/main/java/org/apache/kylin/metadata/filter/ColumnTupleFilter.java
+++ b/core-metadata/src/main/java/org/apache/kylin/metadata/filter/ColumnTupleFilter.java
@@ -121,6 +121,7 @@ public class ColumnTupleFilter extends TupleFilter {
}
}
+ @SuppressWarnings("deprecation")
@Override
public void deserialize(IFilterCodeSystem<?> cs, ByteBuffer buffer) {
http://git-wip-us.apache.org/repos/asf/kylin/blob/365caaeb/core-metadata/src/main/java/org/apache/kylin/metadata/model/DataModelDesc.java
----------------------------------------------------------------------
diff --git a/core-metadata/src/main/java/org/apache/kylin/metadata/model/DataModelDesc.java b/core-metadata/src/main/java/org/apache/kylin/metadata/model/DataModelDesc.java
index 898ff74..3f868a2 100644
--- a/core-metadata/src/main/java/org/apache/kylin/metadata/model/DataModelDesc.java
+++ b/core-metadata/src/main/java/org/apache/kylin/metadata/model/DataModelDesc.java
@@ -112,7 +112,7 @@ public class DataModelDesc extends RootPersistentEntity {
return name;
}
- // for test only
+ // for test mainly
@Deprecated
public void setName(String name) {
this.name = name;
http://git-wip-us.apache.org/repos/asf/kylin/blob/365caaeb/core-metadata/src/main/java/org/apache/kylin/metadata/model/TblColRef.java
----------------------------------------------------------------------
diff --git a/core-metadata/src/main/java/org/apache/kylin/metadata/model/TblColRef.java b/core-metadata/src/main/java/org/apache/kylin/metadata/model/TblColRef.java
index bf8d36b..5d72c3f 100644
--- a/core-metadata/src/main/java/org/apache/kylin/metadata/model/TblColRef.java
+++ b/core-metadata/src/main/java/org/apache/kylin/metadata/model/TblColRef.java
@@ -84,7 +84,7 @@ public class TblColRef implements Serializable {
col.table = tableRef;
}
- // for test only
+ // for test mainly
public static TblColRef mockup(TableDesc table, int oneBasedColumnIndex, String name, String datatype) {
ColumnDesc desc = new ColumnDesc();
String id = "" + oneBasedColumnIndex;
http://git-wip-us.apache.org/repos/asf/kylin/blob/365caaeb/examples/sample_cube/template/model_desc/kylin_sales_model.json
----------------------------------------------------------------------
diff --git a/examples/sample_cube/template/model_desc/kylin_sales_model.json b/examples/sample_cube/template/model_desc/kylin_sales_model.json
index 2d3cfb6..cce360f 100644
--- a/examples/sample_cube/template/model_desc/kylin_sales_model.json
+++ b/examples/sample_cube/template/model_desc/kylin_sales_model.json
@@ -18,6 +18,7 @@
}, {
"table" : "DEFAULT.KYLIN_ACCOUNT",
"alias" : "BUYER_ACCOUNT",
+ "kind" : "LOOKUP",
"join" : {
"type" : "inner",
"primary_key" : [ "ACCOUNT_ID" ],
@@ -26,6 +27,7 @@
}, {
"table" : "DEFAULT.KYLIN_ACCOUNT",
"alias" : "SELLER_ACCOUNT",
+ "kind" : "LOOKUP",
"join" : {
"type" : "inner",
"primary_key" : [ "ACCOUNT_ID" ],
@@ -34,6 +36,7 @@
}, {
"table" : "DEFAULT.KYLIN_COUNTRY",
"alias" : "BUYER_COUNTRY",
+ "kind" : "LOOKUP",
"join" : {
"type" : "inner",
"primary_key" : [ "COUNTRY" ],
@@ -42,6 +45,7 @@
}, {
"table" : "DEFAULT.KYLIN_COUNTRY",
"alias" : "SELLER_COUNTRY",
+ "kind" : "LOOKUP",
"join" : {
"type" : "inner",
"primary_key" : [ "COUNTRY" ],
http://git-wip-us.apache.org/repos/asf/kylin/blob/365caaeb/kylin-it/src/test/java/org/apache/kylin/query/ITKylinQueryTest.java
----------------------------------------------------------------------
diff --git a/kylin-it/src/test/java/org/apache/kylin/query/ITKylinQueryTest.java b/kylin-it/src/test/java/org/apache/kylin/query/ITKylinQueryTest.java
index 6d91753..90324b5 100644
--- a/kylin-it/src/test/java/org/apache/kylin/query/ITKylinQueryTest.java
+++ b/kylin-it/src/test/java/org/apache/kylin/query/ITKylinQueryTest.java
@@ -48,7 +48,7 @@ import org.junit.rules.ExpectedException;
import com.google.common.collect.Maps;
-//@Ignore("KylinQueryTest is contained by ITCombinationTest")
+@Ignore("KylinQueryTest is contained by ITCombinationTest")
public class ITKylinQueryTest extends KylinTestBase {
@Rule
http://git-wip-us.apache.org/repos/asf/kylin/blob/365caaeb/kylin-it/src/test/resources/query/sql_subquery/query02.sql
----------------------------------------------------------------------
diff --git a/kylin-it/src/test/resources/query/sql_subquery/query02.sql b/kylin-it/src/test/resources/query/sql_subquery/query02.sql
new file mode 100644
index 0000000..e6751b7
--- /dev/null
+++ b/kylin-it/src/test/resources/query/sql_subquery/query02.sql
@@ -0,0 +1,31 @@
+--
+-- Licensed to the Apache Software Foundation (ASF) under one
+-- or more contributor license agreements. See the NOTICE file
+-- distributed with this work for additional information
+-- regarding copyright ownership. The ASF licenses this file
+-- to you under the Apache License, Version 2.0 (the
+-- "License"); you may not use this file except in compliance
+-- with the License. You may obtain a copy of the License at
+--
+-- http://www.apache.org/licenses/LICENSE-2.0
+--
+-- Unless required by applicable law or agreed to in writing, software
+-- distributed under the License is distributed on an "AS IS" BASIS,
+-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+-- See the License for the specific language governing permissions and
+-- limitations under the License.
+--
+
+SELECT
+ week_beg_dt
+ ,sum(price) as sum_price
+FROM
+(
+ select
+ test_cal_dt.week_beg_dt
+ ,test_kylin_fact.price
+ from test_kylin_fact
+ inner join edw.test_cal_dt as test_cal_dt
+ on test_kylin_fact.cal_dt = test_cal_dt.cal_dt
+) t
+group by week_beg_dt
http://git-wip-us.apache.org/repos/asf/kylin/blob/365caaeb/kylin-it/src/test/resources/query/sql_subquery/query02.sql.disable
----------------------------------------------------------------------
diff --git a/kylin-it/src/test/resources/query/sql_subquery/query02.sql.disable b/kylin-it/src/test/resources/query/sql_subquery/query02.sql.disable
deleted file mode 100644
index 968dbae..0000000
--- a/kylin-it/src/test/resources/query/sql_subquery/query02.sql.disable
+++ /dev/null
@@ -1,25 +0,0 @@
---
--- Licensed to the Apache Software Foundation (ASF) under one
--- or more contributor license agreements. See the NOTICE file
--- distributed with this work for additional information
--- regarding copyright ownership. The ASF licenses this file
--- to you under the Apache License, Version 2.0 (the
--- "License"); you may not use this file except in compliance
--- with the License. You may obtain a copy of the License at
---
--- http://www.apache.org/licenses/LICENSE-2.0
---
--- Unless required by applicable law or agreed to in writing, software
--- distributed under the License is distributed on an "AS IS" BASIS,
--- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
--- See the License for the specific language governing permissions and
--- limitations under the License.
---
-
-SELECT sum(1) AS "COL"
- FROM (
- select test_cal_dt.week_beg_dt, sum(test_kylin_fact.price) as sum_price
- from test_kylin_fact
- inner join test_cal_dt ON test_kylin_fact.cal_dt = test_cal_dt.cal_dt
- group by test_cal_dt.week_beg_dt
- ) "TableauSQL"
[2/6] kylin git commit: KYLIN-1875 fix ParameterDesc equals() &
hashcode()
Posted by li...@apache.org.
KYLIN-1875 fix ParameterDesc equals() & hashcode()
Project: http://git-wip-us.apache.org/repos/asf/kylin/repo
Commit: http://git-wip-us.apache.org/repos/asf/kylin/commit/227bbf41
Tree: http://git-wip-us.apache.org/repos/asf/kylin/tree/227bbf41
Diff: http://git-wip-us.apache.org/repos/asf/kylin/diff/227bbf41
Branch: refs/heads/master
Commit: 227bbf4152074c0621bf2b1047102d416d4dd3eb
Parents: 967ef18
Author: Yang Li <li...@apache.org>
Authored: Thu Dec 1 06:58:08 2016 +0800
Committer: Li Yang <li...@apache.org>
Committed: Wed Dec 7 17:53:36 2016 +0800
----------------------------------------------------------------------
.../kylin/metadata/model/FunctionDesc.java | 1 +
.../kylin/metadata/model/ParameterDesc.java | 36 +++++++++++++++-----
2 files changed, 28 insertions(+), 9 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/kylin/blob/227bbf41/core-metadata/src/main/java/org/apache/kylin/metadata/model/FunctionDesc.java
----------------------------------------------------------------------
diff --git a/core-metadata/src/main/java/org/apache/kylin/metadata/model/FunctionDesc.java b/core-metadata/src/main/java/org/apache/kylin/metadata/model/FunctionDesc.java
index dfa6f3b..b9e5543 100644
--- a/core-metadata/src/main/java/org/apache/kylin/metadata/model/FunctionDesc.java
+++ b/core-metadata/src/main/java/org/apache/kylin/metadata/model/FunctionDesc.java
@@ -248,6 +248,7 @@ public class FunctionDesc {
final int prime = 31;
int result = 1;
result = prime * result + ((expression == null) ? 0 : expression.hashCode());
+ result = prime * result + ((returnType == null) ? 0 : returnType.hashCode());
result = prime * result + ((isCount() || parameter == null) ? 0 : parameter.hashCode());
return result;
}
http://git-wip-us.apache.org/repos/asf/kylin/blob/227bbf41/core-metadata/src/main/java/org/apache/kylin/metadata/model/ParameterDesc.java
----------------------------------------------------------------------
diff --git a/core-metadata/src/main/java/org/apache/kylin/metadata/model/ParameterDesc.java b/core-metadata/src/main/java/org/apache/kylin/metadata/model/ParameterDesc.java
index 329799f..4a95fea 100644
--- a/core-metadata/src/main/java/org/apache/kylin/metadata/model/ParameterDesc.java
+++ b/core-metadata/src/main/java/org/apache/kylin/metadata/model/ParameterDesc.java
@@ -22,8 +22,10 @@ import java.io.UnsupportedEncodingException;
import java.util.List;
import com.fasterxml.jackson.annotation.JsonAutoDetect;
+import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility;
import com.fasterxml.jackson.annotation.JsonProperty;
+import com.google.common.collect.ImmutableList;
/**
*/
@@ -36,9 +38,10 @@ public class ParameterDesc {
private String value;
@JsonProperty("next_parameter")
+ @JsonInclude(JsonInclude.Include.NON_NULL)
private ParameterDesc nextParameter;
- private List<TblColRef> colRefs;
+ private List<TblColRef> colRefs = ImmutableList.of();
public String getType() {
return type;
@@ -89,21 +92,36 @@ public class ParameterDesc {
ParameterDesc that = (ParameterDesc) o;
- if (nextParameter != null ? !nextParameter.equals(that.nextParameter) : that.nextParameter != null)
- return false;
if (type != null ? !type.equals(that.type) : that.type != null)
return false;
- if (value != null ? !value.equals(that.value) : that.value != null)
- return false;
-
- return true;
+
+ ParameterDesc p = this, q = that;
+ int refi = 0, refj = 0;
+ for (; p != null && q != null; p = p.nextParameter, q = q.nextParameter) {
+ if (p.isColumnType()) {
+ if (q.isColumnType() == false)
+ return false;
+ if (refi >= this.colRefs.size() || refj >= that.colRefs.size())
+ return false;
+ if (this.colRefs.get(refi).equals(that.colRefs.get(refj)) == false)
+ return false;
+ refi++;
+ refj++;
+ } else {
+ if (q.isColumnType() == true)
+ return false;
+ if (p.value.equals(q.value) == false)
+ return false;
+ }
+ }
+
+ return p == null && q == null;
}
@Override
public int hashCode() {
int result = type != null ? type.hashCode() : 0;
- result = 31 * result + (value != null ? value.hashCode() : 0);
- result = 31 * result + (nextParameter != null ? nextParameter.hashCode() : 0);
+ result = 31 * result + (colRefs != null ? colRefs.hashCode() : 0);
return result;
}
[3/6] kylin git commit: KYLIN-1875 fix new instance of ParameterDesc
& FunctionDesc
Posted by li...@apache.org.
KYLIN-1875 fix new instance of ParameterDesc & FunctionDesc
Project: http://git-wip-us.apache.org/repos/asf/kylin/repo
Commit: http://git-wip-us.apache.org/repos/asf/kylin/commit/64d9b8b8
Tree: http://git-wip-us.apache.org/repos/asf/kylin/tree/64d9b8b8
Diff: http://git-wip-us.apache.org/repos/asf/kylin/diff/64d9b8b8
Branch: refs/heads/master
Commit: 64d9b8b89f84cc31f9931e5a6cdf89bdfa13925a
Parents: 227bbf4
Author: Li Yang <li...@apache.org>
Authored: Thu Dec 1 14:10:44 2016 +0800
Committer: Li Yang <li...@apache.org>
Committed: Wed Dec 7 17:53:37 2016 +0800
----------------------------------------------------------------------
.../apache/kylin/cube/RawQueryLastHacker.java | 8 +---
.../metadata/measure/MeasureCodecTest.java | 3 +-
.../kylin/measure/raw/RawMeasureType.java | 12 ++---
.../kylin/metadata/model/FunctionDesc.java | 26 ++++-------
.../kylin/metadata/model/ParameterDesc.java | 47 +++++++++++++++-----
.../apache/kylin/storage/StorageMockUtils.java | 32 +++----------
.../kylin/query/relnode/OLAPAggregateRel.java | 12 ++---
7 files changed, 59 insertions(+), 81 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/kylin/blob/64d9b8b8/core-cube/src/main/java/org/apache/kylin/cube/RawQueryLastHacker.java
----------------------------------------------------------------------
diff --git a/core-cube/src/main/java/org/apache/kylin/cube/RawQueryLastHacker.java b/core-cube/src/main/java/org/apache/kylin/cube/RawQueryLastHacker.java
index b0a4823..682e48c 100644
--- a/core-cube/src/main/java/org/apache/kylin/cube/RawQueryLastHacker.java
+++ b/core-cube/src/main/java/org/apache/kylin/cube/RawQueryLastHacker.java
@@ -57,12 +57,8 @@ public class RawQueryLastHacker {
sqlDigest.groupbyColumns.add(col);
} else {
// For measure columns, take them as metric columns with aggregation function SUM().
- ParameterDesc colParameter = new ParameterDesc();
- colParameter.setType("column");
- colParameter.setValue(col.getName());
- FunctionDesc sumFunc = new FunctionDesc();
- sumFunc.setExpression("SUM");
- sumFunc.setParameter(colParameter);
+ ParameterDesc parameter = ParameterDesc.newInstance(col);
+ FunctionDesc sumFunc = FunctionDesc.newInstance("SUM", parameter, null);
boolean measureHasSum = false;
for (MeasureDesc colMeasureDesc : cubeDesc.getMeasures()) {
http://git-wip-us.apache.org/repos/asf/kylin/blob/64d9b8b8/core-cube/src/test/java/org/apache/kylin/metadata/measure/MeasureCodecTest.java
----------------------------------------------------------------------
diff --git a/core-cube/src/test/java/org/apache/kylin/metadata/measure/MeasureCodecTest.java b/core-cube/src/test/java/org/apache/kylin/metadata/measure/MeasureCodecTest.java
index 6bb71e9..18680ec 100644
--- a/core-cube/src/test/java/org/apache/kylin/metadata/measure/MeasureCodecTest.java
+++ b/core-cube/src/test/java/org/apache/kylin/metadata/measure/MeasureCodecTest.java
@@ -83,8 +83,7 @@ public class MeasureCodecTest extends LocalFileMetadataTestCase {
private MeasureDesc measure(String returnType) {
MeasureDesc desc = new MeasureDesc();
- FunctionDesc func = new FunctionDesc();
- func.setReturnType(returnType);
+ FunctionDesc func = FunctionDesc.newInstance(null, null, returnType);
desc.setFunction(func);
return desc;
}
http://git-wip-us.apache.org/repos/asf/kylin/blob/64d9b8b8/core-metadata/src/main/java/org/apache/kylin/measure/raw/RawMeasureType.java
----------------------------------------------------------------------
diff --git a/core-metadata/src/main/java/org/apache/kylin/measure/raw/RawMeasureType.java b/core-metadata/src/main/java/org/apache/kylin/measure/raw/RawMeasureType.java
index 3a49d31..a5bb06b 100644
--- a/core-metadata/src/main/java/org/apache/kylin/measure/raw/RawMeasureType.java
+++ b/core-metadata/src/main/java/org/apache/kylin/measure/raw/RawMeasureType.java
@@ -197,18 +197,12 @@ public class RawMeasureType extends MeasureType<List<ByteArray>> {
if (sqlDigest.isRawQuery) {
for (MeasureDesc measureDesc : measureDescs) {
TblColRef col = this.getRawColumn(measureDesc.getFunction());
- ParameterDesc colParameter = new ParameterDesc();
- colParameter.setType("column");
- colParameter.setValue(col.getName());
- FunctionDesc rawFunc = new FunctionDesc();
- rawFunc.setExpression("RAW");
- rawFunc.setParameter(colParameter);
+ ParameterDesc colParameter = ParameterDesc.newInstance(col);
+ FunctionDesc rawFunc = FunctionDesc.newInstance("RAW", colParameter, null);
if (sqlDigest.allColumns.contains(col)) {
if (measureDesc.getFunction().equals(rawFunc)) {
- FunctionDesc sumFunc = new FunctionDesc();
- sumFunc.setExpression("SUM");
- sumFunc.setParameter(colParameter);
+ FunctionDesc sumFunc = FunctionDesc.newInstance("SUM", colParameter, null);
sqlDigest.aggregations.remove(sumFunc);
sqlDigest.aggregations.add(rawFunc);
logger.info("Add RAW measure on column " + col);
http://git-wip-us.apache.org/repos/asf/kylin/blob/64d9b8b8/core-metadata/src/main/java/org/apache/kylin/metadata/model/FunctionDesc.java
----------------------------------------------------------------------
diff --git a/core-metadata/src/main/java/org/apache/kylin/metadata/model/FunctionDesc.java b/core-metadata/src/main/java/org/apache/kylin/metadata/model/FunctionDesc.java
index b9e5543..832cb4a 100644
--- a/core-metadata/src/main/java/org/apache/kylin/metadata/model/FunctionDesc.java
+++ b/core-metadata/src/main/java/org/apache/kylin/metadata/model/FunctionDesc.java
@@ -40,6 +40,15 @@ import com.google.common.collect.Sets;
@JsonAutoDetect(fieldVisibility = Visibility.NONE, getterVisibility = Visibility.NONE, isGetterVisibility = Visibility.NONE, setterVisibility = Visibility.NONE)
public class FunctionDesc {
+ public static FunctionDesc newInstance(String expression, ParameterDesc param, String returnType) {
+ FunctionDesc r = new FunctionDesc();
+ r.expression = (expression == null) ? null : expression.toUpperCase();
+ r.parameter = param;
+ r.returnType = returnType;
+ r.returnDataType = DataType.getType(returnType);
+ return r;
+ }
+
public static final String FUNC_SUM = "SUM";
public static final String FUNC_MIN = "MIN";
public static final String FUNC_MAX = "MAX";
@@ -202,18 +211,10 @@ public class FunctionDesc {
return expression;
}
- public void setExpression(String expression) {
- this.expression = expression;
- }
-
public ParameterDesc getParameter() {
return parameter;
}
- public void setParameter(ParameterDesc parameter) {
- this.parameter = parameter;
- }
-
public int getParameterCount() {
int count = 0;
for (ParameterDesc p = parameter; p != null; p = p.getNextParameter()) {
@@ -230,19 +231,10 @@ public class FunctionDesc {
return returnDataType;
}
- public void setReturnType(String returnType) {
- this.returnType = returnType;
- this.returnDataType = DataType.getType(returnType);
- }
-
public Map<String, String> getConfiguration() {
return configuration;
}
- public void setConfiguration(Map<String, String> configurations) {
- this.configuration = configurations;
- }
-
@Override
public int hashCode() {
final int prime = 31;
http://git-wip-us.apache.org/repos/asf/kylin/blob/64d9b8b8/core-metadata/src/main/java/org/apache/kylin/metadata/model/ParameterDesc.java
----------------------------------------------------------------------
diff --git a/core-metadata/src/main/java/org/apache/kylin/metadata/model/ParameterDesc.java b/core-metadata/src/main/java/org/apache/kylin/metadata/model/ParameterDesc.java
index 4a95fea..c14d061 100644
--- a/core-metadata/src/main/java/org/apache/kylin/metadata/model/ParameterDesc.java
+++ b/core-metadata/src/main/java/org/apache/kylin/metadata/model/ParameterDesc.java
@@ -19,6 +19,7 @@
package org.apache.kylin.metadata.model;
import java.io.UnsupportedEncodingException;
+import java.util.Arrays;
import java.util.List;
import com.fasterxml.jackson.annotation.JsonAutoDetect;
@@ -26,12 +27,42 @@ import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.google.common.collect.ImmutableList;
+import com.google.common.collect.Iterables;
/**
*/
@JsonAutoDetect(fieldVisibility = Visibility.NONE, getterVisibility = Visibility.NONE, isGetterVisibility = Visibility.NONE, setterVisibility = Visibility.NONE)
public class ParameterDesc {
+ public static ParameterDesc newInstance(Object... objs) {
+ if (objs.length == 0)
+ throw new IllegalArgumentException();
+
+ ParameterDesc r = new ParameterDesc();
+
+ Object obj = objs[0];
+ if (obj instanceof TblColRef) {
+ TblColRef col = (TblColRef) obj;
+ r.type = FunctionDesc.PARAMETER_TYPE_COLUMN;
+ r.value = col.getIdentity();
+ r.colRefs = ImmutableList.of(col);
+ } else {
+ r.type = FunctionDesc.PARAMETER_TYPE_CONSTANT;
+ r.value = (String) obj;
+ }
+
+ if (objs.length >= 2) {
+ r.nextParameter = newInstance(Arrays.copyOfRange(objs, 1, objs.length));
+ if (r.nextParameter.colRefs.size() > 0) {
+ if (r.colRefs.isEmpty())
+ r.colRefs = r.nextParameter.colRefs;
+ else
+ r.colRefs = ImmutableList.copyOf(Iterables.concat(r.colRefs, r.nextParameter.colRefs));
+ }
+ }
+ return r;
+ }
+
@JsonProperty("type")
private String type;
@JsonProperty("value")
@@ -47,10 +78,6 @@ public class ParameterDesc {
return type;
}
- public void setType(String type) {
- this.type = type;
- }
-
public byte[] getBytes() throws UnsupportedEncodingException {
return value.getBytes("UTF-8");
}
@@ -58,16 +85,16 @@ public class ParameterDesc {
public String getValue() {
return value;
}
-
- public void setValue(String value) {
+
+ void setValue(String value) {
this.value = value;
}
public List<TblColRef> getColRefs() {
return colRefs;
}
-
- public void setColRefs(List<TblColRef> colRefs) {
+
+ void setColRefs(List<TblColRef> colRefs) {
this.colRefs = colRefs;
}
@@ -75,10 +102,6 @@ public class ParameterDesc {
return nextParameter;
}
- public void setNextParameter(ParameterDesc nextParameter) {
- this.nextParameter = nextParameter;
- }
-
public boolean isColumnType() {
return FunctionDesc.PARAMETER_TYPE_COLUMN.equals(type);
}
http://git-wip-us.apache.org/repos/asf/kylin/blob/64d9b8b8/core-storage/src/test/java/org/apache/kylin/storage/StorageMockUtils.java
----------------------------------------------------------------------
diff --git a/core-storage/src/test/java/org/apache/kylin/storage/StorageMockUtils.java b/core-storage/src/test/java/org/apache/kylin/storage/StorageMockUtils.java
index 0786f32..0706713 100644
--- a/core-storage/src/test/java/org/apache/kylin/storage/StorageMockUtils.java
+++ b/core-storage/src/test/java/org/apache/kylin/storage/StorageMockUtils.java
@@ -36,8 +36,6 @@ import org.apache.kylin.metadata.model.TableRef;
import org.apache.kylin.metadata.model.TblColRef;
import org.apache.kylin.metadata.tuple.TupleInfo;
-import com.google.common.collect.ImmutableList;
-
/**
*/
public class StorageMockUtils {
@@ -83,14 +81,8 @@ public class StorageMockUtils {
TblColRef priceCol = model.findColumn("DEFAULT.TEST_KYLIN_FACTPRICE");
- FunctionDesc f1 = new FunctionDesc();
- f1.setExpression("SUM");
- ParameterDesc p1 = new ParameterDesc();
- p1.setType("column");
- p1.setValue("PRICE");
- p1.setColRefs(ImmutableList.of(priceCol));
- f1.setParameter(p1);
- f1.setReturnType("decimal(19,4)");
+ FunctionDesc f1 = FunctionDesc.newInstance("SUM", //
+ ParameterDesc.newInstance(priceCol), "decimal(19,4)");
functions.add(f1);
return functions;
@@ -102,24 +94,12 @@ public class StorageMockUtils {
TblColRef priceCol = model.findColumn("DEFAULT.TEST_KYLIN_FACT.PRICE");
TblColRef sellerCol = model.findColumn("DEFAULT.TEST_KYLIN_FACT.SELLER_ID");
- FunctionDesc f1 = new FunctionDesc();
- f1.setExpression("SUM");
- ParameterDesc p1 = new ParameterDesc();
- p1.setType("column");
- p1.setValue("PRICE");
- p1.setColRefs(ImmutableList.of(priceCol));
- f1.setParameter(p1);
- f1.setReturnType("decimal(19,4)");
+ FunctionDesc f1 = FunctionDesc.newInstance("SUM", //
+ ParameterDesc.newInstance(priceCol), "decimal(19,4)");
functions.add(f1);
- FunctionDesc f2 = new FunctionDesc();
- f2.setExpression("COUNT_DISTINCT");
- ParameterDesc p2 = new ParameterDesc();
- p2.setType("column");
- p2.setValue("SELLER_ID");
- p2.setColRefs(ImmutableList.of(sellerCol));
- f2.setParameter(p2);
- f2.setReturnType("hllc(10)");
+ FunctionDesc f2 = FunctionDesc.newInstance("COUNT_DISTINCT", //
+ ParameterDesc.newInstance(sellerCol), "hllc(10)");
functions.add(f2);
return functions;
http://git-wip-us.apache.org/repos/asf/kylin/blob/64d9b8b8/query/src/main/java/org/apache/kylin/query/relnode/OLAPAggregateRel.java
----------------------------------------------------------------------
diff --git a/query/src/main/java/org/apache/kylin/query/relnode/OLAPAggregateRel.java b/query/src/main/java/org/apache/kylin/query/relnode/OLAPAggregateRel.java
index 62351d3..24933f5 100644
--- a/query/src/main/java/org/apache/kylin/query/relnode/OLAPAggregateRel.java
+++ b/query/src/main/java/org/apache/kylin/query/relnode/OLAPAggregateRel.java
@@ -19,7 +19,6 @@
package org.apache.kylin.query.relnode;
import java.util.ArrayList;
-import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@@ -238,16 +237,11 @@ public class OLAPAggregateRel extends Aggregate implements OLAPRel {
int index = aggCall.getArgList().get(0);
TblColRef column = inputColumnRowType.getColumnByIndex(index);
if (!column.isInnerColumn()) {
- parameter = new ParameterDesc();
- parameter.setValue(column.getName());
- parameter.setType(FunctionDesc.PARAMETER_TYPE_COLUMN);
- parameter.setColRefs(Arrays.asList(column));
+ parameter = ParameterDesc.newInstance(column);
}
}
- FunctionDesc aggFunc = new FunctionDesc();
- String funcName = getAggrFuncName(aggCall);
- aggFunc.setExpression(funcName);
- aggFunc.setParameter(parameter);
+ String expression = getAggrFuncName(aggCall);
+ FunctionDesc aggFunc = FunctionDesc.newInstance(expression, parameter, null);
this.aggregations.add(aggFunc);
}
}
[5/6] kylin git commit: KYLIN-1875 fix PK-FK derive from each other
Posted by li...@apache.org.
KYLIN-1875 fix PK-FK derive from each other
Project: http://git-wip-us.apache.org/repos/asf/kylin/repo
Commit: http://git-wip-us.apache.org/repos/asf/kylin/commit/92e4d464
Tree: http://git-wip-us.apache.org/repos/asf/kylin/tree/92e4d464
Diff: http://git-wip-us.apache.org/repos/asf/kylin/diff/92e4d464
Branch: refs/heads/master
Commit: 92e4d464069745f0c58cc0559e054efa470960c1
Parents: 79e4801
Author: Yang Li <li...@apache.org>
Authored: Thu Dec 1 21:42:52 2016 +0800
Committer: Li Yang <li...@apache.org>
Committed: Wed Dec 7 17:53:39 2016 +0800
----------------------------------------------------------------------
.../java/org/apache/kylin/cube/CubeManager.java | 8 +--
.../org/apache/kylin/cube/model/CubeDesc.java | 52 +++++++++++---------
.../storage/gtrecord/CubeTupleConverter.java | 2 +-
.../gtrecord/GTCubeStorageQueryBase.java | 2 +-
.../translate/DerivedFilterTranslator.java | 2 +-
.../apache/kylin/query/ITKylinQueryTest.java | 2 +-
.../query/enumerator/LookupTableEnumerator.java | 2 +-
.../storage/hbase/cube/v1/CubeStorageQuery.java | 2 +-
.../hbase/cube/v1/CubeTupleConverter.java | 2 +-
9 files changed, 41 insertions(+), 33 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/kylin/blob/92e4d464/core-cube/src/main/java/org/apache/kylin/cube/CubeManager.java
----------------------------------------------------------------------
diff --git a/core-cube/src/main/java/org/apache/kylin/cube/CubeManager.java b/core-cube/src/main/java/org/apache/kylin/cube/CubeManager.java
index bda1423..fe2030a 100644
--- a/core-cube/src/main/java/org/apache/kylin/cube/CubeManager.java
+++ b/core-cube/src/main/java/org/apache/kylin/cube/CubeManager.java
@@ -44,7 +44,6 @@ import org.apache.kylin.common.util.Dictionary;
import org.apache.kylin.common.util.Pair;
import org.apache.kylin.cube.model.CubeDesc;
import org.apache.kylin.cube.model.DictionaryDesc;
-import org.apache.kylin.cube.model.DimensionDesc;
import org.apache.kylin.dict.DictionaryInfo;
import org.apache.kylin.dict.DictionaryManager;
import org.apache.kylin.dict.lookup.LookupStringTable;
@@ -54,6 +53,7 @@ import org.apache.kylin.metadata.MetadataManager;
import org.apache.kylin.metadata.cachesync.Broadcaster;
import org.apache.kylin.metadata.cachesync.Broadcaster.Event;
import org.apache.kylin.metadata.cachesync.CaseInsensitiveStringCache;
+import org.apache.kylin.metadata.model.JoinDesc;
import org.apache.kylin.metadata.model.SegmentStatusEnum;
import org.apache.kylin.metadata.model.Segments;
import org.apache.kylin.metadata.model.TableDesc;
@@ -629,10 +629,10 @@ public class CubeManager implements IRealizationProvider {
cubeMap.removeLocal(cubeName);
}
- public LookupStringTable getLookupTable(CubeSegment cubeSegment, DimensionDesc dim) {
+ public LookupStringTable getLookupTable(CubeSegment cubeSegment, JoinDesc join) {
- String tableName = dim.getTableRef().getTableIdentity();
- String[] pkCols = dim.getJoin().getPrimaryKey();
+ String tableName = join.getPKSide().getTableIdentity();
+ String[] pkCols = join.getPrimaryKey();
String snapshotResPath = cubeSegment.getSnapshotResPath(tableName);
if (snapshotResPath == null)
throw new IllegalStateException("No snaphot for table '" + tableName + "' found on cube segment" + cubeSegment.getCubeInstance().getName() + "/" + cubeSegment);
http://git-wip-us.apache.org/repos/asf/kylin/blob/92e4d464/core-cube/src/main/java/org/apache/kylin/cube/model/CubeDesc.java
----------------------------------------------------------------------
diff --git a/core-cube/src/main/java/org/apache/kylin/cube/model/CubeDesc.java b/core-cube/src/main/java/org/apache/kylin/cube/model/CubeDesc.java
index f95cceb..f8c316c 100644
--- a/core-cube/src/main/java/org/apache/kylin/cube/model/CubeDesc.java
+++ b/core-cube/src/main/java/org/apache/kylin/cube/model/CubeDesc.java
@@ -62,6 +62,7 @@ import org.apache.kylin.metadata.model.FunctionDesc;
import org.apache.kylin.metadata.model.IEngineAware;
import org.apache.kylin.metadata.model.IStorageAware;
import org.apache.kylin.metadata.model.JoinDesc;
+import org.apache.kylin.metadata.model.JoinTableDesc;
import org.apache.kylin.metadata.model.MeasureDesc;
import org.apache.kylin.metadata.model.TblColRef;
import org.apache.kylin.metadata.project.ProjectInstance;
@@ -101,20 +102,20 @@ public class CubeDesc extends RootPersistentEntity implements IEngineAware {
public static class DeriveInfo {
public DeriveType type;
- public DimensionDesc dimension;
+ public JoinDesc join;
public TblColRef[] columns;
public boolean isOneToOne; // only used when ref from derived to host
- DeriveInfo(DeriveType type, DimensionDesc dimension, TblColRef[] columns, boolean isOneToOne) {
+ DeriveInfo(DeriveType type, JoinDesc join, TblColRef[] columns, boolean isOneToOne) {
this.type = type;
- this.dimension = dimension;
+ this.join = join;
this.columns = columns;
this.isOneToOne = isOneToOne;
}
@Override
public String toString() {
- return "DeriveInfo [type=" + type + ", dimension=" + dimension + ", columns=" + Arrays.toString(columns) + ", isOneToOne=" + isOneToOne + "]";
+ return "DeriveInfo [type=" + type + ", join=" + join + ", columns=" + Arrays.toString(columns) + ", isOneToOne=" + isOneToOne + "]";
}
}
@@ -742,27 +743,34 @@ public class CubeDesc extends RootPersistentEntity implements IEngineAware {
for (int i = 0; i < derivedNames.length; i++) {
derivedCols[i] = initDimensionColRef(dim, derivedNames[i]);
}
- initDerivedMap(dimColArray, DeriveType.LOOKUP, dim, derivedCols, derivedExtra);
+ initDerivedMap(dimColArray, DeriveType.LOOKUP, join, derivedCols, derivedExtra);
}
-
- // PK-FK derive the other side
+
if (join != null) {
- TblColRef[] fk = join.getForeignKeyColumns();
- TblColRef[] pk = join.getPrimaryKeyColumns();
-
- allColumns.addAll(Arrays.asList(fk));
- allColumns.addAll(Arrays.asList(pk));
- for (int i = 0; i < fk.length; i++) {
- int find = ArrayUtils.indexOf(dimColArray, fk[i]);
- if (find >= 0) {
- TblColRef derivedCol = initDimensionColRef(pk[i]);
- initDerivedMap(new TblColRef[] { dimColArray[find] }, DeriveType.PK_FK, dim, new TblColRef[] { derivedCol }, null);
- }
+ allColumns.addAll(Arrays.asList(join.getForeignKeyColumns()));
+ allColumns.addAll(Arrays.asList(join.getPrimaryKeyColumns()));
+ }
+ }
+
+ // PK-FK derive the other side
+ Set<TblColRef> realDimensions = new HashSet<>(listDimensionColumnsExcludingDerived(true));
+ for (JoinTableDesc joinTable : model.getJoinTables()) {
+ JoinDesc join = joinTable.getJoin();
+ int n = join.getForeignKeyColumns().length;
+ for (int i = 0; i < n; i++) {
+ TblColRef pk = join.getPrimaryKeyColumns()[i];
+ TblColRef fk = join.getForeignKeyColumns()[i];
+ if (realDimensions.contains(pk) && !realDimensions.contains(fk)) {
+ initDimensionColRef(fk);
+ initDerivedMap(new TblColRef[] { pk }, DeriveType.PK_FK, join, new TblColRef[] { fk }, null);
+ } else if (realDimensions.contains(fk) && !realDimensions.contains(pk)) {
+ initDimensionColRef(pk);
+ initDerivedMap(new TblColRef[] { fk }, DeriveType.PK_FK, join, new TblColRef[] { pk }, null);
}
}
}
}
-
+
private String[][] splitDerivedColumnAndExtra(String[] derived) {
String[] cols = new String[derived.length];
String[] extra = new String[derived.length];
@@ -780,7 +788,7 @@ public class CubeDesc extends RootPersistentEntity implements IEngineAware {
return new String[][] { cols, extra };
}
- private void initDerivedMap(TblColRef[] hostCols, DeriveType type, DimensionDesc dimension, TblColRef[] derivedCols, String[] extra) {
+ private void initDerivedMap(TblColRef[] hostCols, DeriveType type, JoinDesc join, TblColRef[] derivedCols, String[] extra) {
if (hostCols.length == 0 || derivedCols.length == 0)
throw new IllegalStateException("host/derived columns must not be empty");
@@ -803,12 +811,12 @@ public class CubeDesc extends RootPersistentEntity implements IEngineAware {
if (infoList == null) {
hostToMap.put(hostColArray, infoList = new ArrayList<DeriveInfo>());
}
- infoList.add(new DeriveInfo(type, dimension, derivedCols, false));
+ infoList.add(new DeriveInfo(type, join, derivedCols, false));
for (int i = 0; i < derivedCols.length; i++) {
TblColRef derivedCol = derivedCols[i];
boolean isOneToOne = type == DeriveType.PK_FK || ArrayUtils.contains(hostCols, derivedCol) || (extra != null && extra[i].contains("1-1"));
- toHostMap.put(derivedCol, new DeriveInfo(type, dimension, hostCols, isOneToOne));
+ toHostMap.put(derivedCol, new DeriveInfo(type, join, hostCols, isOneToOne));
}
}
http://git-wip-us.apache.org/repos/asf/kylin/blob/92e4d464/core-storage/src/main/java/org/apache/kylin/storage/gtrecord/CubeTupleConverter.java
----------------------------------------------------------------------
diff --git a/core-storage/src/main/java/org/apache/kylin/storage/gtrecord/CubeTupleConverter.java b/core-storage/src/main/java/org/apache/kylin/storage/gtrecord/CubeTupleConverter.java
index 7ec24b2..3159318 100644
--- a/core-storage/src/main/java/org/apache/kylin/storage/gtrecord/CubeTupleConverter.java
+++ b/core-storage/src/main/java/org/apache/kylin/storage/gtrecord/CubeTupleConverter.java
@@ -266,7 +266,7 @@ public class CubeTupleConverter {
case LOOKUP:
return new IDerivedColumnFiller() {
CubeManager cubeMgr = CubeManager.getInstance(cubeSeg.getCubeInstance().getConfig());
- LookupStringTable lookupTable = cubeMgr.getLookupTable(cubeSeg, deriveInfo.dimension);
+ LookupStringTable lookupTable = cubeMgr.getLookupTable(cubeSeg, deriveInfo.join);
int[] derivedColIdx = initDerivedColIdx();
Array<String> lookupKey = new Array<String>(new String[hostTmpIdx.length]);
http://git-wip-us.apache.org/repos/asf/kylin/blob/92e4d464/core-storage/src/main/java/org/apache/kylin/storage/gtrecord/GTCubeStorageQueryBase.java
----------------------------------------------------------------------
diff --git a/core-storage/src/main/java/org/apache/kylin/storage/gtrecord/GTCubeStorageQueryBase.java b/core-storage/src/main/java/org/apache/kylin/storage/gtrecord/GTCubeStorageQueryBase.java
index 9c74cca..31573d0 100644
--- a/core-storage/src/main/java/org/apache/kylin/storage/gtrecord/GTCubeStorageQueryBase.java
+++ b/core-storage/src/main/java/org/apache/kylin/storage/gtrecord/GTCubeStorageQueryBase.java
@@ -294,7 +294,7 @@ public abstract class GTCubeStorageQueryBase implements IStorageQuery {
DeriveInfo hostInfo = cubeDesc.getHostInfo(derived);
CubeManager cubeMgr = CubeManager.getInstance(this.cubeInstance.getConfig());
CubeSegment seg = cubeInstance.getLatestReadySegment();
- LookupStringTable lookup = cubeMgr.getLookupTable(seg, hostInfo.dimension);
+ LookupStringTable lookup = cubeMgr.getLookupTable(seg, hostInfo.join);
Pair<TupleFilter, Boolean> translated = DerivedFilterTranslator.translate(lookup, hostInfo, compf);
TupleFilter translatedFilter = translated.getFirst();
boolean loosened = translated.getSecond();
http://git-wip-us.apache.org/repos/asf/kylin/blob/92e4d464/core-storage/src/main/java/org/apache/kylin/storage/translate/DerivedFilterTranslator.java
----------------------------------------------------------------------
diff --git a/core-storage/src/main/java/org/apache/kylin/storage/translate/DerivedFilterTranslator.java b/core-storage/src/main/java/org/apache/kylin/storage/translate/DerivedFilterTranslator.java
index 160338f..13c655c 100644
--- a/core-storage/src/main/java/org/apache/kylin/storage/translate/DerivedFilterTranslator.java
+++ b/core-storage/src/main/java/org/apache/kylin/storage/translate/DerivedFilterTranslator.java
@@ -54,7 +54,7 @@ public class DerivedFilterTranslator {
TblColRef derivedCol = compf.getColumn();
TblColRef[] hostCols = hostInfo.columns;
- TblColRef[] pkCols = hostInfo.dimension.getJoin().getPrimaryKeyColumns();
+ TblColRef[] pkCols = hostInfo.join.getPrimaryKeyColumns();
if (hostInfo.type == DeriveType.PK_FK) {
assert hostCols.length == 1;
http://git-wip-us.apache.org/repos/asf/kylin/blob/92e4d464/kylin-it/src/test/java/org/apache/kylin/query/ITKylinQueryTest.java
----------------------------------------------------------------------
diff --git a/kylin-it/src/test/java/org/apache/kylin/query/ITKylinQueryTest.java b/kylin-it/src/test/java/org/apache/kylin/query/ITKylinQueryTest.java
index 90324b5..6d91753 100644
--- a/kylin-it/src/test/java/org/apache/kylin/query/ITKylinQueryTest.java
+++ b/kylin-it/src/test/java/org/apache/kylin/query/ITKylinQueryTest.java
@@ -48,7 +48,7 @@ import org.junit.rules.ExpectedException;
import com.google.common.collect.Maps;
-@Ignore("KylinQueryTest is contained by ITCombinationTest")
+//@Ignore("KylinQueryTest is contained by ITCombinationTest")
public class ITKylinQueryTest extends KylinTestBase {
@Rule
http://git-wip-us.apache.org/repos/asf/kylin/blob/92e4d464/query/src/main/java/org/apache/kylin/query/enumerator/LookupTableEnumerator.java
----------------------------------------------------------------------
diff --git a/query/src/main/java/org/apache/kylin/query/enumerator/LookupTableEnumerator.java b/query/src/main/java/org/apache/kylin/query/enumerator/LookupTableEnumerator.java
index 1c2bc2d..28ee623 100644
--- a/query/src/main/java/org/apache/kylin/query/enumerator/LookupTableEnumerator.java
+++ b/query/src/main/java/org/apache/kylin/query/enumerator/LookupTableEnumerator.java
@@ -67,7 +67,7 @@ public class LookupTableEnumerator implements Enumerator<Object[]> {
throw new IllegalStateException("No dimension with derived columns found for lookup table " + lookupTableName + ", cube desc " + cube.getDescriptor());
CubeManager cubeMgr = CubeManager.getInstance(cube.getConfig());
- LookupStringTable table = cubeMgr.getLookupTable(cube.getLatestReadySegment(), dim);
+ LookupStringTable table = cubeMgr.getLookupTable(cube.getLatestReadySegment(), dim.getJoin());
this.allRows = table.getAllRows();
OLAPTable olapTable = (OLAPTable) olapContext.firstTableScan.getOlapTable();
http://git-wip-us.apache.org/repos/asf/kylin/blob/92e4d464/storage-hbase/src/main/java/org/apache/kylin/storage/hbase/cube/v1/CubeStorageQuery.java
----------------------------------------------------------------------
diff --git a/storage-hbase/src/main/java/org/apache/kylin/storage/hbase/cube/v1/CubeStorageQuery.java b/storage-hbase/src/main/java/org/apache/kylin/storage/hbase/cube/v1/CubeStorageQuery.java
index 02aa64a..75c3fd7 100644
--- a/storage-hbase/src/main/java/org/apache/kylin/storage/hbase/cube/v1/CubeStorageQuery.java
+++ b/storage-hbase/src/main/java/org/apache/kylin/storage/hbase/cube/v1/CubeStorageQuery.java
@@ -368,7 +368,7 @@ public class CubeStorageQuery implements IStorageQuery {
DeriveInfo hostInfo = cubeDesc.getHostInfo(derived);
CubeManager cubeMgr = CubeManager.getInstance(this.cubeInstance.getConfig());
CubeSegment seg = cubeInstance.getLatestReadySegment();
- LookupStringTable lookup = cubeMgr.getLookupTable(seg, hostInfo.dimension);
+ LookupStringTable lookup = cubeMgr.getLookupTable(seg, hostInfo.join);
Pair<TupleFilter, Boolean> translated = DerivedFilterTranslator.translate(lookup, hostInfo, compf);
TupleFilter translatedFilter = translated.getFirst();
boolean loosened = translated.getSecond();
http://git-wip-us.apache.org/repos/asf/kylin/blob/92e4d464/storage-hbase/src/main/java/org/apache/kylin/storage/hbase/cube/v1/CubeTupleConverter.java
----------------------------------------------------------------------
diff --git a/storage-hbase/src/main/java/org/apache/kylin/storage/hbase/cube/v1/CubeTupleConverter.java b/storage-hbase/src/main/java/org/apache/kylin/storage/hbase/cube/v1/CubeTupleConverter.java
index d2378b9..64feff0 100644
--- a/storage-hbase/src/main/java/org/apache/kylin/storage/hbase/cube/v1/CubeTupleConverter.java
+++ b/storage-hbase/src/main/java/org/apache/kylin/storage/hbase/cube/v1/CubeTupleConverter.java
@@ -220,7 +220,7 @@ public class CubeTupleConverter {
case LOOKUP:
return new IDerivedColumnFiller() {
CubeManager cubeMgr = CubeManager.getInstance(cubeSeg.getCubeInstance().getConfig());
- LookupStringTable lookupTable = cubeMgr.getLookupTable(cubeSeg, deriveInfo.dimension);
+ LookupStringTable lookupTable = cubeMgr.getLookupTable(cubeSeg, deriveInfo.join);
int[] derivedColIdx = initDerivedColIdx();
Array<String> lookupKey = new Array<String>(new String[hostColIdx.length]);