You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lens.apache.org by pr...@apache.org on 2017/04/12 13:03:46 UTC

[03/20] lens git commit: LENS-1381: Support Fact to Fact Union

http://git-wip-us.apache.org/repos/asf/lens/blob/ae83caae/lens-cube/src/test/resources/schema/facts/cheapfact.xml
----------------------------------------------------------------------
diff --git a/lens-cube/src/test/resources/schema/facts/cheapfact.xml b/lens-cube/src/test/resources/schema/facts/cheapfact.xml
new file mode 100644
index 0000000..2b11c5b
--- /dev/null
+++ b/lens-cube/src/test/resources/schema/facts/cheapfact.xml
@@ -0,0 +1,101 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<!--
+
+  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.
+
+-->
+<x_fact_table name="cheapfact" cube_name="testCube" weight="0.0" xmlns="uri:lens:cube:0.1">
+  <columns>
+    <column name="msr21" _type="float" comment="second measure"/>
+    <column name="msr4" _type="bigint" comment="fourth measure"/>
+    <column name="msr15" _type="int" comment="fifteenth measure"/>
+    <column name="union_join_ctx_msr3" _type="int" comment="union_join_ctx_third measure"/>
+    <column name="newmeasure" _type="bigint" comment="measure available  from now"/>
+    <column name="union_join_ctx_msr2" _type="int" comment="union_join_ctx_second measure"/>
+    <column name="msr2" _type="float" comment="second measure"/>
+    <column name="msr3" _type="double" comment="third measure"/>
+    <column name="msr22" _type="float" comment="second measure"/>
+    <column name="msr9" _type="bigint" comment="ninth measure"/>
+    <column name="msr1" _type="int" comment="first measure"/>
+    <column name="noaggrmsr" _type="bigint" comment="measure without a default aggregate"/>
+    <column name="union_join_ctx_msr1" _type="int" comment="union_join_ctx_first measure"/>
+    <column name="zipcode" _type="int" comment="zip"/>
+    <column name="cityid" _type="int" comment="city id"/>
+    <column name="stateid" _type="int" comment="city id"/>
+    <column name="test_time_dim_hour_id" _type="int" comment="time id"/>
+    <column name="ambigdim1" _type="string" comment="used in testColumnAmbiguity"/>
+  </columns>
+  <properties>
+    <property name="cube.table.cheapfact.weight" value="0.0"/>
+    <property name="cube.fact.relative.start.time" value="now.year - 90 days"/>
+    <property name="cube.fact.cheapfact.cubename" value="testCube"/>
+    <property name="cube.fact.cheapfact.c99.updateperiods" value="MONTHLY,HOURLY,YEARLY,QUARTERLY,MINUTELY,DAILY"/>
+    <property name="cube.fact.cheapfact.storages" value="C99,C0"/>
+    <property name="cube.fact.cheapfact.c0.updateperiods" value="MONTHLY,HOURLY,YEARLY,QUARTERLY,MINUTELY,DAILY"/>
+  </properties>
+  <storage_tables>
+    <storage_table>
+      <update_periods>
+        <update_period>MINUTELY</update_period>
+        <update_period>HOURLY</update_period>
+        <update_period>DAILY</update_period>
+        <update_period>MONTHLY</update_period>
+        <update_period>QUARTERLY</update_period>
+        <update_period>YEARLY</update_period>
+      </update_periods>
+      <storage_name>C99</storage_name>
+      <table_desc external="false">
+        <part_cols>
+          <column name="ttd" _type="string" comment="test date partition"/>
+          <column name="ttd2" _type="string" comment="test date partition"/>
+        </part_cols>
+        <table_parameters>
+          <property name="cube.storagetable.time.partcols" value="ttd,ttd2"/>
+        </table_parameters>
+        <serde_parameters>
+          <property name="serialization.format" value="1"/>
+        </serde_parameters>
+        <time_part_cols>ttd</time_part_cols>
+        <time_part_cols>ttd2</time_part_cols>
+      </table_desc>
+    </storage_table>
+    <storage_table>
+      <update_periods>
+        <update_period>MINUTELY</update_period>
+        <update_period>HOURLY</update_period>
+        <update_period>DAILY</update_period>
+        <update_period>MONTHLY</update_period>
+        <update_period>QUARTERLY</update_period>
+        <update_period>YEARLY</update_period>
+      </update_periods>
+      <storage_name>C0</storage_name>
+      <table_desc external="false">
+        <part_cols>
+          <column name="dt" _type="string" comment="date partition"/>
+        </part_cols>
+        <table_parameters>
+          <property name="cube.storagetable.end.times" value="now - 5 years, 2010"/>
+          <property name="cube.storagetable.start.times" value="2000, now - 10 years"/>
+        </table_parameters>
+        <serde_parameters>
+          <property name="serialization.format" value="1"/>
+        </serde_parameters>
+      </table_desc>
+    </storage_table>
+  </storage_tables>
+</x_fact_table>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lens/blob/ae83caae/lens-cube/src/test/resources/schema/facts/summary1.xml
----------------------------------------------------------------------
diff --git a/lens-cube/src/test/resources/schema/facts/summary1.xml b/lens-cube/src/test/resources/schema/facts/summary1.xml
new file mode 100644
index 0000000..44756c9
--- /dev/null
+++ b/lens-cube/src/test/resources/schema/facts/summary1.xml
@@ -0,0 +1,101 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<!--
+
+  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.
+
+-->
+<x_fact_table name="summary1" cube_name="testCube" weight="10.0" xmlns="uri:lens:cube:0.1">
+  <columns>
+    <column name="msr21" _type="float" comment="second measure"/>
+    <column name="msr4" _type="bigint" comment="fourth measure"/>
+    <column name="msr15" _type="int" comment="fifteenth measure"/>
+    <column name="union_join_ctx_msr3" _type="int" comment="union_join_ctx_third measure"/>
+    <column name="newmeasure" _type="bigint" comment="measure available  from now"/>
+    <column name="union_join_ctx_msr2" _type="int" comment="union_join_ctx_second measure"/>
+    <column name="msr2" _type="float" comment="second measure"/>
+    <column name="msr3" _type="double" comment="third measure"/>
+    <column name="msr22" _type="float" comment="second measure"/>
+    <column name="msr9" _type="bigint" comment="ninth measure"/>
+    <column name="msr1" _type="int" comment="first measure"/>
+    <column name="noaggrmsr" _type="bigint" comment="measure without a default aggregate"/>
+    <column name="union_join_ctx_msr1" _type="int" comment="union_join_ctx_first measure"/>
+    <column name="dim1" _type="string" comment="dim1"/>
+    <column name="dim2" _type="string" comment="dim2"/>
+    <column name="testdim3id" _type="string" comment="dim2"/>
+    <column name="dim2big" _type="string" comment="dim2"/>
+    <column name="zipcode" _type="int" comment="zip"/>
+    <column name="cityid" _type="int" comment="city id"/>
+  </columns>
+  <properties>
+    <property name="cube.fact.relative.start.time" value="now.year - 90 days"/>
+    <property name="cube.fact.summary1.cubename" value="testCube"/>
+    <property name="cube.table.summary1.weight" value="10.0"/>
+    <property name="cube.fact.summary1.c2.updateperiods" value="HOURLY,MINUTELY,DAILY"/>
+    <property name="cube.fact.summary1.storages" value="C1,C2"/>
+    <property name="cube.fact.summary1.c1.updateperiods" value="HOURLY,MINUTELY,DAILY"/>
+    <property name="cube.fact.summary1.valid.columns"
+              value="msr21,msr4,msr15,union_join_ctx_msr3,newmeasure,union_join_ctx_msr2,msr2,msr3,msr22,msr9,msr1,noAggrMsr,union_join_ctx_msr1,,dim1,testdim3id"/>
+  </properties>
+  <storage_tables>
+    <storage_table>
+      <update_periods>
+        <update_period>MINUTELY</update_period>
+        <update_period>HOURLY</update_period>
+        <update_period>DAILY</update_period>
+      </update_periods>
+      <storage_name>C1</storage_name>
+      <table_desc external="false">
+        <part_cols>
+          <column name="dt" _type="string" comment="date partition"/>
+        </part_cols>
+        <table_parameters>
+          <property name="transient_lastDdlTime" value="1488970819"/>
+          <property name="cube.storagetable.time.partcols" value="dt"/>
+        </table_parameters>
+        <serde_parameters>
+          <property name="serialization.format" value="1"/>
+        </serde_parameters>
+        <time_part_cols>dt</time_part_cols>
+      </table_desc>
+    </storage_table>
+    <storage_table>
+      <update_periods>
+        <update_period>MINUTELY</update_period>
+        <update_period>HOURLY</update_period>
+        <update_period>DAILY</update_period>
+      </update_periods>
+      <storage_name>C2</storage_name>
+      <table_desc external="false">
+        <part_cols>
+          <column name="pt" _type="string" comment="p time"/>
+          <column name="it" _type="string" comment="i time"/>
+          <column name="et" _type="string" comment="e time"/>
+        </part_cols>
+        <table_parameters>
+          <property name="cube.storagetable.time.partcols" value="pt,it,et"/>
+        </table_parameters>
+        <serde_parameters>
+          <property name="serialization.format" value="1"/>
+        </serde_parameters>
+        <time_part_cols>pt</time_part_cols>
+        <time_part_cols>it</time_part_cols>
+        <time_part_cols>et</time_part_cols>
+      </table_desc>
+    </storage_table>
+  </storage_tables>
+</x_fact_table>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lens/blob/ae83caae/lens-cube/src/test/resources/schema/facts/summary2.xml
----------------------------------------------------------------------
diff --git a/lens-cube/src/test/resources/schema/facts/summary2.xml b/lens-cube/src/test/resources/schema/facts/summary2.xml
new file mode 100644
index 0000000..380801f
--- /dev/null
+++ b/lens-cube/src/test/resources/schema/facts/summary2.xml
@@ -0,0 +1,103 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<!--
+
+  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.
+
+-->
+<x_fact_table name="summary2" cube_name="testCube" weight="20.0" xmlns="uri:lens:cube:0.1">
+  <columns>
+    <column name="msr21" _type="float" comment="second measure"/>
+    <column name="msr4" _type="bigint" comment="fourth measure"/>
+    <column name="msr15" _type="int" comment="fifteenth measure"/>
+    <column name="union_join_ctx_msr3" _type="int" comment="union_join_ctx_third measure"/>
+    <column name="newmeasure" _type="bigint" comment="measure available  from now"/>
+    <column name="union_join_ctx_msr2" _type="int" comment="union_join_ctx_second measure"/>
+    <column name="msr2" _type="float" comment="second measure"/>
+    <column name="msr3" _type="double" comment="third measure"/>
+    <column name="msr22" _type="float" comment="second measure"/>
+    <column name="msr9" _type="bigint" comment="ninth measure"/>
+    <column name="msr1" _type="int" comment="first measure"/>
+    <column name="noaggrmsr" _type="bigint" comment="measure without a default aggregate"/>
+    <column name="union_join_ctx_msr1" _type="int" comment="union_join_ctx_first measure"/>
+    <column name="dim1" _type="string" comment="dim1"/>
+    <column name="dim2" _type="string" comment="dim2"/>
+    <column name="testdim3id" _type="string" comment="dim2"/>
+    <column name="dim2big" _type="string" comment="dim2"/>
+    <column name="zipcode" _type="int" comment="zip"/>
+    <column name="cityid" _type="int" comment="city id"/>
+  </columns>
+  <properties>
+    <property name="cube.fact.relative.start.time" value="now.year - 90 days"/>
+    <property name="cube.fact.summary2.cubename" value="testCube"/>
+    <property name="transient_lastDdlTime" value="1488970827"/>
+    <property name="cube.fact.summary2.c2.updateperiods" value="HOURLY,MINUTELY,DAILY"/>
+    <property name="cube.fact.summary2.storages" value="C1,C2"/>
+    <property name="cube.table.summary2.weight" value="20.0"/>
+    <property name="cube.fact.summary2.valid.columns"
+              value="msr21,msr4,msr15,union_join_ctx_msr3,newmeasure,union_join_ctx_msr2,msr2,msr3,msr22,msr9,msr1,noAggrMsr,union_join_ctx_msr1,,dim1,dim2"/>
+    <property name="cube.fact.summary2.c1.updateperiods" value="HOURLY,MINUTELY,DAILY"/>
+    <property name="cube.fact.summary1.valid.columns"
+              value="msr21,msr4,msr15,union_join_ctx_msr3,newmeasure,union_join_ctx_msr2,msr2,msr3,msr22,msr9,msr1,noAggrMsr,union_join_ctx_msr1,,dim1,testdim3id"/>
+  </properties>
+  <storage_tables>
+    <storage_table>
+      <update_periods>
+        <update_period>MINUTELY</update_period>
+        <update_period>HOURLY</update_period>
+        <update_period>DAILY</update_period>
+      </update_periods>
+      <storage_name>C1</storage_name>
+      <table_desc external="false">
+        <part_cols>
+          <column name="dt" _type="string" comment="date partition"/>
+        </part_cols>
+        <table_parameters>
+          <property name="cube.storagetable.time.partcols" value="dt"/>
+        </table_parameters>
+        <serde_parameters>
+          <property name="serialization.format" value="1"/>
+        </serde_parameters>
+        <time_part_cols>dt</time_part_cols>
+      </table_desc>
+    </storage_table>
+    <storage_table>
+      <update_periods>
+        <update_period>MINUTELY</update_period>
+        <update_period>HOURLY</update_period>
+        <update_period>DAILY</update_period>
+      </update_periods>
+      <storage_name>C2</storage_name>
+      <table_desc external="false">
+        <part_cols>
+          <column name="pt" _type="string" comment="p time"/>
+          <column name="it" _type="string" comment="i time"/>
+          <column name="et" _type="string" comment="e time"/>
+        </part_cols>
+        <table_parameters>
+          <property name="cube.storagetable.time.partcols" value="pt,it,et"/>
+        </table_parameters>
+        <serde_parameters>
+          <property name="serialization.format" value="1"/>
+        </serde_parameters>
+        <time_part_cols>pt</time_part_cols>
+        <time_part_cols>it</time_part_cols>
+        <time_part_cols>et</time_part_cols>
+      </table_desc>
+    </storage_table>
+  </storage_tables>
+</x_fact_table>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lens/blob/ae83caae/lens-cube/src/test/resources/schema/facts/summary3.xml
----------------------------------------------------------------------
diff --git a/lens-cube/src/test/resources/schema/facts/summary3.xml b/lens-cube/src/test/resources/schema/facts/summary3.xml
new file mode 100644
index 0000000..77e296c
--- /dev/null
+++ b/lens-cube/src/test/resources/schema/facts/summary3.xml
@@ -0,0 +1,104 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<!--
+
+  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.
+
+-->
+<x_fact_table name="summary3" cube_name="testCube" weight="30.0" xmlns="uri:lens:cube:0.1">
+  <columns>
+    <column name="msr21" _type="float" comment="second measure"/>
+    <column name="msr4" _type="bigint" comment="fourth measure"/>
+    <column name="msr15" _type="int" comment="fifteenth measure"/>
+    <column name="union_join_ctx_msr3" _type="int" comment="union_join_ctx_third measure"/>
+    <column name="newmeasure" _type="bigint" comment="measure available  from now"/>
+    <column name="union_join_ctx_msr2" _type="int" comment="union_join_ctx_second measure"/>
+    <column name="msr2" _type="float" comment="second measure"/>
+    <column name="msr3" _type="double" comment="third measure"/>
+    <column name="msr22" _type="float" comment="second measure"/>
+    <column name="msr9" _type="bigint" comment="ninth measure"/>
+    <column name="msr1" _type="int" comment="first measure"/>
+    <column name="noaggrmsr" _type="bigint" comment="measure without a default aggregate"/>
+    <column name="union_join_ctx_msr1" _type="int" comment="union_join_ctx_first measure"/>
+    <column name="dim1" _type="string" comment="dim1"/>
+    <column name="dim2" _type="string" comment="dim2"/>
+    <column name="testdim3id" _type="string" comment="dim2"/>
+    <column name="dim2big" _type="string" comment="dim2"/>
+    <column name="zipcode" _type="int" comment="zip"/>
+    <column name="cityid" _type="int" comment="city id"/>
+  </columns>
+  <properties>
+    <property name="cube.fact.summary3.c1.updateperiods" value="HOURLY,MINUTELY,DAILY"/>
+    <property name="cube.fact.relative.start.time" value="now.year - 90 days"/>
+    <property name="cube.fact.summary3.storages" value="C1,C2"/>
+    <property name="cube.fact.summary3.valid.columns"
+              value="msr21,msr4,msr15,union_join_ctx_msr3,newmeasure,union_join_ctx_msr2,msr2,msr3,msr22,msr9,msr1,noAggrMsr,union_join_ctx_msr1,,dim1,dim2,cityid,stateid"/>
+    <property name="cube.fact.summary2.valid.columns"
+              value="msr21,msr4,msr15,union_join_ctx_msr3,newmeasure,union_join_ctx_msr2,msr2,msr3,msr22,msr9,msr1,noAggrMsr,union_join_ctx_msr1,,dim1,dim2"/>
+    <property name="cube.table.summary3.weight" value="30.0"/>
+    <property name="cube.fact.summary3.cubename" value="testCube"/>
+    <property name="cube.fact.summary3.c2.updateperiods" value="HOURLY,MINUTELY,DAILY"/>
+    <property name="cube.fact.summary1.valid.columns"
+              value="msr21,msr4,msr15,union_join_ctx_msr3,newmeasure,union_join_ctx_msr2,msr2,msr3,msr22,msr9,msr1,noAggrMsr,union_join_ctx_msr1,,dim1,testdim3id"/>
+  </properties>
+  <storage_tables>
+    <storage_table>
+      <update_periods>
+        <update_period>MINUTELY</update_period>
+        <update_period>HOURLY</update_period>
+        <update_period>DAILY</update_period>
+      </update_periods>
+      <storage_name>C1</storage_name>
+      <table_desc external="false">
+        <part_cols>
+          <column name="dt" _type="string" comment="date partition"/>
+        </part_cols>
+        <table_parameters>
+          <property name="cube.storagetable.time.partcols" value="dt"/>
+        </table_parameters>
+        <serde_parameters>
+          <property name="serialization.format" value="1"/>
+        </serde_parameters>
+        <time_part_cols>dt</time_part_cols>
+      </table_desc>
+    </storage_table>
+    <storage_table>
+      <update_periods>
+        <update_period>MINUTELY</update_period>
+        <update_period>HOURLY</update_period>
+        <update_period>DAILY</update_period>
+      </update_periods>
+      <storage_name>C2</storage_name>
+      <table_desc external="false">
+        <part_cols>
+          <column name="pt" _type="string" comment="p time"/>
+          <column name="it" _type="string" comment="i time"/>
+          <column name="et" _type="string" comment="e time"/>
+        </part_cols>
+        <table_parameters>
+          <property name="cube.storagetable.time.partcols" value="pt,it,et"/>
+        </table_parameters>
+        <serde_parameters>
+          <property name="serialization.format" value="1"/>
+        </serde_parameters>
+        <time_part_cols>pt</time_part_cols>
+        <time_part_cols>it</time_part_cols>
+        <time_part_cols>et</time_part_cols>
+      </table_desc>
+    </storage_table>
+  </storage_tables>
+</x_fact_table>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lens/blob/ae83caae/lens-cube/src/test/resources/schema/facts/summary4.xml
----------------------------------------------------------------------
diff --git a/lens-cube/src/test/resources/schema/facts/summary4.xml b/lens-cube/src/test/resources/schema/facts/summary4.xml
new file mode 100644
index 0000000..e26ef68
--- /dev/null
+++ b/lens-cube/src/test/resources/schema/facts/summary4.xml
@@ -0,0 +1,85 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<!--
+
+  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.
+
+-->
+<x_fact_table name="summary4" cube_name="testCube" weight="15.0" xmlns="uri:lens:cube:0.1">
+  <columns>
+    <column name="msr21" _type="float" comment="second measure"/>
+    <column name="msr4" _type="bigint" comment="fourth measure"/>
+    <column name="msr15" _type="int" comment="fifteenth measure"/>
+    <column name="union_join_ctx_msr3" _type="int" comment="union_join_ctx_third measure"/>
+    <column name="newmeasure" _type="bigint" comment="measure available  from now"/>
+    <column name="union_join_ctx_msr2" _type="int" comment="union_join_ctx_second measure"/>
+    <column name="msr2" _type="float" comment="second measure"/>
+    <column name="msr3" _type="double" comment="third measure"/>
+    <column name="msr22" _type="float" comment="second measure"/>
+    <column name="msr9" _type="bigint" comment="ninth measure"/>
+    <column name="msr1" _type="int" comment="first measure"/>
+    <column name="noaggrmsr" _type="bigint" comment="measure without a default aggregate"/>
+    <column name="union_join_ctx_msr1" _type="int" comment="union_join_ctx_first measure"/>
+    <column name="dim1" _type="string" comment="dim1"/>
+    <column name="dim2" _type="string" comment="dim2"/>
+    <column name="testdim3id" _type="string" comment="dim2"/>
+    <column name="dim2big" _type="string" comment="dim2"/>
+    <column name="zipcode" _type="int" comment="zip"/>
+    <column name="cityid" _type="int" comment="city id"/>
+  </columns>
+  <properties>
+    <property name="cube.fact.relative.start.time" value="now.year - 90 days"/>
+    <property name="cube.table.summary4.weight" value="15.0"/>
+    <property name="cube.fact.summary4.storages" value="C2"/>
+    <property name="cube.fact.summary4.valid.columns"
+              value="msr21,msr4,msr15,union_join_ctx_msr3,newmeasure,union_join_ctx_msr2,msr2,msr3,msr22,msr9,msr1,noAggrMsr,union_join_ctx_msr1,,dim1,dim2big1,dim2big2,cityid"/>
+    <property name="cube.fact.summary3.valid.columns"
+              value="msr21,msr4,msr15,union_join_ctx_msr3,newmeasure,union_join_ctx_msr2,msr2,msr3,msr22,msr9,msr1,noAggrMsr,union_join_ctx_msr1,,dim1,dim2,cityid,stateid"/>
+    <property name="cube.fact.summary4.cubename" value="testCube"/>
+    <property name="cube.fact.summary2.valid.columns"
+              value="msr21,msr4,msr15,union_join_ctx_msr3,newmeasure,union_join_ctx_msr2,msr2,msr3,msr22,msr9,msr1,noAggrMsr,union_join_ctx_msr1,,dim1,dim2"/>
+    <property name="cube.fact.summary1.valid.columns"
+              value="msr21,msr4,msr15,union_join_ctx_msr3,newmeasure,union_join_ctx_msr2,msr2,msr3,msr22,msr9,msr1,noAggrMsr,union_join_ctx_msr1,,dim1,testdim3id"/>
+    <property name="cube.fact.summary4.c2.updateperiods" value="HOURLY,MINUTELY,DAILY"/>
+  </properties>
+  <storage_tables>
+    <storage_table>
+      <update_periods>
+        <update_period>MINUTELY</update_period>
+        <update_period>HOURLY</update_period>
+        <update_period>DAILY</update_period>
+      </update_periods>
+      <storage_name>C2</storage_name>
+      <table_desc external="false">
+        <part_cols>
+          <column name="pt" _type="string" comment="p time"/>
+          <column name="it" _type="string" comment="i time"/>
+          <column name="et" _type="string" comment="e time"/>
+        </part_cols>
+        <table_parameters>
+          <property name="cube.storagetable.time.partcols" value="pt,it,et"/>
+        </table_parameters>
+        <serde_parameters>
+          <property name="serialization.format" value="1"/>
+        </serde_parameters>
+        <time_part_cols>pt</time_part_cols>
+        <time_part_cols>it</time_part_cols>
+        <time_part_cols>et</time_part_cols>
+      </table_desc>
+    </storage_table>
+  </storage_tables>
+</x_fact_table>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lens/blob/ae83caae/lens-cube/src/test/resources/schema/facts/testfact.xml
----------------------------------------------------------------------
diff --git a/lens-cube/src/test/resources/schema/facts/testfact.xml b/lens-cube/src/test/resources/schema/facts/testfact.xml
new file mode 100644
index 0000000..aa9322a
--- /dev/null
+++ b/lens-cube/src/test/resources/schema/facts/testfact.xml
@@ -0,0 +1,251 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<!--
+
+  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.
+
+-->
+<x_fact_table name="testfact" cube_name="testCube" weight="5.0" xmlns="uri:lens:cube:0.1">
+  <columns>
+    <column name="msr21" _type="float" comment="second measure"/>
+    <column name="msr4" _type="bigint" comment="fourth measure"/>
+    <column name="union_join_ctx_msr3" _type="int" comment="union_join_ctx_third measure"/>
+    <column name="newmeasure" _type="bigint" comment="measure available  from now"/>
+    <column name="union_join_ctx_msr2" _type="int" comment="union_join_ctx_second measure"/>
+    <column name="msr2" _type="float" comment="second measure"/>
+    <column name="msr3" _type="double" comment="third measure"/>
+    <column name="msr22" _type="float" comment="second measure"/>
+    <column name="msr9" _type="bigint" comment="ninth measure"/>
+    <column name="msr1" _type="int" comment="first measure"/>
+    <column name="noaggrmsr" _type="bigint" comment="measure without a default aggregate"/>
+    <column name="union_join_ctx_msr1" _type="int" comment="union_join_ctx_first measure"/>
+    <column name="msr5" _type="double" comment="msr5"/>
+    <column name="zipcode" _type="int" comment="zip"/>
+    <column name="cityid" _type="int" comment="city id"/>
+    <column name="cityid1" _type="int" comment="city id"/>
+    <column name="stateid" _type="int" comment="city id"/>
+    <column name="test_time_dim_day_id" _type="int" comment="time id"/>
+    <column name="test_time_dim_day_id2" _type="int" comment="time id"/>
+    <column name="ambigdim1" _type="string" comment="used in testColumnAmbiguity"/>
+  </columns>
+  <properties>
+    <property name="cube.fact.testfact.c5.updateperiods"
+              value="MONTHLY,HOURLY,YEARLY,CONTINUOUS,QUARTERLY,MINUTELY,DAILY"/>
+    <property name="cube.fact.testfact.cubename" value="testCube"/>
+    <property name="cube.fact.relative.start.time" value="now.year - 90 days"/>
+    <property name="cube.fact.testfact.c4.updateperiods"
+              value="MONTHLY,HOURLY,YEARLY,CONTINUOUS,QUARTERLY,MINUTELY,DAILY"/>
+    <property name="cube.table.testfact.weight" value="5.0"/>
+    <property name="cube.fact.testfact.c3.updateperiods"
+              value="MONTHLY,HOURLY,YEARLY,CONTINUOUS,QUARTERLY,MINUTELY,DAILY"/>
+    <property name="cube.fact.testfact.c2.updateperiods"
+              value="MONTHLY,HOURLY,YEARLY,CONTINUOUS,QUARTERLY,MINUTELY,DAILY"/>
+    <property name="cube.fact.testfact.storages" value="C3,C4,C5,C0,C1,C2"/>
+    <property name="cube.fact.testfact.c0.updateperiods"
+              value="MONTHLY,HOURLY,YEARLY,CONTINUOUS,QUARTERLY,MINUTELY,DAILY"/>
+    <property name="cube.fact.testfact.c1.updateperiods"
+              value="MONTHLY,HOURLY,YEARLY,CONTINUOUS,QUARTERLY,MINUTELY,DAILY"/>
+  </properties>
+  <storage_tables>
+    <storage_table>
+      <update_periods>
+        <update_period>MINUTELY</update_period>
+        <update_period>HOURLY</update_period>
+        <update_period>DAILY</update_period>
+        <update_period>MONTHLY</update_period>
+        <update_period>QUARTERLY</update_period>
+        <update_period>YEARLY</update_period>
+        <update_period>CONTINUOUS</update_period>
+      </update_periods>
+      <storage_name>C3</storage_name>
+      <table_desc external="false">
+        <part_cols>
+          <column name="dt" _type="string" comment="date partition"/>
+        </part_cols>
+        <table_parameters>
+          <property name="cube.storagetable.end.times" value="now.day - 10 days"/>
+          <property name="cube.storagetable.time.partcols" value="dt"/>
+          <property name="cube.storagetable.start.times" value="now.day - 90 days"/>
+        </table_parameters>
+        <serde_parameters>
+          <property name="serialization.format" value="1"/>
+        </serde_parameters>
+        <time_part_cols>dt</time_part_cols>
+      </table_desc>
+    </storage_table>
+    <storage_table>
+      <update_periods>
+        <update_period>MINUTELY</update_period>
+        <update_period>HOURLY</update_period>
+        <update_period>DAILY</update_period>
+        <update_period>MONTHLY</update_period>
+        <update_period>QUARTERLY</update_period>
+        <update_period>YEARLY</update_period>
+        <update_period>CONTINUOUS</update_period>
+      </update_periods>
+      <storage_name>C4</storage_name>
+      <table_desc external="false">
+        <part_cols>
+          <column name="ttd" _type="string" comment="test date partition"/>
+          <column name="ttd2" _type="string" comment="test date partition"/>
+        </part_cols>
+        <table_parameters>
+          <property name="cube.storagetable.time.partcols" value="ttd,ttd2"/>
+        </table_parameters>
+        <serde_parameters>
+          <property name="serialization.format" value="1"/>
+        </serde_parameters>
+        <time_part_cols>ttd</time_part_cols>
+        <time_part_cols>ttd2</time_part_cols>
+      </table_desc>
+    </storage_table>
+    <storage_table>
+      <update_periods>
+        <update_period>MINUTELY</update_period>
+        <update_period>HOURLY</update_period>
+        <update_period>DAILY</update_period>
+        <update_period>MONTHLY</update_period>
+        <update_period>QUARTERLY</update_period>
+        <update_period>YEARLY</update_period>
+        <update_period>CONTINUOUS</update_period>
+      </update_periods>
+      <storage_name>C5</storage_name>
+      <table_desc external="false">
+        <part_cols>
+          <column name="dt" _type="string" comment="date partition"/>
+        </part_cols>
+        <table_parameters>
+          <property name="cube.storagetable.time.partcols" value="dt"/>
+          <property name="cube.storagetable.start.times" value="now.day - 10 days"/>
+        </table_parameters>
+        <serde_parameters>
+          <property name="serialization.format" value="1"/>
+        </serde_parameters>
+        <time_part_cols>dt</time_part_cols>
+      </table_desc>
+    </storage_table>
+    <storage_table>
+      <update_periods>
+        <update_period>MINUTELY</update_period>
+        <update_period>HOURLY</update_period>
+        <update_period>DAILY</update_period>
+        <update_period>MONTHLY</update_period>
+        <update_period>QUARTERLY</update_period>
+        <update_period>YEARLY</update_period>
+        <update_period>CONTINUOUS</update_period>
+      </update_periods>
+      <storage_name>C0</storage_name>
+      <table_desc external="false">
+        <part_cols/>
+        <table_parameters>
+          <property name="totalSize" value="0"/>
+          <property name="numFiles" value="0"/>
+        </table_parameters>
+        <serde_parameters>
+          <property name="serialization.format" value="1"/>
+        </serde_parameters>
+      </table_desc>
+    </storage_table>
+    <storage_table>
+      <update_periods>
+        <update_period>MINUTELY</update_period>
+        <update_period>HOURLY</update_period>
+        <update_period>DAILY</update_period>
+        <update_period>MONTHLY</update_period>
+        <update_period>QUARTERLY</update_period>
+        <update_period>YEARLY</update_period>
+        <update_period>CONTINUOUS</update_period>
+      </update_periods>
+      <storage_name>C1</storage_name>
+      <table_desc external="false">
+        <part_cols>
+          <column name="dt" _type="string" comment="date partition"/>
+        </part_cols>
+        <table_parameters>
+          <property name="cube.storagetable.time.partcols" value="dt"/>
+        </table_parameters>
+        <serde_parameters>
+          <property name="serialization.format" value="1"/>
+        </serde_parameters>
+        <time_part_cols>dt</time_part_cols>
+      </table_desc>
+    </storage_table>
+    <storage_table>
+      <update_periods>
+        <update_period>MINUTELY</update_period>
+        <update_period>HOURLY</update_period>
+        <update_period>DAILY</update_period>
+        <update_period>MONTHLY</update_period>
+        <update_period>QUARTERLY</update_period>
+        <update_period>YEARLY</update_period>
+        <update_period>CONTINUOUS</update_period>
+      </update_periods>
+      <storage_name>C2</storage_name>
+      <table_desc external="false">
+        <part_cols>
+          <column name="dt" _type="string" comment="date partition"/>
+        </part_cols>
+        <table_parameters>
+          <property name="cube.storagetable.time.partcols" value="dt"/>
+        </table_parameters>
+        <serde_parameters>
+          <property name="serialization.format" value="1"/>
+        </serde_parameters>
+        <time_part_cols>dt</time_part_cols>
+      </table_desc>
+    </storage_table>
+    <storage_table>
+      <storage_name>C6</storage_name>
+      <update_periods>
+        <update_period_table_descriptor>
+          <update_period>DAILY</update_period>
+          <table_desc external="false">
+            <part_cols>
+              <column name="dt" _type="string" comment="date partition"/>
+            </part_cols>
+            <table_parameters>
+              <property name="cube.storagetable.time.partcols" value="dt"/>
+              <property name="cube.storagetable.start.times" value="now.month - 2 months"/>
+              <property name="cube.storagetable.end.times" value="now.day"/>
+            </table_parameters>
+            <serde_parameters>
+              <property name="serialization.format" value="1"/>
+            </serde_parameters>
+            <time_part_cols>dt</time_part_cols>
+          </table_desc>
+        </update_period_table_descriptor>
+        <update_period_table_descriptor>
+          <update_period>MONTHLY</update_period>
+          <table_desc external="false">
+            <part_cols>
+              <column name="dt" _type="string" comment="date partition"/>
+            </part_cols>
+            <table_parameters>
+              <property name="cube.storagetable.time.partcols" value="dt"/>
+              <property name="cube.storagetable.start.times" value="now.month - 12 months"/>
+              <property name="cube.storagetable.end.times" value="now.month - 1 months"/>
+            </table_parameters>
+            <serde_parameters>
+              <property name="serialization.format" value="1"/>
+            </serde_parameters>
+            <time_part_cols>dt</time_part_cols>
+          </table_desc>
+        </update_period_table_descriptor>
+      </update_periods>
+    </storage_table>
+  </storage_tables>
+</x_fact_table>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lens/blob/ae83caae/lens-cube/src/test/resources/schema/facts/testfact1_base.xml
----------------------------------------------------------------------
diff --git a/lens-cube/src/test/resources/schema/facts/testfact1_base.xml b/lens-cube/src/test/resources/schema/facts/testfact1_base.xml
new file mode 100644
index 0000000..81aaddb
--- /dev/null
+++ b/lens-cube/src/test/resources/schema/facts/testfact1_base.xml
@@ -0,0 +1,155 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<!--
+
+  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.
+
+-->
+<x_fact_table name="testfact1_base" cube_name="baseCube" weight="5.0" xmlns="uri:lens:cube:0.1">
+  <columns>
+    <column name="msr21" _type="float" comment="second measure"/>
+    <column name="msr4" _type="bigint" comment="fourth measure"/>
+    <column name="msr15" _type="int" comment="fifteenth measure"/>
+    <column name="union_join_ctx_msr3" _type="int" comment="union_join_ctx_third measure"/>
+    <column name="newmeasure" _type="bigint" comment="measure available  from now"/>
+    <column name="union_join_ctx_msr2" _type="int" comment="union_join_ctx_second measure"/>
+    <column name="msr2" _type="float" comment="second measure"/>
+    <column name="msr3" _type="double" comment="third measure"/>
+    <column name="msr22" _type="float" comment="second measure"/>
+    <column name="msr9" _type="bigint" comment="ninth measure"/>
+    <column name="msr1" _type="int" comment="first measure"/>
+    <column name="noaggrmsr" _type="bigint" comment="measure without a default aggregate"/>
+    <column name="union_join_ctx_msr1" _type="int" comment="union_join_ctx_first measure"/>
+    <column name="d_time" _type="timestamp" comment="event time"/>
+    <column name="processing_time" _type="timestamp" comment="processing time"/>
+    <column name="zipcode" _type="int" comment="zip"/>
+    <column name="cityid" _type="int" comment="city id"/>
+    <column name="stateid" _type="int" comment="state id"/>
+    <column name="userid" _type="int" comment="user id"/>
+    <column name="xuserid" _type="int" comment="user id"/>
+    <column name="yuserid" _type="int" comment="user id"/>
+    <column name="dim1" _type="string" comment="base dim"/>
+    <column name="dim11" _type="string" comment="base dim"/>
+    <column name="test_time_dim_hour_id" _type="int" comment="time id"/>
+  </columns>
+  <properties>
+    <property name="cube.fact.relative.start.time" value="now.year - 90 days"/>
+    <property name="cube.fact.testfact1_base.storages" value="C3,C4,C1,C2"/>
+    <property name="cube.fact.testfact1_base.c3.updateperiods" value="MONTHLY,HOURLY,YEARLY,QUARTERLY,MINUTELY,DAILY"/>
+    <property name="cube.fact.testfact1_base.c2.updateperiods" value="MONTHLY,HOURLY,YEARLY,QUARTERLY,MINUTELY,DAILY"/>
+    <property name="cube.fact.testfact1_base.c1.updateperiods" value="MONTHLY,HOURLY,YEARLY,QUARTERLY,MINUTELY,DAILY"/>
+    <property name="cube.table.testfact1_base.weight" value="5.0"/>
+    <property name="cube.fact.testfact1_base.cubename" value="baseCube"/>
+    <property name="cube.fact.testfact1_base.c4.updateperiods" value="MONTHLY,HOURLY,YEARLY,QUARTERLY,MINUTELY,DAILY"/>
+  </properties>
+  <storage_tables>
+    <storage_table>
+      <update_periods>
+        <update_period>MINUTELY</update_period>
+        <update_period>HOURLY</update_period>
+        <update_period>DAILY</update_period>
+        <update_period>MONTHLY</update_period>
+        <update_period>QUARTERLY</update_period>
+        <update_period>YEARLY</update_period>
+      </update_periods>
+      <storage_name>C3</storage_name>
+      <table_desc external="false">
+        <part_cols>
+          <column name="dt" _type="string" comment="date partition"/>
+        </part_cols>
+        <table_parameters>
+          <property name="cube.storagetable.time.partcols" value="dt"/>
+        </table_parameters>
+        <serde_parameters>
+          <property name="serialization.format" value="1"/>
+        </serde_parameters>
+        <time_part_cols>dt</time_part_cols>
+      </table_desc>
+    </storage_table>
+    <storage_table>
+      <update_periods>
+        <update_period>MINUTELY</update_period>
+        <update_period>HOURLY</update_period>
+        <update_period>DAILY</update_period>
+        <update_period>MONTHLY</update_period>
+        <update_period>QUARTERLY</update_period>
+        <update_period>YEARLY</update_period>
+      </update_periods>
+      <storage_name>C4</storage_name>
+      <table_desc external="false">
+        <part_cols>
+          <column name="ttd" _type="string" comment="test date partition"/>
+          <column name="ttd2" _type="string" comment="test date partition"/>
+        </part_cols>
+        <table_parameters>
+          <property name="cube.storagetable.time.partcols" value="ttd,ttd2"/>
+        </table_parameters>
+        <serde_parameters>
+          <property name="serialization.format" value="1"/>
+        </serde_parameters>
+        <time_part_cols>ttd</time_part_cols>
+        <time_part_cols>ttd2</time_part_cols>
+      </table_desc>
+    </storage_table>
+    <storage_table>
+      <update_periods>
+        <update_period>MINUTELY</update_period>
+        <update_period>HOURLY</update_period>
+        <update_period>DAILY</update_period>
+        <update_period>MONTHLY</update_period>
+        <update_period>QUARTERLY</update_period>
+        <update_period>YEARLY</update_period>
+      </update_periods>
+      <storage_name>C1</storage_name>
+      <table_desc external="false">
+        <part_cols>
+          <column name="dt" _type="string" comment="date partition"/>
+        </part_cols>
+        <table_parameters>
+          <property name="cube.storagetable.time.partcols" value="dt"/>
+        </table_parameters>
+        <serde_parameters>
+          <property name="serialization.format" value="1"/>
+        </serde_parameters>
+        <time_part_cols>dt</time_part_cols>
+      </table_desc>
+    </storage_table>
+    <storage_table>
+      <update_periods>
+        <update_period>MINUTELY</update_period>
+        <update_period>HOURLY</update_period>
+        <update_period>DAILY</update_period>
+        <update_period>MONTHLY</update_period>
+        <update_period>QUARTERLY</update_period>
+        <update_period>YEARLY</update_period>
+      </update_periods>
+      <storage_name>C2</storage_name>
+      <table_desc external="false">
+        <part_cols>
+          <column name="dt" _type="string" comment="date partition"/>
+        </part_cols>
+        <table_parameters>
+          <property name="cube.storagetable.time.partcols" value="dt"/>
+        </table_parameters>
+        <serde_parameters>
+          <property name="serialization.format" value="1"/>
+        </serde_parameters>
+        <time_part_cols>dt</time_part_cols>
+      </table_desc>
+    </storage_table>
+  </storage_tables>
+</x_fact_table>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lens/blob/ae83caae/lens-cube/src/test/resources/schema/facts/testfact1_raw_base.xml
----------------------------------------------------------------------
diff --git a/lens-cube/src/test/resources/schema/facts/testfact1_raw_base.xml b/lens-cube/src/test/resources/schema/facts/testfact1_raw_base.xml
new file mode 100644
index 0000000..65f1dc3
--- /dev/null
+++ b/lens-cube/src/test/resources/schema/facts/testfact1_raw_base.xml
@@ -0,0 +1,95 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<!--
+
+  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.
+
+-->
+<x_fact_table name="testfact1_raw_base" cube_name="baseCube" weight="100.0" xmlns="uri:lens:cube:0.1">
+  <columns>
+    <column name="msr21" _type="float" comment="second measure"/>
+    <column name="msr4" _type="bigint" comment="fourth measure"/>
+    <column name="msr15" _type="int" comment="fifteenth measure"/>
+    <column name="union_join_ctx_msr3" _type="int" comment="union_join_ctx_third measure"/>
+    <column name="newmeasure" _type="bigint" comment="measure available  from now"/>
+    <column name="union_join_ctx_msr2" _type="int" comment="union_join_ctx_second measure"/>
+    <column name="msr2" _type="float" comment="second measure"/>
+    <column name="msr3" _type="double" comment="third measure"/>
+    <column name="msr22" _type="float" comment="second measure"/>
+    <column name="msr9" _type="bigint" comment="ninth measure"/>
+    <column name="msr1" _type="int" comment="first measure"/>
+    <column name="noaggrmsr" _type="bigint" comment="measure without a default aggregate"/>
+    <column name="union_join_ctx_msr1" _type="int" comment="union_join_ctx_first measure"/>
+    <column name="zipcode" _type="int" comment="zip"/>
+    <column name="cityid" _type="int" comment="city id"/>
+    <column name="cityid1" _type="int" comment="city id"/>
+    <column name="cityid2" _type="int" comment="city id"/>
+    <column name="stateid" _type="int" comment="state id"/>
+    <column name="countryid" _type="int" comment="country id"/>
+    <column name="dim1" _type="string" comment="dim1"/>
+    <column name="dim2" _type="int" comment="dim2"/>
+    <column name="concatedcitystate" _type="string" comment="citystate"/>
+  </columns>
+  <properties>
+    <property name="cube.fact.datacompleteness.tag" value="f1"/>
+    <property name="cube.fact.relative.start.time" value="now.year - 90 days"/>
+    <property name="cube.table.testfact1_raw_base.weight" value="100.0"/>
+    <property name="cube.fact.testfact1_raw_base.storages" value="C3,C1"/>
+    <property name="cube.fact.testfact1_raw_base.c1.updateperiods" value="HOURLY"/>
+    <property name="cube.fact.testfact1_raw_base.c3.updateperiods" value="HOURLY"/>
+    <property name="cube.fact.is.aggregated" value="false"/>
+    <property name="cube.fact.testfact1_raw_base.cubename" value="baseCube"/>
+  </properties>
+  <storage_tables>
+    <storage_table>
+      <update_periods>
+        <update_period>HOURLY</update_period>
+      </update_periods>
+      <storage_name>C3</storage_name>
+      <table_desc external="false">
+        <part_cols>
+          <column name="dt" _type="string" comment="date partition"/>
+        </part_cols>
+        <table_parameters>
+          <property name="cube.storagetable.time.partcols" value="dt"/>
+        </table_parameters>
+        <serde_parameters>
+          <property name="serialization.format" value="1"/>
+        </serde_parameters>
+        <time_part_cols>dt</time_part_cols>
+      </table_desc>
+    </storage_table>
+    <storage_table>
+      <update_periods>
+        <update_period>HOURLY</update_period>
+      </update_periods>
+      <storage_name>C1</storage_name>
+      <table_desc external="false">
+        <part_cols>
+          <column name="dt" _type="string" comment="date partition"/>
+        </part_cols>
+        <table_parameters>
+          <property name="cube.storagetable.time.partcols" value="dt"/>
+        </table_parameters>
+        <serde_parameters>
+          <property name="serialization.format" value="1"/>
+        </serde_parameters>
+        <time_part_cols>dt</time_part_cols>
+      </table_desc>
+    </storage_table>
+  </storage_tables>
+</x_fact_table>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lens/blob/ae83caae/lens-cube/src/test/resources/schema/facts/testfact2.xml
----------------------------------------------------------------------
diff --git a/lens-cube/src/test/resources/schema/facts/testfact2.xml b/lens-cube/src/test/resources/schema/facts/testfact2.xml
new file mode 100644
index 0000000..41d2045
--- /dev/null
+++ b/lens-cube/src/test/resources/schema/facts/testfact2.xml
@@ -0,0 +1,95 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<!--
+
+  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.
+
+-->
+<x_fact_table name="testfact2" cube_name="testCube" weight="10.0" xmlns="uri:lens:cube:0.1">
+  <columns>
+    <column name="msr21" _type="float" comment="second measure"/>
+    <column name="msr15" _type="int" comment="fifteenth measure"/>
+    <column name="union_join_ctx_msr3" _type="int" comment="union_join_ctx_third measure"/>
+    <column name="newmeasure" _type="bigint" comment="measure available  from now"/>
+    <column name="union_join_ctx_msr2" _type="int" comment="union_join_ctx_second measure"/>
+    <column name="msr2" _type="float" comment="second measure"/>
+    <column name="msr3" _type="double" comment="third measure"/>
+    <column name="msr22" _type="float" comment="second measure"/>
+    <column name="msr9" _type="bigint" comment="ninth measure"/>
+    <column name="msr1" _type="int" comment="first measure"/>
+    <column name="noaggrmsr" _type="bigint" comment="measure without a default aggregate"/>
+    <column name="union_join_ctx_msr1" _type="int" comment="union_join_ctx_first measure"/>
+    <column name="zipcode" _type="int" comment="zip"/>
+    <column name="cityid" _type="int" comment="city id"/>
+    <column name="cityid2" _type="int" comment="city id"/>
+    <column name="test_time_dim_hour_id" _type="int" comment="time id"/>
+    <column name="test_time_dim_hour_id2" _type="int" comment="time id"/>
+    <column name="cdim2" _type="int" comment="cycledim id"/>
+  </columns>
+  <properties>
+    <property name="cube.fact.relative.start.time" value="now.year - 90 days"/>
+    <property name="cube.fact.testfact2.storages" value="C4,C1"/>
+    <property name="cube.fact.testfact2.c4.updateperiods" value="HOURLY"/>
+    <property name="cube.fact.testfact2.c1.updateperiods" value="HOURLY"/>
+    <property name="cube.fact.testfact2.cubename" value="testCube"/>
+    <property name="cube.table.testfact2.weight" value="10.0"/>
+  </properties>
+  <storage_tables>
+    <storage_table>
+      <update_periods>
+        <update_period>HOURLY</update_period>
+      </update_periods>
+      <storage_name>C4</storage_name>
+      <table_desc external="false">
+        <part_cols>
+          <column name="ttd" _type="string" comment="test date partition"/>
+          <column name="ttd2" _type="string" comment="test date partition"/>
+        </part_cols>
+        <table_parameters>
+          <property name="cube.storagetable.partition.timeline.cache.HOURLY.ttd2.storage.class"
+                    value="org.apache.lens.cube.metadata.timeline.StoreAllPartitionTimeline"/>
+          <property name="cube.storagetable.time.partcols" value="ttd,ttd2"/>
+          <property name="cube.storagetable.partition.timeline.cache.HOURLY.ttd.storage.class"
+                    value="org.apache.lens.cube.metadata.timeline.StoreAllPartitionTimeline"/>
+        </table_parameters>
+        <serde_parameters>
+          <property name="serialization.format" value="1"/>
+        </serde_parameters>
+        <time_part_cols>ttd</time_part_cols>
+        <time_part_cols>ttd2</time_part_cols>
+      </table_desc>
+    </storage_table>
+    <storage_table>
+      <update_periods>
+        <update_period>HOURLY</update_period>
+      </update_periods>
+      <storage_name>C1</storage_name>
+      <table_desc external="false">
+        <part_cols>
+          <column name="dt" _type="string" comment="date partition"/>
+        </part_cols>
+        <table_parameters>
+          <property name="cube.storagetable.time.partcols" value="dt"/>
+        </table_parameters>
+        <serde_parameters>
+          <property name="serialization.format" value="1"/>
+        </serde_parameters>
+        <time_part_cols>dt</time_part_cols>
+      </table_desc>
+    </storage_table>
+  </storage_tables>
+</x_fact_table>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lens/blob/ae83caae/lens-cube/src/test/resources/schema/facts/testfact2_base.xml
----------------------------------------------------------------------
diff --git a/lens-cube/src/test/resources/schema/facts/testfact2_base.xml b/lens-cube/src/test/resources/schema/facts/testfact2_base.xml
new file mode 100644
index 0000000..f113ff5
--- /dev/null
+++ b/lens-cube/src/test/resources/schema/facts/testfact2_base.xml
@@ -0,0 +1,140 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<!--
+
+  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.
+
+-->
+<x_fact_table name="testfact2_base" cube_name="baseCube" weight="5.0" xmlns="uri:lens:cube:0.1">
+  <columns>
+    <column name="msr12" _type="float" comment="second measure"/>
+    <column name="d_time" _type="timestamp" comment="event time"/>
+    <column name="processing_time" _type="timestamp" comment="processing time"/>
+    <column name="dim1" _type="string" comment="base dim"/>
+    <column name="dim11" _type="string" comment="base dim"/>
+    <column name="dim2" _type="int" comment="dim2 id"/>
+    <column name="userid" _type="int" comment="user id"/>
+    <column name="xuserid" _type="int" comment="user id"/>
+    <column name="yuserid" _type="int" comment="user id"/>
+  </columns>
+  <properties>
+    <property name="cube.fact.relative.start.time" value="now.year - 90 days"/>
+    <property name="cube.fact.testfact2_base.c2.updateperiods" value="MONTHLY,HOURLY,YEARLY,QUARTERLY,MINUTELY,DAILY"/>
+    <property name="cube.fact.testfact2_base.c3.updateperiods" value="MONTHLY,HOURLY,YEARLY,QUARTERLY,MINUTELY,DAILY"/>
+    <property name="cube.fact.testfact2_base.c1.updateperiods" value="MONTHLY,HOURLY,YEARLY,QUARTERLY,MINUTELY,DAILY"/>
+    <property name="cube.fact.testfact2_base.c4.updateperiods" value="MONTHLY,HOURLY,YEARLY,QUARTERLY,MINUTELY,DAILY"/>
+    <property name="cube.fact.testfact2_base.cubename" value="baseCube"/>
+    <property name="cube.fact.testfact2_base.storages" value="C3,C4,C1,C2"/>
+    <property name="cube.table.testfact2_base.weight" value="5.0"/>
+  </properties>
+  <storage_tables>
+    <storage_table>
+      <update_periods>
+        <update_period>MINUTELY</update_period>
+        <update_period>HOURLY</update_period>
+        <update_period>DAILY</update_period>
+        <update_period>MONTHLY</update_period>
+        <update_period>QUARTERLY</update_period>
+        <update_period>YEARLY</update_period>
+      </update_periods>
+      <storage_name>C3</storage_name>
+      <table_desc external="false">
+        <part_cols>
+          <column name="dt" _type="string" comment="date partition"/>
+        </part_cols>
+        <table_parameters>
+          <property name="cube.storagetable.time.partcols" value="dt"/>
+        </table_parameters>
+        <serde_parameters>
+          <property name="serialization.format" value="1"/>
+        </serde_parameters>
+        <time_part_cols>dt</time_part_cols>
+      </table_desc>
+    </storage_table>
+    <storage_table>
+      <update_periods>
+        <update_period>MINUTELY</update_period>
+        <update_period>HOURLY</update_period>
+        <update_period>DAILY</update_period>
+        <update_period>MONTHLY</update_period>
+        <update_period>QUARTERLY</update_period>
+        <update_period>YEARLY</update_period>
+      </update_periods>
+      <storage_name>C4</storage_name>
+      <table_desc external="false">
+        <part_cols>
+          <column name="ttd" _type="string" comment="test date partition"/>
+          <column name="ttd2" _type="string" comment="test date partition"/>
+        </part_cols>
+        <table_parameters>
+          <property name="cube.storagetable.time.partcols" value="ttd,ttd2"/>
+        </table_parameters>
+        <serde_parameters>
+          <property name="serialization.format" value="1"/>
+        </serde_parameters>
+        <time_part_cols>ttd</time_part_cols>
+        <time_part_cols>ttd2</time_part_cols>
+      </table_desc>
+    </storage_table>
+    <storage_table>
+      <update_periods>
+        <update_period>MINUTELY</update_period>
+        <update_period>HOURLY</update_period>
+        <update_period>DAILY</update_period>
+        <update_period>MONTHLY</update_period>
+        <update_period>QUARTERLY</update_period>
+        <update_period>YEARLY</update_period>
+      </update_periods>
+      <storage_name>C1</storage_name>
+      <table_desc external="false">
+        <part_cols>
+          <column name="dt" _type="string" comment="date partition"/>
+        </part_cols>
+        <table_parameters>
+          <property name="cube.storagetable.time.partcols" value="dt"/>
+        </table_parameters>
+        <serde_parameters>
+          <property name="serialization.format" value="1"/>
+        </serde_parameters>
+        <time_part_cols>dt</time_part_cols>
+      </table_desc>
+    </storage_table>
+    <storage_table>
+      <update_periods>
+        <update_period>MINUTELY</update_period>
+        <update_period>HOURLY</update_period>
+        <update_period>DAILY</update_period>
+        <update_period>MONTHLY</update_period>
+        <update_period>QUARTERLY</update_period>
+        <update_period>YEARLY</update_period>
+      </update_periods>
+      <storage_name>C2</storage_name>
+      <table_desc external="false">
+        <part_cols>
+          <column name="dt" _type="string" comment="date partition"/>
+        </part_cols>
+        <table_parameters>
+          <property name="cube.storagetable.time.partcols" value="dt"/>
+        </table_parameters>
+        <serde_parameters>
+          <property name="serialization.format" value="1"/>
+        </serde_parameters>
+        <time_part_cols>dt</time_part_cols>
+      </table_desc>
+    </storage_table>
+  </storage_tables>
+</x_fact_table>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lens/blob/ae83caae/lens-cube/src/test/resources/schema/facts/testfact2_raw.xml
----------------------------------------------------------------------
diff --git a/lens-cube/src/test/resources/schema/facts/testfact2_raw.xml b/lens-cube/src/test/resources/schema/facts/testfact2_raw.xml
new file mode 100644
index 0000000..9c36753
--- /dev/null
+++ b/lens-cube/src/test/resources/schema/facts/testfact2_raw.xml
@@ -0,0 +1,95 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<!--
+
+  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.
+
+-->
+<x_fact_table name="testfact2_raw" cube_name="testCube" weight="100.0" xmlns="uri:lens:cube:0.1">
+  <columns>
+    <column name="msr21" _type="float" comment="second measure"/>
+    <column name="msr4" _type="bigint" comment="fourth measure"/>
+    <column name="msr15" _type="int" comment="fifteenth measure"/>
+    <column name="union_join_ctx_msr3" _type="int" comment="union_join_ctx_third measure"/>
+    <column name="newmeasure" _type="bigint" comment="measure available  from now"/>
+    <column name="union_join_ctx_msr2" _type="int" comment="union_join_ctx_second measure"/>
+    <column name="msr2" _type="float" comment="second measure"/>
+    <column name="msr3" _type="double" comment="third measure"/>
+    <column name="msr22" _type="float" comment="second measure"/>
+    <column name="msr9" _type="bigint" comment="ninth measure"/>
+    <column name="msr1" _type="int" comment="first measure"/>
+    <column name="noaggrmsr" _type="bigint" comment="measure without a default aggregate"/>
+    <column name="union_join_ctx_msr1" _type="int" comment="union_join_ctx_first measure"/>
+    <column name="zipcode" _type="int" comment="zip"/>
+    <column name="cityid" _type="int" comment="city id"/>
+    <column name="cityid1" _type="int" comment="city id"/>
+    <column name="cityid2" _type="int" comment="city id"/>
+    <column name="stateid" _type="int" comment="state id"/>
+    <column name="countryid" _type="int" comment="country id"/>
+    <column name="dim1" _type="string" comment="dim1"/>
+    <column name="dim2" _type="int" comment="dim2"/>
+    <column name="concatedcitystate" _type="string" comment="citystate"/>
+  </columns>
+  <properties>
+    <property name="cube.fact.testfact2_raw.storages" value="C3,C1"/>
+    <property name="cube.fact.datacompleteness.tag" value="f1"/>
+    <property name="cube.fact.relative.start.time" value="now.year - 90 days"/>
+    <property name="cube.fact.testfact2_raw.c3.updateperiods" value="HOURLY"/>
+    <property name="cube.fact.testfact2_raw.c1.updateperiods" value="HOURLY"/>
+    <property name="cube.table.testfact2_raw.weight" value="100.0"/>
+    <property name="cube.fact.is.aggregated" value="false"/>
+    <property name="cube.fact.testfact2_raw.cubename" value="testCube"/>
+  </properties>
+  <storage_tables>
+    <storage_table>
+      <update_periods>
+        <update_period>HOURLY</update_period>
+      </update_periods>
+      <storage_name>C3</storage_name>
+      <table_desc external="false">
+        <part_cols>
+          <column name="dt" _type="string" comment="date partition"/>
+        </part_cols>
+        <table_parameters>
+          <property name="cube.storagetable.time.partcols" value="dt"/>
+        </table_parameters>
+        <serde_parameters>
+          <property name="serialization.format" value="1"/>
+        </serde_parameters>
+        <time_part_cols>dt</time_part_cols>
+      </table_desc>
+    </storage_table>
+    <storage_table>
+      <update_periods>
+        <update_period>HOURLY</update_period>
+      </update_periods>
+      <storage_name>C1</storage_name>
+      <table_desc external="false">
+        <part_cols>
+          <column name="dt" _type="string" comment="date partition"/>
+        </part_cols>
+        <table_parameters>
+          <property name="cube.storagetable.time.partcols" value="dt"/>
+        </table_parameters>
+        <serde_parameters>
+          <property name="serialization.format" value="1"/>
+        </serde_parameters>
+        <time_part_cols>dt</time_part_cols>
+      </table_desc>
+    </storage_table>
+  </storage_tables>
+</x_fact_table>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lens/blob/ae83caae/lens-cube/src/test/resources/schema/facts/testfact2_raw_base.xml
----------------------------------------------------------------------
diff --git a/lens-cube/src/test/resources/schema/facts/testfact2_raw_base.xml b/lens-cube/src/test/resources/schema/facts/testfact2_raw_base.xml
new file mode 100644
index 0000000..0bab461
--- /dev/null
+++ b/lens-cube/src/test/resources/schema/facts/testfact2_raw_base.xml
@@ -0,0 +1,66 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<!--
+
+  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.
+
+-->
+<x_fact_table name="testfact2_raw_base" cube_name="baseCube" weight="100.0" xmlns="uri:lens:cube:0.1">
+  <columns>
+    <column name="msr11" _type="int" comment="first measure"/>
+    <column name="msr12" _type="float" comment="second measure"/>
+    <column name="msr9" _type="bigint" comment="ninth measure"/>
+    <column name="d_time" _type="timestamp" comment="event time"/>
+    <column name="processing_time" _type="timestamp" comment="processing time"/>
+    <column name="dim1" _type="string" comment="base dim"/>
+    <column name="dim11" _type="string" comment="base dim"/>
+    <column name="dim13" _type="string" comment="base dim"/>
+    <column name="dim12" _type="string" comment="base dim"/>
+    <column name="dim22" _type="string" comment="base dim"/>
+    <column name="cityid" _type="int" comment="city id"/>
+  </columns>
+  <properties>
+    <property name="cube.fact.datacompleteness.tag" value="f2"/>
+    <property name="cube.fact.relative.start.time" value="now.year - 90 days"/>
+    <property name="cube.fact.testfact2_raw_base.c1.updateperiods" value="HOURLY"/>
+    <property name="cube.table.testfact2_raw_base.weight" value="100.0"/>
+    <property name="transient_lastDdlTime" value="1488970748"/>
+    <property name="cube.fact.testfact2_raw_base.cubename" value="baseCube"/>
+    <property name="cube.fact.is.aggregated" value="false"/>
+    <property name="cube.fact.testfact2_raw_base.storages" value="C1"/>
+  </properties>
+  <storage_tables>
+    <storage_table>
+      <update_periods>
+        <update_period>HOURLY</update_period>
+      </update_periods>
+      <storage_name>C1</storage_name>
+      <table_desc external="false">
+        <part_cols>
+          <column name="dt" _type="string" comment="date partition"/>
+        </part_cols>
+        <table_parameters>
+          <property name="cube.storagetable.time.partcols" value="dt"/>
+        </table_parameters>
+        <serde_parameters>
+          <property name="serialization.format" value="1"/>
+        </serde_parameters>
+        <time_part_cols>dt</time_part_cols>
+      </table_desc>
+    </storage_table>
+  </storage_tables>
+</x_fact_table>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lens/blob/ae83caae/lens-cube/src/test/resources/schema/facts/testfact3_base.xml
----------------------------------------------------------------------
diff --git a/lens-cube/src/test/resources/schema/facts/testfact3_base.xml b/lens-cube/src/test/resources/schema/facts/testfact3_base.xml
new file mode 100644
index 0000000..e27664f
--- /dev/null
+++ b/lens-cube/src/test/resources/schema/facts/testfact3_base.xml
@@ -0,0 +1,137 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<!--
+
+  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.
+
+-->
+<x_fact_table name="testfact3_base" cube_name="baseCube" weight="5.0" xmlns="uri:lens:cube:0.1">
+  <columns>
+    <column name="msr13" _type="double" comment="third measure"/>
+    <column name="msr14" _type="bigint" comment="fourth measure"/>
+    <column name="d_time" _type="timestamp" comment="event time"/>
+    <column name="processing_time" _type="timestamp" comment="processing time"/>
+    <column name="dim1" _type="string" comment="base dim"/>
+    <column name="dim11" _type="string" comment="base dim"/>
+  </columns>
+  <properties>
+    <property name="cube.table.testfact3_base.weight" value="5.0"/>
+    <property name="cube.fact.relative.start.time" value="now.year - 90 days"/>
+    <property name="cube.fact.testfact3_base.cubename" value="baseCube"/>
+    <property name="cube.fact.testfact3_base.c2.updateperiods" value="MONTHLY,HOURLY,YEARLY,QUARTERLY,MINUTELY,DAILY"/>
+    <property name="cube.fact.testfact3_base.c3.updateperiods" value="MONTHLY,HOURLY,YEARLY,QUARTERLY,MINUTELY,DAILY"/>
+    <property name="cube.fact.testfact3_base.c4.updateperiods" value="MONTHLY,HOURLY,YEARLY,QUARTERLY,MINUTELY,DAILY"/>
+    <property name="cube.fact.testfact3_base.storages" value="C3,C4,C1,C2"/>
+    <property name="cube.fact.testfact3_base.c1.updateperiods" value="MONTHLY,HOURLY,YEARLY,QUARTERLY,MINUTELY,DAILY"/>
+  </properties>
+  <storage_tables>
+    <storage_table>
+      <update_periods>
+        <update_period>MINUTELY</update_period>
+        <update_period>HOURLY</update_period>
+        <update_period>DAILY</update_period>
+        <update_period>MONTHLY</update_period>
+        <update_period>QUARTERLY</update_period>
+        <update_period>YEARLY</update_period>
+      </update_periods>
+      <storage_name>C3</storage_name>
+      <table_desc external="false">
+        <part_cols>
+          <column name="dt" _type="string" comment="date partition"/>
+        </part_cols>
+        <table_parameters>
+          <property name="cube.storagetable.time.partcols" value="dt"/>
+        </table_parameters>
+        <serde_parameters>
+          <property name="serialization.format" value="1"/>
+        </serde_parameters>
+        <time_part_cols>dt</time_part_cols>
+      </table_desc>
+    </storage_table>
+    <storage_table>
+      <update_periods>
+        <update_period>MINUTELY</update_period>
+        <update_period>HOURLY</update_period>
+        <update_period>DAILY</update_period>
+        <update_period>MONTHLY</update_period>
+        <update_period>QUARTERLY</update_period>
+        <update_period>YEARLY</update_period>
+      </update_periods>
+      <storage_name>C4</storage_name>
+      <table_desc external="false">
+        <part_cols>
+          <column name="ttd" _type="string" comment="test date partition"/>
+          <column name="ttd2" _type="string" comment="test date partition"/>
+        </part_cols>
+        <table_parameters>
+          <property name="cube.storagetable.time.partcols" value="ttd,ttd2"/>
+        </table_parameters>
+        <serde_parameters>
+          <property name="serialization.format" value="1"/>
+        </serde_parameters>
+        <time_part_cols>ttd</time_part_cols>
+        <time_part_cols>ttd2</time_part_cols>
+      </table_desc>
+    </storage_table>
+    <storage_table>
+      <update_periods>
+        <update_period>MINUTELY</update_period>
+        <update_period>HOURLY</update_period>
+        <update_period>DAILY</update_period>
+        <update_period>MONTHLY</update_period>
+        <update_period>QUARTERLY</update_period>
+        <update_period>YEARLY</update_period>
+      </update_periods>
+      <storage_name>C1</storage_name>
+      <table_desc external="false">
+        <part_cols>
+          <column name="dt" _type="string" comment="date partition"/>
+        </part_cols>
+        <table_parameters>
+          <property name="cube.storagetable.time.partcols" value="dt"/>
+        </table_parameters>
+        <serde_parameters>
+          <property name="serialization.format" value="1"/>
+        </serde_parameters>
+        <time_part_cols>dt</time_part_cols>
+      </table_desc>
+    </storage_table>
+    <storage_table>
+      <update_periods>
+        <update_period>MINUTELY</update_period>
+        <update_period>HOURLY</update_period>
+        <update_period>DAILY</update_period>
+        <update_period>MONTHLY</update_period>
+        <update_period>QUARTERLY</update_period>
+        <update_period>YEARLY</update_period>
+      </update_periods>
+      <storage_name>C2</storage_name>
+      <table_desc external="false">
+        <part_cols>
+          <column name="dt" _type="string" comment="date partition"/>
+        </part_cols>
+        <table_parameters>
+          <property name="cube.storagetable.time.partcols" value="dt"/>
+        </table_parameters>
+        <serde_parameters>
+          <property name="serialization.format" value="1"/>
+        </serde_parameters>
+        <time_part_cols>dt</time_part_cols>
+      </table_desc>
+    </storage_table>
+  </storage_tables>
+</x_fact_table>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lens/blob/ae83caae/lens-cube/src/test/resources/schema/facts/testfact3_raw_base.xml
----------------------------------------------------------------------
diff --git a/lens-cube/src/test/resources/schema/facts/testfact3_raw_base.xml b/lens-cube/src/test/resources/schema/facts/testfact3_raw_base.xml
new file mode 100644
index 0000000..6becd8e
--- /dev/null
+++ b/lens-cube/src/test/resources/schema/facts/testfact3_raw_base.xml
@@ -0,0 +1,64 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<!--
+
+  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.
+
+-->
+<x_fact_table name="testfact3_raw_base" cube_name="baseCube" weight="100.0" xmlns="uri:lens:cube:0.1">
+  <columns>
+    <column name="msr13" _type="double" comment="third measure"/>
+    <column name="msr14" _type="bigint" comment="fourth measure"/>
+    <column name="d_time" _type="timestamp" comment="event time"/>
+    <column name="processing_time" _type="timestamp" comment="processing time"/>
+    <column name="dim1" _type="string" comment="base dim"/>
+    <column name="dim11" _type="string" comment="base dim"/>
+    <column name="dim12" _type="string" comment="base dim"/>
+  </columns>
+  <properties>
+    <property name="cube.fact.datacompleteness.tag" value="f2"/>
+    <property name="cube.fact.col.end.time.user_id_deprecated" value="2016-01-01"/>
+    <property name="cube.fact.testfact3_raw_base.storages" value="C1"/>
+    <property name="cube.table.testfact3_raw_base.weight" value="100.0"/>
+    <property name="cube.fact.col.start.time.user_id_added_far_future" value="2099-01-01"/>
+    <property name="cube.fact.is.aggregated" value="false"/>
+    <property name="cube.fact.relative.start.time" value="now.year - 90 days"/>
+    <property name="cube.fact.testfact3_raw_base.cubename" value="baseCube"/>
+    <property name="cube.fact.col.start.time.user_id_added_in_past" value="2016-01-01"/>
+    <property name="cube.fact.testfact3_raw_base.c1.updateperiods" value="HOURLY"/>
+  </properties>
+  <storage_tables>
+    <storage_table>
+      <update_periods>
+        <update_period>HOURLY</update_period>
+      </update_periods>
+      <storage_name>C1</storage_name>
+      <table_desc external="false">
+        <part_cols>
+          <column name="dt" _type="string" comment="date partition"/>
+        </part_cols>
+        <table_parameters>
+          <property name="cube.storagetable.time.partcols" value="dt"/>
+        </table_parameters>
+        <serde_parameters>
+          <property name="serialization.format" value="1"/>
+        </serde_parameters>
+        <time_part_cols>dt</time_part_cols>
+      </table_desc>
+    </storage_table>
+  </storage_tables>
+</x_fact_table>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lens/blob/ae83caae/lens-cube/src/test/resources/schema/facts/testfact4_raw_base.xml
----------------------------------------------------------------------
diff --git a/lens-cube/src/test/resources/schema/facts/testfact4_raw_base.xml b/lens-cube/src/test/resources/schema/facts/testfact4_raw_base.xml
new file mode 100644
index 0000000..5d1136b
--- /dev/null
+++ b/lens-cube/src/test/resources/schema/facts/testfact4_raw_base.xml
@@ -0,0 +1,65 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<!--
+
+  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.
+
+-->
+<x_fact_table name="testfact4_raw_base" cube_name="baseCube" weight="100.0" xmlns="uri:lens:cube:0.1">
+  <columns>
+    <column name="msr13" _type="double" comment="third measure"/>
+    <column name="msr14" _type="bigint" comment="fourth measure"/>
+    <column name="d_time" _type="timestamp" comment="event time"/>
+    <column name="processing_time" _type="timestamp" comment="processing time"/>
+    <column name="dim1" _type="string" comment="base dim"/>
+    <column name="user_id_added_in_past" _type="int" comment="user id"/>
+    <column name="user_id_added_far_future" _type="int" comment="user id"/>
+    <column name="user_id_deprecated" _type="int" comment="user id"/>
+  </columns>
+  <properties>
+    <property name="cube.fact.datacompleteness.tag" value="f2"/>
+    <property name="cube.fact.testfact4_raw_base.c1.updateperiods" value="HOURLY"/>
+    <property name="cube.fact.col.end.time.user_id_deprecated" value="2016-01-01"/>
+    <property name="cube.fact.col.start.time.user_id_added_far_future" value="2099-01-01"/>
+    <property name="cube.fact.is.aggregated" value="false"/>
+    <property name="cube.fact.relative.start.time" value="now.year - 90 days"/>
+    <property name="cube.fact.col.start.time.user_id_added_in_past" value="2016-01-01"/>
+    <property name="cube.fact.testfact4_raw_base.storages" value="C1"/>
+    <property name="cube.fact.testfact4_raw_base.cubename" value="baseCube"/>
+    <property name="cube.table.testfact4_raw_base.weight" value="100.0"/>
+  </properties>
+  <storage_tables>
+    <storage_table>
+      <update_periods>
+        <update_period>HOURLY</update_period>
+      </update_periods>
+      <storage_name>C1</storage_name>
+      <table_desc external="false">
+        <part_cols>
+          <column name="dt" _type="string" comment="date partition"/>
+        </part_cols>
+        <table_parameters>
+          <property name="cube.storagetable.time.partcols" value="dt"/>
+        </table_parameters>
+        <serde_parameters>
+          <property name="serialization.format" value="1"/>
+        </serde_parameters>
+        <time_part_cols>dt</time_part_cols>
+      </table_desc>
+    </storage_table>
+  </storage_tables>
+</x_fact_table>
\ No newline at end of file