From ed94db4849c196e1b7239fe48d48e27e3ddcae6b Mon Sep 17 00:00:00 2001 From: shaofengshi Date: Mon, 8 Dec 2014 13:09:58 +0800 Subject: [PATCH] =?UTF-8?q?Update=20test=20cases=20(for=20tables=20that=20?= =?UTF-8?q?not=20in=20=E2=80=98default=E2=80=99=20schema).?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/kylinolap/cube/project/ProjectManagerTest.java | 10 +++++----- .../main/java/com/kylinolap/metadata/model/TableDesc.java | 13 ++++++++++++- .../src/test/java/com/kylinolap/query/test/H2Database.java | 6 +++++- .../test/java/com/kylinolap/query/test/KylinQueryTest.java | 6 +++--- query/src/test/resources/query/h2/query09.sql | 2 +- query/src/test/resources/query/h2/query10.sql | 2 +- query/src/test/resources/query/sql/query09.sql | 2 +- query/src/test/resources/query/sql/query10.sql | 2 +- query/src/test/resources/query/sql/query11.sql | 2 +- query/src/test/resources/query/sql/query12.sql | 2 +- query/src/test/resources/query/sql/query13.sql | 2 +- query/src/test/resources/query/sql/query14.sql | 2 +- query/src/test/resources/query/sql/query15.sql | 2 +- query/src/test/resources/query/sql/query16.sql | 2 +- query/src/test/resources/query/sql/query17.sql | 2 +- query/src/test/resources/query/sql/query18.sql | 2 +- query/src/test/resources/query/sql/query19.sql | 2 +- query/src/test/resources/query/sql/query20.sql | 2 +- query/src/test/resources/query/sql/query21.sql | 4 ++-- query/src/test/resources/query/sql/query22.sql | 4 ++-- query/src/test/resources/query/sql/query23.sql | 4 ++-- query/src/test/resources/query/sql/query24.sql | 6 +++--- query/src/test/resources/query/sql/query25.sql | 6 +++--- query/src/test/resources/query/sql/query26.sql | 6 +++--- query/src/test/resources/query/sql/query27.sql | 6 +++--- query/src/test/resources/query/sql/query28.sql | 6 +++--- query/src/test/resources/query/sql/query29.sql | 2 +- query/src/test/resources/query/sql/query31.sql | 4 ++-- query/src/test/resources/query/sql/query32.sql | 4 ++-- query/src/test/resources/query/sql/query33.sql | 4 ++-- query/src/test/resources/query/sql/query34.sql | 4 ++-- query/src/test/resources/query/sql/query35.sql | 4 ++-- query/src/test/resources/query/sql/query36.sql | 4 ++-- query/src/test/resources/query/sql/query37.sql | 2 +- query/src/test/resources/query/sql/query42.sql | 2 +- query/src/test/resources/query/sql/query43.sql | 2 +- query/src/test/resources/query/sql/query45.sql | 2 +- query/src/test/resources/query/sql/query47.sql | 2 +- query/src/test/resources/query/sql/query48.sql | 2 +- query/src/test/resources/query/sql/query49.sql | 2 +- query/src/test/resources/query/sql/query50.sql | 2 +- query/src/test/resources/query/sql/query51.sql | 2 +- query/src/test/resources/query/sql/query54.sql | 2 +- query/src/test/resources/query/sql/query55.sql | 2 +- query/src/test/resources/query/sql/query56.sql | 2 +- query/src/test/resources/query/sql/query57.sql | 2 +- query/src/test/resources/query/sql/query58.sql | 2 +- query/src/test/resources/query/sql/query60.sql | 2 +- query/src/test/resources/query/sql/query61.sql | 2 +- query/src/test/resources/query/sql/query66.sql | 2 +- query/src/test/resources/query/sql/query72.sql | 2 +- query/src/test/resources/query/sql_derived/query01.sql | 4 ++-- query/src/test/resources/query/sql_derived/query02.sql | 4 ++-- query/src/test/resources/query/sql_derived/query04.sql | 2 +- query/src/test/resources/query/sql_derived/query05.sql | 2 +- query/src/test/resources/query/sql_derived/query10.sql | 2 +- query/src/test/resources/query/sql_distinct/query03.sql | 2 +- query/src/test/resources/query/sql_distinct/query04.sql | 2 +- query/src/test/resources/query/sql_dynamic/query01.sql | 2 +- query/src/test/resources/query/sql_dynamic/query02.sql | 2 +- query/src/test/resources/query/sql_hive/query10.sql | 2 +- .../resources/query/sql_invalid/query29_invalid_SQL.sql | 2 +- query/src/test/resources/query/sql_lookup/query01.sql | 2 +- query/src/test/resources/query/sql_lookup/query03.sql | 2 +- query/src/test/resources/query/sql_lookup/query04.sql | 2 +- query/src/test/resources/query/sql_orderby/query01.sql | 4 ++-- query/src/test/resources/query/sql_subquery/query00.sql | 4 ++-- query/src/test/resources/query/sql_subquery/query01.sql | 2 +- query/src/test/resources/query/sql_subquery/query03.sql | 4 ++-- query/src/test/resources/query/sql_subquery/query04.sql | 4 ++-- query/src/test/resources/query/sql_subquery/query05.sql | 4 ++-- query/src/test/resources/query/sql_tableau/query00.sql | 2 +- query/src/test/resources/query/sql_tableau/query01.sql | 2 +- query/src/test/resources/query/sql_tableau/query02.sql | 2 +- query/src/test/resources/query/sql_tableau/query03.sql | 2 +- query/src/test/resources/query/sql_tableau/query04.sql | 2 +- query/src/test/resources/query/sql_tableau/query05.sql | 2 +- query/src/test/resources/query/sql_tableau/query06.sql | 2 +- query/src/test/resources/query/sql_tableau/query07.sql | 2 +- query/src/test/resources/query/sql_tableau/query10.sql | 2 +- query/src/test/resources/query/sql_tableau/query11.sql | 2 +- query/src/test/resources/query/sql_tableau/query12.sql | 2 +- query/src/test/resources/query/sql_tableau/query13.sql | 2 +- query/src/test/resources/query/sql_tableau/query14.sql | 2 +- query/src/test/resources/query/sql_tableau/query15.sql | 2 +- query/src/test/resources/query/sql_tableau/query16.sql | 2 +- query/src/test/resources/query/sql_tableau/query17.sql | 2 +- query/src/test/resources/query/sql_tableau/query21.sql | 2 +- query/src/test/resources/query/sql_tableau/query23.sql | 2 +- query/src/test/resources/query/sql_tableau/query24.sql | 2 +- query/src/test/resources/query/sql_tableau/query25.sql | 4 ++-- query/src/test/resources/query/sql_tableau/query27.sql | 4 ++-- .../com/kylinolap/storage/filter/ColumnTupleFilter.java | 11 +++++++---- .../java/com/kylinolap/storage/filter/FilterBaseTest.java | 4 ++-- 94 files changed, 150 insertions(+), 132 deletions(-) diff --git a/cube/src/test/java/com/kylinolap/cube/project/ProjectManagerTest.java b/cube/src/test/java/com/kylinolap/cube/project/ProjectManagerTest.java index 6f9067a..eb03c56 100644 --- a/cube/src/test/java/com/kylinolap/cube/project/ProjectManagerTest.java +++ b/cube/src/test/java/com/kylinolap/cube/project/ProjectManagerTest.java @@ -138,27 +138,27 @@ public void testExistingProject() throws Exception { @Test public void testProjectsDrop() throws IOException { CubeInstance cube = CubeManager.getInstance(getTestConfig()).getCube("test_kylin_cube_with_slr_empty"); - assertTrue(ProjectManager.getInstance(this.getTestConfig()).getCubesByTable("default", "test_kylin_fact").contains(cube)); + assertTrue(ProjectManager.getInstance(this.getTestConfig()).getCubesByTable("default", "default.test_kylin_fact").contains(cube)); assertTrue(ProjectManager.getInstance(this.getTestConfig()).listAllCubes("default").contains(cube)); CubeManager.getInstance(getTestConfig()).dropCube(cube.getName(), true); - assertTrue(!ProjectManager.getInstance(this.getTestConfig()).getCubesByTable("default", "test_kylin_fact").contains(cube)); + assertTrue(!ProjectManager.getInstance(this.getTestConfig()).getCubesByTable("default", "default.test_kylin_fact").contains(cube)); assertTrue(!ProjectManager.getInstance(this.getTestConfig()).listAllCubes("default").contains(cube)); } @Test public void testProjectsLoadAfterProjectChange() throws IOException { CubeInstance cube = CubeManager.getInstance(getTestConfig()).getCube("test_kylin_cube_with_slr_empty"); - assertTrue(ProjectManager.getInstance(this.getTestConfig()).getCubesByTable("default", "test_kylin_fact").contains(cube)); + assertTrue(ProjectManager.getInstance(this.getTestConfig()).getCubesByTable("default", "default.test_kylin_fact").contains(cube)); ProjectManager.getInstance(getTestConfig()).removeCubeFromProjects(cube.getName()); - assertTrue(!ProjectManager.getInstance(this.getTestConfig()).getCubesByTable("default", "test_kylin_fact").contains(cube)); + assertTrue(!ProjectManager.getInstance(this.getTestConfig()).getCubesByTable("default", "default.test_kylin_fact").contains(cube)); ProjectManager.getInstance(getTestConfig()).updateCubeToProject(cube.getName(), "default", "tester"); - assertTrue(ProjectManager.getInstance(this.getTestConfig()).getCubesByTable("default", "test_kylin_fact").contains(cube)); + assertTrue(ProjectManager.getInstance(this.getTestConfig()).getCubesByTable("default", "default.test_kylin_fact").contains(cube)); } private MetadataManager getMetadataManager() { diff --git a/metadata/src/main/java/com/kylinolap/metadata/model/TableDesc.java b/metadata/src/main/java/com/kylinolap/metadata/model/TableDesc.java index 1b15337..f5eede0 100644 --- a/metadata/src/main/java/com/kylinolap/metadata/model/TableDesc.java +++ b/metadata/src/main/java/com/kylinolap/metadata/model/TableDesc.java @@ -24,6 +24,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.kylinolap.common.persistence.ResourceStore; import com.kylinolap.common.persistence.RootPersistentEntity; +import com.kylinolap.common.util.StringSplitter; /** * Table Metadata from Source. All name should be uppercase. @@ -71,7 +72,17 @@ public String getName() { } public void setName(String name) { - this.name = name; + if (name != null) { + String[] splits = StringSplitter.split(name, "."); + if (splits.length == 2) { + this.setDatabase(splits[0]); + this.name = splits[1]; + } else if (splits.length == 1) { + this.name = splits[0]; + } + } else { + this.name = name; + } } @JsonProperty("database") diff --git a/query/src/test/java/com/kylinolap/query/test/H2Database.java b/query/src/test/java/com/kylinolap/query/test/H2Database.java index c429d08..a0aab0d 100644 --- a/query/src/test/java/com/kylinolap/query/test/H2Database.java +++ b/query/src/test/java/com/kylinolap/query/test/H2Database.java @@ -36,7 +36,7 @@ public class H2Database { private static final Logger logger = LoggerFactory.getLogger(H2Database.class); - private static final String[] ALL_TABLES = new String[] { "test_cal_dt", "test_category_groupings", "test_kylin_fact", "test_seller_type_dim", "test_sites" }; + private static final String[] ALL_TABLES = new String[] { "edw.test_cal_dt", "default.test_category_groupings", "default.test_kylin_fact", "edw.test_seller_type_dim", "edw.test_sites" }; private static final Map javaToH2DataTypeMapping = new HashMap(); static { @@ -94,6 +94,10 @@ private void loadH2Table(String tableName, String joinType) throws SQLException String cvsFilePath = tempFile.getPath(); Statement stmt = h2Connection.createStatement(); + + String createDBSql = "CREATE SCHEMA IF NOT EXISTS DEFAULT;\nCREATE SCHEMA IF NOT EXISTS EDW;\nSET SCHEMA DEFAULT;\n"; + stmt.executeUpdate(createDBSql); + String sql = generateCreateH2TableSql(tableDesc, cvsFilePath); stmt.executeUpdate(sql); diff --git a/query/src/test/java/com/kylinolap/query/test/KylinQueryTest.java b/query/src/test/java/com/kylinolap/query/test/KylinQueryTest.java index 8b127d7..0df1599 100644 --- a/query/src/test/java/com/kylinolap/query/test/KylinQueryTest.java +++ b/query/src/test/java/com/kylinolap/query/test/KylinQueryTest.java @@ -123,13 +123,13 @@ protected static void preferCubeOf(String joinType) { @Ignore @Test public void testTempQuery() throws Exception { - execAndCompQuery("src/test/resources/query/temp", null, true); + execAndCompQuery("src/test/resources/query/temp", null, true); } @Test public void testSingleRunQuery() throws Exception { - String queryFileName = "src/test/resources/query/sql/query02.sql"; + String queryFileName = "src/test/resources/query/sql_orderby/query01.sql"; File sqlFile = new File(queryFileName); runSQL(sqlFile, true, true); @@ -211,7 +211,7 @@ public void testHiveQuery() throws Exception { @Test public void testH2Query() throws Exception { - this.execQueryUsingH2("src/test/resources/query/h2", false); + this.execQueryUsingH2("src/test/resources/query/sql_orderby", false); } @Test diff --git a/query/src/test/resources/query/h2/query09.sql b/query/src/test/resources/query/h2/query09.sql index 08a64d8..afd186b 100644 --- a/query/src/test/resources/query/h2/query09.sql +++ b/query/src/test/resources/query/h2/query09.sql @@ -1,5 +1,5 @@ select count(*) from (select test_cal_dt.week_beg_dt from test_kylin_fact - inner JOIN test_cal_dt + inner JOIN edw.test_cal_dt as test_cal_dt ON test_kylin_fact.cal_dt = test_cal_dt.cal_dt group by test_cal_dt.week_beg_dt) t diff --git a/query/src/test/resources/query/h2/query10.sql b/query/src/test/resources/query/h2/query10.sql index 5036c63..1c642d6 100644 --- a/query/src/test/resources/query/h2/query10.sql +++ b/query/src/test/resources/query/h2/query10.sql @@ -1,6 +1,6 @@ select test_cal_dt.week_beg_dt from test_kylin_fact - inner JOIN test_cal_dt + inner JOIN edw.test_cal_dt as test_cal_dt ON test_kylin_fact.cal_dt = test_cal_dt.cal_dt where test_kylin_fact.lstg_format_name='FP-GTC' and test_cal_dt.week_beg_dt between DATE '2013-05-01' and DATE '2013-08-01' diff --git a/query/src/test/resources/query/sql/query09.sql b/query/src/test/resources/query/sql/query09.sql index d3bfa89..e83e5d1 100644 --- a/query/src/test/resources/query/sql/query09.sql +++ b/query/src/test/resources/query/sql/query09.sql @@ -1,5 +1,5 @@ select test_cal_dt.week_beg_dt, count(*) as TRANS_CNT from test_kylin_fact - inner JOIN test_cal_dt + inner JOIN edw.test_cal_dt as test_cal_dt ON test_kylin_fact.cal_dt = test_cal_dt.cal_dt group by test_cal_dt.week_beg_dt diff --git a/query/src/test/resources/query/sql/query10.sql b/query/src/test/resources/query/sql/query10.sql index bd92a71..b3ec288 100644 --- a/query/src/test/resources/query/sql/query10.sql +++ b/query/src/test/resources/query/sql/query10.sql @@ -1,7 +1,7 @@ select test_cal_dt.week_beg_dt,sum(test_kylin_fact.price) as GMV , count(*) as TRANS_CNT from test_kylin_fact - inner JOIN test_cal_dt + inner JOIN edw.test_cal_dt as test_cal_dt ON test_kylin_fact.cal_dt = test_cal_dt.cal_dt where test_kylin_fact.lstg_format_name='FP-GTC' and test_cal_dt.week_beg_dt between DATE '2013-05-01' and DATE '2013-08-01' diff --git a/query/src/test/resources/query/sql/query11.sql b/query/src/test/resources/query/sql/query11.sql index f225aa8..548e58d 100644 --- a/query/src/test/resources/query/sql/query11.sql +++ b/query/src/test/resources/query/sql/query11.sql @@ -1,7 +1,7 @@ select test_kylin_fact.lstg_format_name, test_cal_dt.week_beg_dt,sum(test_kylin_fact.price) as GMV , count(*) as TRANS_CNT from test_kylin_fact - inner JOIN test_cal_dt + inner JOIN edw.test_cal_dt as test_cal_dt ON test_kylin_fact.cal_dt = test_cal_dt.cal_dt where test_cal_dt.week_beg_dt between DATE '2013-05-01' and DATE '2013-08-01' group by test_kylin_fact.lstg_format_name, test_cal_dt.week_beg_dt diff --git a/query/src/test/resources/query/sql/query12.sql b/query/src/test/resources/query/sql/query12.sql index 5289dde..38bafef 100644 --- a/query/src/test/resources/query/sql/query12.sql +++ b/query/src/test/resources/query/sql/query12.sql @@ -1,7 +1,7 @@ select test_kylin_fact.lstg_format_name, test_cal_dt.week_beg_dt,sum(test_kylin_fact.price) as GMV , count(*) as TRANS_CNT from test_kylin_fact - inner JOIN test_cal_dt + inner JOIN edw.test_cal_dt as test_cal_dt ON test_kylin_fact.cal_dt = test_cal_dt.cal_dt where test_cal_dt.week_beg_dt >= DATE '2013-02-10' group by test_kylin_fact.lstg_format_name, test_cal_dt.week_beg_dt diff --git a/query/src/test/resources/query/sql/query13.sql b/query/src/test/resources/query/sql/query13.sql index 4e8dd76..ce50679 100644 --- a/query/src/test/resources/query/sql/query13.sql +++ b/query/src/test/resources/query/sql/query13.sql @@ -1,6 +1,6 @@ select sum(test_kylin_fact.price) as GMV , count(*) as TRANS_CNT from test_kylin_fact - inner JOIN test_cal_dt + inner JOIN edw.test_cal_dt as test_cal_dt ON test_kylin_fact.cal_dt = test_cal_dt.cal_dt where test_kylin_fact.lstg_format_name='FP-GTC' and test_cal_dt.week_beg_dt between DATE '2013-05-01' and DATE '2013-08-01' diff --git a/query/src/test/resources/query/sql/query14.sql b/query/src/test/resources/query/sql/query14.sql index 9fc8660..4e6f713 100644 --- a/query/src/test/resources/query/sql/query14.sql +++ b/query/src/test/resources/query/sql/query14.sql @@ -6,7 +6,7 @@ SELECT ,sum(test_kylin_fact.price) as GMV , count(*) as trans_cnt FROM test_kylin_fact - inner JOIN test_cal_dt + inner JOIN edw.test_cal_dt as test_cal_dt ON test_kylin_fact.cal_dt = test_cal_dt.cal_dt inner JOIN test_category_groupings ON test_kylin_fact.leaf_categ_id = test_category_groupings.leaf_categ_id diff --git a/query/src/test/resources/query/sql/query15.sql b/query/src/test/resources/query/sql/query15.sql index 57d292b..50233cc 100644 --- a/query/src/test/resources/query/sql/query15.sql +++ b/query/src/test/resources/query/sql/query15.sql @@ -3,7 +3,7 @@ SELECT ,test_category_groupings.meta_categ_name ,sum(price) as GMV, count(*) as TRANS_CNT FROM test_kylin_fact - inner JOIN test_cal_dt + inner JOIN edw.test_cal_dt as test_cal_dt ON test_kylin_fact.cal_dt = test_cal_dt.cal_dt inner JOIN test_category_groupings ON test_kylin_fact.leaf_categ_id = test_category_groupings.leaf_categ_id AND test_kylin_fact.lstg_site_id = test_category_groupings.site_id diff --git a/query/src/test/resources/query/sql/query16.sql b/query/src/test/resources/query/sql/query16.sql index 9576f38..e124252 100644 --- a/query/src/test/resources/query/sql/query16.sql +++ b/query/src/test/resources/query/sql/query16.sql @@ -5,7 +5,7 @@ SELECT ,test_category_groupings.categ_lvl3_name ,sum(price) as GMV, count(*) as TRANS_CNT FROM test_kylin_fact - inner JOIN test_cal_dt + inner JOIN edw.test_cal_dt as test_cal_dt ON test_kylin_fact.cal_dt = test_cal_dt.cal_dt inner JOIN test_category_groupings ON test_kylin_fact.leaf_categ_id = test_category_groupings.leaf_categ_id diff --git a/query/src/test/resources/query/sql/query17.sql b/query/src/test/resources/query/sql/query17.sql index a262477..4cf5436 100644 --- a/query/src/test/resources/query/sql/query17.sql +++ b/query/src/test/resources/query/sql/query17.sql @@ -5,7 +5,7 @@ SELECT ,test_category_groupings.categ_lvl3_name ,sum(price) as GMV, count(*) as TRANS_CNT FROM test_kylin_fact - inner JOIN test_cal_dt + inner JOIN edw.test_cal_dt as test_cal_dt ON test_kylin_fact.cal_dt = test_cal_dt.cal_dt inner JOIN test_category_groupings ON test_kylin_fact.leaf_categ_id = test_category_groupings.leaf_categ_id AND test_kylin_fact.lstg_site_id = test_category_groupings.site_id diff --git a/query/src/test/resources/query/sql/query18.sql b/query/src/test/resources/query/sql/query18.sql index cab2b3b..b570757 100644 --- a/query/src/test/resources/query/sql/query18.sql +++ b/query/src/test/resources/query/sql/query18.sql @@ -3,7 +3,7 @@ SELECT ,test_category_groupings.meta_categ_name ,sum(price) as GMV, count(*) as TRANS_CNT FROM test_kylin_fact - inner JOIN test_cal_dt + inner JOIN edw.test_cal_dt as test_cal_dt ON test_kylin_fact.cal_dt = test_cal_dt.cal_dt inner JOIN test_category_groupings ON test_kylin_fact.leaf_categ_id = test_category_groupings.leaf_categ_id AND test_kylin_fact.lstg_site_id = test_category_groupings.site_id diff --git a/query/src/test/resources/query/sql/query19.sql b/query/src/test/resources/query/sql/query19.sql index a262477..4cf5436 100644 --- a/query/src/test/resources/query/sql/query19.sql +++ b/query/src/test/resources/query/sql/query19.sql @@ -5,7 +5,7 @@ SELECT ,test_category_groupings.categ_lvl3_name ,sum(price) as GMV, count(*) as TRANS_CNT FROM test_kylin_fact - inner JOIN test_cal_dt + inner JOIN edw.test_cal_dt as test_cal_dt ON test_kylin_fact.cal_dt = test_cal_dt.cal_dt inner JOIN test_category_groupings ON test_kylin_fact.leaf_categ_id = test_category_groupings.leaf_categ_id AND test_kylin_fact.lstg_site_id = test_category_groupings.site_id diff --git a/query/src/test/resources/query/sql/query20.sql b/query/src/test/resources/query/sql/query20.sql index c0489bf..ac276bb 100644 --- a/query/src/test/resources/query/sql/query20.sql +++ b/query/src/test/resources/query/sql/query20.sql @@ -3,7 +3,7 @@ SELECT ,test_category_groupings.meta_categ_name ,sum(price) as GMV, count(*) as TRANS_CNT FROM test_kylin_fact - inner JOIN test_cal_dt + inner JOIN edw.test_cal_dt as test_cal_dt ON test_kylin_fact.cal_dt = test_cal_dt.cal_dt inner JOIN test_category_groupings ON test_kylin_fact.leaf_categ_id = test_category_groupings.leaf_categ_id AND test_kylin_fact.lstg_site_id = test_category_groupings.site_id diff --git a/query/src/test/resources/query/sql/query21.sql b/query/src/test/resources/query/sql/query21.sql index bd0ca84..b2e54ba 100644 --- a/query/src/test/resources/query/sql/query21.sql +++ b/query/src/test/resources/query/sql/query21.sql @@ -7,11 +7,11 @@ SELECT ,test_sites.site_name ,sum(test_kylin_fact.price) as GMV, count(*) as TRANS_CNT FROM test_kylin_fact - inner JOIN test_cal_dt + inner JOIN edw.test_cal_dt as test_cal_dt ON test_kylin_fact.cal_dt = test_cal_dt.cal_dt inner JOIN test_category_groupings ON test_kylin_fact.leaf_categ_id = test_category_groupings.leaf_categ_id AND test_kylin_fact.lstg_site_id = test_category_groupings.site_id - inner JOIN test_sites + inner JOIN edw.test_sites as test_sites ON test_kylin_fact.lstg_site_id = test_sites.site_id where test_cal_dt.week_beg_dt between DATE '2013-02-01' and DATE '2013-03-01' group by test_cal_dt.week_beg_dt diff --git a/query/src/test/resources/query/sql/query22.sql b/query/src/test/resources/query/sql/query22.sql index 03af146..024f9e9 100644 --- a/query/src/test/resources/query/sql/query22.sql +++ b/query/src/test/resources/query/sql/query22.sql @@ -8,11 +8,11 @@ SELECT ,sum(test_kylin_fact.price) as GMV , count(*) as TRANS_CNT FROM test_kylin_fact - inner JOIN test_cal_dt + inner JOIN edw.test_cal_dt as test_cal_dt ON test_kylin_fact.cal_dt = test_cal_dt.cal_dt inner JOIN test_category_groupings ON test_kylin_fact.leaf_categ_id = test_category_groupings.leaf_categ_id AND test_kylin_fact.lstg_site_id = test_category_groupings.site_id - inner JOIN test_sites + inner JOIN edw.test_sites as test_sites ON test_kylin_fact.lstg_site_id = test_sites.site_id where test_cal_dt.week_beg_dt between DATE '2012-02-01' and DATE '2013-10-01' and site_name='Canada' diff --git a/query/src/test/resources/query/sql/query23.sql b/query/src/test/resources/query/sql/query23.sql index 63de8ac..25e93d9 100644 --- a/query/src/test/resources/query/sql/query23.sql +++ b/query/src/test/resources/query/sql/query23.sql @@ -6,11 +6,11 @@ SELECT ,sum(test_kylin_fact.price) as GMV , count(*) as TRANS_CNT FROM test_kylin_fact - inner JOIN test_cal_dt + inner JOIN edw.test_cal_dt as test_cal_dt ON test_kylin_fact.cal_dt = test_cal_dt.cal_dt inner JOIN test_category_groupings ON test_kylin_fact.leaf_categ_id = test_category_groupings.leaf_categ_id AND test_kylin_fact.lstg_site_id = test_category_groupings.site_id - inner JOIN test_sites + inner JOIN edw.test_sites as test_sites ON test_kylin_fact.lstg_site_id = test_sites.site_id where test_cal_dt.week_beg_dt between DATE '2013-02-01' and DATE '2013-10-01' and site_name='Ebay' diff --git a/query/src/test/resources/query/sql/query24.sql b/query/src/test/resources/query/sql/query24.sql index 0ca7bf6..5681557 100644 --- a/query/src/test/resources/query/sql/query24.sql +++ b/query/src/test/resources/query/sql/query24.sql @@ -9,13 +9,13 @@ SELECT ,sum(test_kylin_fact.price) as GMV , count(*) as TRANS_CNT FROM test_kylin_fact - inner JOIN test_cal_dt + inner JOIN edw.test_cal_dt as test_cal_dt ON test_kylin_fact.cal_dt = test_cal_dt.cal_dt inner JOIN test_category_groupings ON test_kylin_fact.leaf_categ_id = test_category_groupings.leaf_categ_id AND test_kylin_fact.lstg_site_id = test_category_groupings.site_id - inner JOIN test_sites + inner JOIN edw.test_sites as test_sites ON test_kylin_fact.lstg_site_id = test_sites.site_id - inner JOIN test_seller_type_dim + inner JOIN edw.test_seller_type_dim as test_seller_type_dim ON test_kylin_fact.slr_segment_cd = test_seller_type_dim.seller_type_cd group by test_cal_dt.week_beg_dt ,test_category_groupings.meta_categ_name diff --git a/query/src/test/resources/query/sql/query25.sql b/query/src/test/resources/query/sql/query25.sql index 7df7680..0c07a8e 100644 --- a/query/src/test/resources/query/sql/query25.sql +++ b/query/src/test/resources/query/sql/query25.sql @@ -9,13 +9,13 @@ SELECT ,sum(test_kylin_fact.price) as GMV , count(*) as TRANS_CNT FROM test_kylin_fact - inner JOIN test_cal_dt + inner JOIN edw.test_cal_dt as test_cal_dt ON test_kylin_fact.cal_dt = test_cal_dt.cal_dt inner JOIN test_category_groupings ON test_kylin_fact.leaf_categ_id = test_category_groupings.leaf_categ_id AND test_kylin_fact.lstg_site_id = test_category_groupings.site_id - inner JOIN test_sites + inner JOIN edw.test_sites as test_sites ON test_kylin_fact.lstg_site_id = test_sites.site_id - inner JOIN test_seller_type_dim + inner JOIN edw.test_seller_type_dim as test_seller_type_dim ON test_kylin_fact.slr_segment_cd = test_seller_type_dim.seller_type_cd where test_cal_dt.week_beg_dt between DATE '2013-01-01' and DATE '2013-06-01' group by test_cal_dt.week_beg_dt diff --git a/query/src/test/resources/query/sql/query26.sql b/query/src/test/resources/query/sql/query26.sql index 0aecb06..3889e77 100644 --- a/query/src/test/resources/query/sql/query26.sql +++ b/query/src/test/resources/query/sql/query26.sql @@ -9,13 +9,13 @@ SELECT ,sum(test_kylin_fact.price) as GMV , count(*) as TRANS_CNT FROM test_kylin_fact - inner JOIN test_cal_dt + inner JOIN edw.test_cal_dt as test_cal_dt ON test_kylin_fact.cal_dt = test_cal_dt.cal_dt inner JOIN test_category_groupings ON test_kylin_fact.leaf_categ_id = test_category_groupings.leaf_categ_id AND test_kylin_fact.lstg_site_id = test_category_groupings.site_id - inner JOIN test_sites + inner JOIN edw.test_sites as test_sites ON test_kylin_fact.lstg_site_id = test_sites.site_id - inner JOIN test_seller_type_dim + inner JOIN edw.test_seller_type_dim as test_seller_type_dim ON test_kylin_fact.slr_segment_cd = test_seller_type_dim.seller_type_cd where test_cal_dt.week_beg_dt between DATE '2013-01-01' and DATE '2013-06-04' and (test_category_groupings.meta_categ_name='Collectibles' or test_category_groupings.meta_categ_name='Clothing, Shoes & Accessories') and diff --git a/query/src/test/resources/query/sql/query27.sql b/query/src/test/resources/query/sql/query27.sql index 515aea1..1c0a505 100644 --- a/query/src/test/resources/query/sql/query27.sql +++ b/query/src/test/resources/query/sql/query27.sql @@ -9,13 +9,13 @@ SELECT ,sum(test_kylin_fact.price) as GMV , count(*) as TRANS_CNT FROM test_kylin_fact - inner JOIN test_cal_dt + inner JOIN edw.test_cal_dt as test_cal_dt ON test_kylin_fact.cal_dt = test_cal_dt.cal_dt inner JOIN test_category_groupings ON test_kylin_fact.leaf_categ_id = test_category_groupings.leaf_categ_id AND test_kylin_fact.lstg_site_id = test_category_groupings.site_id - inner JOIN test_sites + inner JOIN edw.test_sites as test_sites ON test_kylin_fact.lstg_site_id = test_sites.site_id - inner JOIN test_seller_type_dim + inner JOIN edw.test_seller_type_dim as test_seller_type_dim ON test_kylin_fact.slr_segment_cd = test_seller_type_dim.seller_type_cd where (test_category_groupings.meta_categ_name='Collectibles' or test_category_groupings.categ_lvl3_name='Dresses') diff --git a/query/src/test/resources/query/sql/query28.sql b/query/src/test/resources/query/sql/query28.sql index a3d3220..4b04d35 100644 --- a/query/src/test/resources/query/sql/query28.sql +++ b/query/src/test/resources/query/sql/query28.sql @@ -2,11 +2,11 @@ SELECT sum(test_kylin_fact.price) as GMV , count(*) as TRANS_CNT FROM test_kylin_fact - inner JOIN test_cal_dt + inner JOIN edw.test_cal_dt as test_cal_dt ON test_kylin_fact.cal_dt = test_cal_dt.cal_dt inner JOIN test_category_groupings ON test_kylin_fact.leaf_categ_id = test_category_groupings.leaf_categ_id AND test_kylin_fact.lstg_site_id = test_category_groupings.site_id - inner JOIN test_sites + inner JOIN edw.test_sites as test_sites ON test_kylin_fact.lstg_site_id = test_sites.site_id - inner JOIN test_seller_type_dim + inner JOIN edw.test_seller_type_dim as test_seller_type_dim ON test_kylin_fact.slr_segment_cd = test_seller_type_dim.seller_type_cd diff --git a/query/src/test/resources/query/sql/query29.sql b/query/src/test/resources/query/sql/query29.sql index 8d0a2f4..c799014 100644 --- a/query/src/test/resources/query/sql/query29.sql +++ b/query/src/test/resources/query/sql/query29.sql @@ -4,7 +4,7 @@ SELECT ,test_category_groupings.categ_lvl2_name ,sum(price) as GMV, count(*) as TRANS_CNT FROM test_kylin_fact - inner JOIN test_cal_dt + inner JOIN edw.test_cal_dt as test_cal_dt ON test_kylin_fact.cal_dt = test_cal_dt.cal_dt inner JOIN test_category_groupings ON test_kylin_fact.leaf_categ_id = test_category_groupings.leaf_categ_id diff --git a/query/src/test/resources/query/sql/query31.sql b/query/src/test/resources/query/sql/query31.sql index 420de7a..d33f4ba 100644 --- a/query/src/test/resources/query/sql/query31.sql +++ b/query/src/test/resources/query/sql/query31.sql @@ -7,11 +7,11 @@ SELECT ,test_sites.site_name ,sum(test_kylin_fact.price) as GMV, count(*) as TRANS_CNT FROM test_kylin_fact - inner JOIN test_cal_dt + inner JOIN edw.test_cal_dt as test_cal_dt ON test_kylin_fact.cal_dt = test_cal_dt.cal_dt inner JOIN test_category_groupings ON test_kylin_fact.leaf_categ_id = test_category_groupings.leaf_categ_id AND test_kylin_fact.lstg_site_id = test_category_groupings.site_id - inner JOIN test_sites + inner JOIN edw.test_sites as test_sites ON test_kylin_fact.lstg_site_id = test_sites.site_id where test_sites.site_name = '英国' group by test_cal_dt.week_beg_dt diff --git a/query/src/test/resources/query/sql/query32.sql b/query/src/test/resources/query/sql/query32.sql index 33210d1..12fab37 100644 --- a/query/src/test/resources/query/sql/query32.sql +++ b/query/src/test/resources/query/sql/query32.sql @@ -7,11 +7,11 @@ SELECT ,test_sites.site_name ,sum(test_kylin_fact.price) as GMV, count(*) as TRANS_CNT FROM test_kylin_fact - inner JOIN test_cal_dt + inner JOIN edw.test_cal_dt as test_cal_dt ON test_kylin_fact.cal_dt = test_cal_dt.cal_dt inner JOIN test_category_groupings ON test_kylin_fact.leaf_categ_id = test_category_groupings.leaf_categ_id AND test_kylin_fact.lstg_site_id = test_category_groupings.site_id - inner JOIN test_sites + inner JOIN edw.test_sites as test_sites ON test_kylin_fact.lstg_site_id = test_sites.site_id group by test_cal_dt.week_beg_dt ,test_category_groupings.meta_categ_name diff --git a/query/src/test/resources/query/sql/query33.sql b/query/src/test/resources/query/sql/query33.sql index c9116dc..4414533 100644 --- a/query/src/test/resources/query/sql/query33.sql +++ b/query/src/test/resources/query/sql/query33.sql @@ -8,11 +8,11 @@ SELECT ,test_sites.site_name ,sum(test_kylin_fact.price) as GMV, count(*) as TRANS_CNT FROM test_kylin_fact - inner JOIN test_cal_dt + inner JOIN edw.test_cal_dt as test_cal_dt ON test_kylin_fact.cal_dt = test_cal_dt.cal_dt inner JOIN test_category_groupings ON test_kylin_fact.leaf_categ_id = test_category_groupings.leaf_categ_id AND test_kylin_fact.lstg_site_id = test_category_groupings.site_id - inner JOIN test_sites + inner JOIN edw.test_sites as test_sites ON test_kylin_fact.lstg_site_id = test_sites.site_id where test_kylin_fact.seller_id = 10000002 group by diff --git a/query/src/test/resources/query/sql/query34.sql b/query/src/test/resources/query/sql/query34.sql index e9b983a..0db088d 100644 --- a/query/src/test/resources/query/sql/query34.sql +++ b/query/src/test/resources/query/sql/query34.sql @@ -7,11 +7,11 @@ SELECT ,test_sites.site_name ,sum(test_kylin_fact.price) as GMV, count(*) as TRANS_CNT FROM test_kylin_fact - inner JOIN test_cal_dt + inner JOIN edw.test_cal_dt as test_cal_dt ON test_kylin_fact.cal_dt = test_cal_dt.cal_dt inner JOIN test_category_groupings ON test_kylin_fact.leaf_categ_id = test_category_groupings.leaf_categ_id AND test_kylin_fact.lstg_site_id = test_category_groupings.site_id - inner JOIN test_sites + inner JOIN edw.test_sites as test_sites ON test_kylin_fact.lstg_site_id = test_sites.site_id where test_kylin_fact.seller_id = 10000002 group by diff --git a/query/src/test/resources/query/sql/query35.sql b/query/src/test/resources/query/sql/query35.sql index 8989c4c..3f2beee 100644 --- a/query/src/test/resources/query/sql/query35.sql +++ b/query/src/test/resources/query/sql/query35.sql @@ -7,11 +7,11 @@ SELECT ,test_sites.site_name ,sum(test_kylin_fact.price) as GMV, count(*) as TRANS_CNT FROM test_kylin_fact - inner JOIN test_cal_dt + inner JOIN edw.test_cal_dt as test_cal_dt ON test_kylin_fact.cal_dt = test_cal_dt.cal_dt inner JOIN test_category_groupings ON test_kylin_fact.leaf_categ_id = test_category_groupings.leaf_categ_id AND test_kylin_fact.lstg_site_id = test_category_groupings.site_id - inner JOIN test_sites + inner JOIN edw.test_sites as test_sites ON test_kylin_fact.lstg_site_id = test_sites.site_id where test_kylin_fact.seller_id = 10000002 or test_kylin_fact.lstg_format_name = 'FP-non GTC' group by diff --git a/query/src/test/resources/query/sql/query36.sql b/query/src/test/resources/query/sql/query36.sql index 5bf8976..709f00b 100644 --- a/query/src/test/resources/query/sql/query36.sql +++ b/query/src/test/resources/query/sql/query36.sql @@ -5,11 +5,11 @@ SELECT ,min(test_kylin_fact.price) as GMV_MIN ,count(*) as TRANS_CNT FROM test_kylin_fact - inner JOIN test_cal_dt + inner JOIN edw.test_cal_dt as test_cal_dt ON test_kylin_fact.cal_dt = test_cal_dt.cal_dt inner JOIN test_category_groupings ON test_kylin_fact.leaf_categ_id = test_category_groupings.leaf_categ_id AND test_kylin_fact.lstg_site_id = test_category_groupings.site_id - inner JOIN test_sites + inner JOIN edw.test_sites as test_sites ON test_kylin_fact.lstg_site_id = test_sites.site_id where test_kylin_fact.seller_id = 10000002 or test_kylin_fact.lstg_format_name = 'FP-non GTC' group by diff --git a/query/src/test/resources/query/sql/query37.sql b/query/src/test/resources/query/sql/query37.sql index 69ca6bf..dfc1845 100644 --- a/query/src/test/resources/query/sql/query37.sql +++ b/query/src/test/resources/query/sql/query37.sql @@ -1,7 +1,7 @@ select test_cal_dt.week_beg_dt, sum(test_kylin_fact.price) as GMV , count(*) as TRANS_CNT from test_kylin_fact - inner JOIN test_cal_dt + inner JOIN edw.test_cal_dt as test_cal_dt ON test_kylin_fact.cal_dt = test_cal_dt.cal_dt where (test_kylin_fact.lstg_format_name > '') diff --git a/query/src/test/resources/query/sql/query42.sql b/query/src/test/resources/query/sql/query42.sql index 2777785..be9ceda 100644 --- a/query/src/test/resources/query/sql/query42.sql +++ b/query/src/test/resources/query/sql/query42.sql @@ -1,5 +1,5 @@ select test_cal_dt.cal_dt, count(*) as TRANS_CNT from test_kylin_fact - inner JOIN test_cal_dt + inner JOIN edw.test_cal_dt as test_cal_dt ON test_kylin_fact.cal_dt = test_cal_dt.cal_dt group by test_cal_dt.cal_dt diff --git a/query/src/test/resources/query/sql/query43.sql b/query/src/test/resources/query/sql/query43.sql index 1cdc9d8..5249854 100644 --- a/query/src/test/resources/query/sql/query43.sql +++ b/query/src/test/resources/query/sql/query43.sql @@ -1,6 +1,6 @@ select test_cal_dt.cal_dt, count(*) as CNT from test_kylin_fact - inner JOIN test_cal_dt + inner JOIN edw.test_cal_dt as test_cal_dt ON test_kylin_fact.cal_dt = test_cal_dt.cal_dt where test_kylin_fact.lstg_format_name='FP-GTC' and test_cal_dt.week_beg_dt between DATE '2013-05-01' and DATE '2013-08-01' diff --git a/query/src/test/resources/query/sql/query45.sql b/query/src/test/resources/query/sql/query45.sql index fa752d2..5a40e25 100644 --- a/query/src/test/resources/query/sql/query45.sql +++ b/query/src/test/resources/query/sql/query45.sql @@ -1,4 +1,4 @@ -select count(*) as CNT from test_cal_dt +select count(*) as CNT from edw.test_cal_dt diff --git a/query/src/test/resources/query/sql/query47.sql b/query/src/test/resources/query/sql/query47.sql index aa124a3..7e0f882 100644 --- a/query/src/test/resources/query/sql/query47.sql +++ b/query/src/test/resources/query/sql/query47.sql @@ -1 +1 @@ -select count(*) as CNT from test_seller_type_dim \ No newline at end of file +select count(*) as CNT from edw.test_seller_type_dim \ No newline at end of file diff --git a/query/src/test/resources/query/sql/query48.sql b/query/src/test/resources/query/sql/query48.sql index 64e078b..72e8f73 100644 --- a/query/src/test/resources/query/sql/query48.sql +++ b/query/src/test/resources/query/sql/query48.sql @@ -1 +1 @@ -select count(*) as CNT from test_sites \ No newline at end of file +select count(*) as CNT from edw.test_sites \ No newline at end of file diff --git a/query/src/test/resources/query/sql/query49.sql b/query/src/test/resources/query/sql/query49.sql index 04302b3..814bc5c 100644 --- a/query/src/test/resources/query/sql/query49.sql +++ b/query/src/test/resources/query/sql/query49.sql @@ -5,7 +5,7 @@ SELECT ,test_category_groupings.categ_lvl3_name ,sum(price) as GMV, count(*) as TRANS_CNT FROM test_kylin_fact - inner JOIN test_cal_dt + inner JOIN edw.test_cal_dt as test_cal_dt ON test_kylin_fact.cal_dt = test_cal_dt.cal_dt inner JOIN test_category_groupings ON test_kylin_fact.lstg_site_id = test_category_groupings.site_id AND test_kylin_fact.leaf_categ_id = test_category_groupings.leaf_categ_id diff --git a/query/src/test/resources/query/sql/query50.sql b/query/src/test/resources/query/sql/query50.sql index d678855..9216f43 100644 --- a/query/src/test/resources/query/sql/query50.sql +++ b/query/src/test/resources/query/sql/query50.sql @@ -1,7 +1,7 @@ select test_kylin_fact.lstg_format_name, test_cal_dt.week_beg_dt,sum(test_kylin_fact.price) as GMV , count(*) as TRANS_CNT from test_kylin_fact - inner JOIN test_cal_dt + inner JOIN edw.test_cal_dt as test_cal_dt ON test_kylin_fact.cal_dt = test_cal_dt.cal_dt where 1 < 3 group by test_kylin_fact.lstg_format_name, test_cal_dt.week_beg_dt diff --git a/query/src/test/resources/query/sql/query51.sql b/query/src/test/resources/query/sql/query51.sql index b7bc5c4..e110358 100644 --- a/query/src/test/resources/query/sql/query51.sql +++ b/query/src/test/resources/query/sql/query51.sql @@ -1,7 +1,7 @@ select test_kylin_fact.lstg_format_name, test_cal_dt.week_beg_dt,sum(test_kylin_fact.price) as GMV , count(*) as TRANS_CNT from test_kylin_fact - inner JOIN test_cal_dt + inner JOIN edw.test_cal_dt as test_cal_dt ON test_kylin_fact.cal_dt = test_cal_dt.cal_dt where DATE '2013-03-24' <= test_cal_dt.week_beg_dt group by test_kylin_fact.lstg_format_name, test_cal_dt.week_beg_dt diff --git a/query/src/test/resources/query/sql/query54.sql b/query/src/test/resources/query/sql/query54.sql index 8404d06..931b07f 100644 --- a/query/src/test/resources/query/sql/query54.sql +++ b/query/src/test/resources/query/sql/query54.sql @@ -1,7 +1,7 @@ select test_kylin_fact.lstg_format_name, test_cal_dt.week_beg_dt,sum(test_kylin_fact.price) as GMV , count(*) as TRANS_CNT from test_kylin_fact - inner JOIN test_cal_dt + inner JOIN edw.test_cal_dt as test_cal_dt ON test_kylin_fact.cal_dt = test_cal_dt.cal_dt where 1 <> 1 group by test_kylin_fact.lstg_format_name, test_cal_dt.week_beg_dt diff --git a/query/src/test/resources/query/sql/query55.sql b/query/src/test/resources/query/sql/query55.sql index 05c115b..8f71b62 100644 --- a/query/src/test/resources/query/sql/query55.sql +++ b/query/src/test/resources/query/sql/query55.sql @@ -1 +1 @@ -select count(*) as c from test_cal_dt where extract(YEAR from test_cal_dt.cal_dt) = 2012 \ No newline at end of file +select count(*) as c from edw.test_cal_dt as test_cal_dt where extract(YEAR from test_cal_dt.cal_dt) = 2012 \ No newline at end of file diff --git a/query/src/test/resources/query/sql/query56.sql b/query/src/test/resources/query/sql/query56.sql index 62fb8b3..83dbe33 100644 --- a/query/src/test/resources/query/sql/query56.sql +++ b/query/src/test/resources/query/sql/query56.sql @@ -1,7 +1,7 @@ select test_cal_dt.week_beg_dt, sum(test_kylin_fact.price) as GMV , count(*) as TRANS_CNT from test_kylin_fact - inner JOIN test_cal_dt + inner JOIN edw.test_cal_dt as test_cal_dt ON test_kylin_fact.cal_dt = test_cal_dt.cal_dt where extract(MONTH from test_cal_dt.week_beg_dt) = 12 diff --git a/query/src/test/resources/query/sql/query57.sql b/query/src/test/resources/query/sql/query57.sql index 492a5b2..89ab240 100644 --- a/query/src/test/resources/query/sql/query57.sql +++ b/query/src/test/resources/query/sql/query57.sql @@ -1,7 +1,7 @@ select test_cal_dt.week_beg_dt, sum(test_kylin_fact.price) as GMV , count(*) as TRANS_CNT from test_kylin_fact - inner JOIN test_cal_dt + inner JOIN edw.test_cal_dt as test_cal_dt ON test_kylin_fact.cal_dt = test_cal_dt.cal_dt where (test_kylin_fact.lstg_format_name='FP-GTC') and extract(MONTH from test_cal_dt.week_beg_dt) = 12 diff --git a/query/src/test/resources/query/sql/query58.sql b/query/src/test/resources/query/sql/query58.sql index d25fd23..4cc834b 100644 --- a/query/src/test/resources/query/sql/query58.sql +++ b/query/src/test/resources/query/sql/query58.sql @@ -1,7 +1,7 @@ select sum(test_kylin_fact.price) as GMV , count(*) as TRANS_CNT from test_kylin_fact - inner JOIN test_cal_dt + inner JOIN edw.test_cal_dt as test_cal_dt ON test_kylin_fact.cal_dt = test_cal_dt.cal_dt where (test_kylin_fact.lstg_format_name='FP-GTC') and extract(MONTH from test_cal_dt.week_beg_dt) = 12 diff --git a/query/src/test/resources/query/sql/query60.sql b/query/src/test/resources/query/sql/query60.sql index 73283f0..3e1b0f0 100644 --- a/query/src/test/resources/query/sql/query60.sql +++ b/query/src/test/resources/query/sql/query60.sql @@ -1,6 +1,6 @@ select test_kylin_fact.cal_dt, sum(test_kylin_fact.price) as sum_price, count(1) as cnt_1 from test_kylin_fact -left join test_cal_dt on test_kylin_fact.cal_dt=test_cal_dt.cal_dt +left JOIN edw.test_cal_dt as test_cal_dt on test_kylin_fact.cal_dt=test_cal_dt.cal_dt group by test_kylin_fact.cal_dt order by 2 desc limit 3 \ No newline at end of file diff --git a/query/src/test/resources/query/sql/query61.sql b/query/src/test/resources/query/sql/query61.sql index acc3635..243e61e 100644 --- a/query/src/test/resources/query/sql/query61.sql +++ b/query/src/test/resources/query/sql/query61.sql @@ -1,6 +1,6 @@ select count(1) as cnt_1 from test_kylin_fact -left join test_cal_dt on test_kylin_fact.cal_dt=test_cal_dt.cal_dt +left JOIN edw.test_cal_dt as test_cal_dt on test_kylin_fact.cal_dt=test_cal_dt.cal_dt group by test_kylin_fact.cal_dt order by 1 desc limit 4 \ No newline at end of file diff --git a/query/src/test/resources/query/sql/query66.sql b/query/src/test/resources/query/sql/query66.sql index 5efc8eb..46eb159 100644 --- a/query/src/test/resources/query/sql/query66.sql +++ b/query/src/test/resources/query/sql/query66.sql @@ -1,2 +1,2 @@ -select test_kylin_fact.cal_dt, max(test_kylin_fact.cal_dt) as mmm from test_kylin_fact left join test_cal_dt +select test_kylin_fact.cal_dt, max(test_kylin_fact.cal_dt) as mmm from test_kylin_fact left join edw.test_cal_dt as test_cal_dt on test_kylin_fact.cal_dt=test_cal_dt.cal_dt group by test_kylin_fact.cal_dt order by 2 desc limit 7 \ No newline at end of file diff --git a/query/src/test/resources/query/sql/query72.sql b/query/src/test/resources/query/sql/query72.sql index 14ea2e9..350e7aa 100644 --- a/query/src/test/resources/query/sql/query72.sql +++ b/query/src/test/resources/query/sql/query72.sql @@ -1,6 +1,6 @@ select test_cal_dt.week_beg_dt, test_kylin_fact.lstg_format_name, sum(test_kylin_fact.price) as GMV, count(*) as TRANS_CNT from test_kylin_fact - inner join test_cal_dt + inner JOIN edw.test_cal_dt as test_cal_dt on test_kylin_fact.cal_dt = test_cal_dt.cal_dt where test_kylin_fact.lstg_format_name='FP-GTC' or extract(MONTH from test_cal_dt.week_beg_dt) = 12 group by test_cal_dt.week_beg_dt, test_kylin_fact.lstg_format_name \ No newline at end of file diff --git a/query/src/test/resources/query/sql_derived/query01.sql b/query/src/test/resources/query/sql_derived/query01.sql index c471835..80d5738 100644 --- a/query/src/test/resources/query/sql_derived/query01.sql +++ b/query/src/test/resources/query/sql_derived/query01.sql @@ -10,11 +10,11 @@ SELECT ,test_sites.cre_user ,sum(test_kylin_fact.price) as GMV, count(*) as TRANS_CNT FROM test_kylin_fact - inner JOIN test_cal_dt + inner JOIN edw.test_cal_dt as test_cal_dt ON test_kylin_fact.cal_dt = test_cal_dt.cal_dt inner JOIN test_category_groupings ON test_kylin_fact.leaf_categ_id = test_category_groupings.leaf_categ_id AND test_kylin_fact.lstg_site_id = test_category_groupings.site_id - inner JOIN test_sites + inner JOIN edw.test_sites as test_sites ON test_kylin_fact.lstg_site_id = test_sites.site_id where test_kylin_fact.seller_id = 10000002 group by diff --git a/query/src/test/resources/query/sql_derived/query02.sql b/query/src/test/resources/query/sql_derived/query02.sql index 6c8b2da..0bf5ad9 100644 --- a/query/src/test/resources/query/sql_derived/query02.sql +++ b/query/src/test/resources/query/sql_derived/query02.sql @@ -10,11 +10,11 @@ SELECT ,test_sites.cre_user ,sum(test_kylin_fact.price) as GMV, count(*) as TRANS_CNT FROM test_kylin_fact - inner JOIN test_cal_dt + inner JOIN edw.test_cal_dt as test_cal_dt ON test_kylin_fact.cal_dt = test_cal_dt.cal_dt inner JOIN test_category_groupings ON test_kylin_fact.leaf_categ_id = test_category_groupings.leaf_categ_id AND test_kylin_fact.lstg_site_id = test_category_groupings.site_id - inner JOIN test_sites + inner JOIN edw.test_sites as test_sites ON test_kylin_fact.lstg_site_id = test_sites.site_id where test_kylin_fact.seller_id = 10000002 and test_sites.site_id=0 group by diff --git a/query/src/test/resources/query/sql_derived/query04.sql b/query/src/test/resources/query/sql_derived/query04.sql index 8ab1f88..cad008a 100644 --- a/query/src/test/resources/query/sql_derived/query04.sql +++ b/query/src/test/resources/query/sql_derived/query04.sql @@ -1,2 +1,2 @@ -SELECT site_id, site_name, cre_user from test_sites +SELECT site_id, site_name, cre_user from edw.test_sites diff --git a/query/src/test/resources/query/sql_derived/query05.sql b/query/src/test/resources/query/sql_derived/query05.sql index 9318e05..6b1caec 100644 --- a/query/src/test/resources/query/sql_derived/query05.sql +++ b/query/src/test/resources/query/sql_derived/query05.sql @@ -1,5 +1,5 @@ SELECT test_sites.site_name, test_kylin_fact.lstg_format_name, sum(test_kylin_fact.price) as GMV, count(*) as TRANS_CNT FROM test_kylin_fact - inner JOIN test_sites ON test_kylin_fact.lstg_site_id = test_sites.site_id + inner JOIN edw.test_sites as test_sites ON test_kylin_fact.lstg_site_id = test_sites.site_id GROUP BY test_sites.site_name, test_kylin_fact.lstg_format_name diff --git a/query/src/test/resources/query/sql_derived/query10.sql b/query/src/test/resources/query/sql_derived/query10.sql index 5505b67..f0d62d2 100644 --- a/query/src/test/resources/query/sql_derived/query10.sql +++ b/query/src/test/resources/query/sql_derived/query10.sql @@ -9,7 +9,7 @@ SELECT ,test_category_groupings.site_id ,sum(price) as GMV, count(*) as TRANS_CNT FROM test_kylin_fact - inner JOIN test_cal_dt + inner JOIN edw.test_cal_dt as test_cal_dt ON test_kylin_fact.cal_dt = test_cal_dt.cal_dt inner JOIN test_category_groupings ON test_kylin_fact.leaf_categ_id = test_category_groupings.leaf_categ_id diff --git a/query/src/test/resources/query/sql_distinct/query03.sql b/query/src/test/resources/query/sql_distinct/query03.sql index e3c91f1..a1b0e8d 100644 --- a/query/src/test/resources/query/sql_distinct/query03.sql +++ b/query/src/test/resources/query/sql_distinct/query03.sql @@ -1,7 +1,7 @@ select test_cal_dt.week_beg_dt,sum(test_kylin_fact.price) as GMV , count(1) as TRANS_CNT, count(distinct seller_id) as DIST_SELLER from test_kylin_fact - inner JOIN test_cal_dt + inner JOIN edw.test_cal_dt as test_cal_dt ON test_kylin_fact.cal_dt = test_cal_dt.cal_dt where test_kylin_fact.lstg_format_name='FP-GTC' and test_cal_dt.week_beg_dt between DATE '2013-05-01' and DATE '2013-08-01' diff --git a/query/src/test/resources/query/sql_distinct/query04.sql b/query/src/test/resources/query/sql_distinct/query04.sql index 3bc7c27..3bd7072 100644 --- a/query/src/test/resources/query/sql_distinct/query04.sql +++ b/query/src/test/resources/query/sql_distinct/query04.sql @@ -1,7 +1,7 @@ select test_cal_dt.week_beg_dt,sum(test_kylin_fact.price) as GMV , count(1) as TRANS_CNT, count(distinct seller_id) as DIST_SELLER from test_kylin_fact - inner JOIN test_cal_dt + inner JOIN edw.test_cal_dt as test_cal_dt ON test_kylin_fact.cal_dt = test_cal_dt.cal_dt where test_kylin_fact.lstg_format_name='FP-GTC' and test_cal_dt.week_beg_dt between DATE '2013-05-01' and DATE '2013-08-01' diff --git a/query/src/test/resources/query/sql_dynamic/query01.sql b/query/src/test/resources/query/sql_dynamic/query01.sql index f481edf..55f4e84 100644 --- a/query/src/test/resources/query/sql_dynamic/query01.sql +++ b/query/src/test/resources/query/sql_dynamic/query01.sql @@ -1,6 +1,6 @@ select test_cal_dt.week_beg_dt, test_kylin_fact.lstg_format_name, test_category_groupings.meta_categ_name, sum(test_kylin_fact.price) as gmv, count(*) as trans_cnt from test_kylin_fact - inner JOIN test_cal_dt + inner JOIN edw.test_cal_dt as test_cal_dt ON test_kylin_fact.cal_dt = test_cal_dt.cal_dt inner JOIN test_category_groupings ON test_kylin_fact.leaf_categ_id = test_category_groupings.leaf_categ_id AND test_kylin_fact.lstg_site_id = test_category_groupings.site_id diff --git a/query/src/test/resources/query/sql_dynamic/query02.sql b/query/src/test/resources/query/sql_dynamic/query02.sql index 701e6e4..ba4f563 100644 --- a/query/src/test/resources/query/sql_dynamic/query02.sql +++ b/query/src/test/resources/query/sql_dynamic/query02.sql @@ -1,7 +1,7 @@ select sum(1) as "col" from ( select test_cal_dt.week_beg_dt, test_kylin_fact.lstg_format_name, test_category_groupings.meta_categ_name, sum(test_kylin_fact.price) as gmv, count(*) as trans_cnt from test_kylin_fact - inner JOIN test_cal_dt + inner JOIN edw.test_cal_dt as test_cal_dt ON test_kylin_fact.cal_dt = test_cal_dt.cal_dt inner JOIN test_category_groupings ON test_kylin_fact.leaf_categ_id = test_category_groupings.leaf_categ_id AND test_kylin_fact.lstg_site_id = test_category_groupings.site_id diff --git a/query/src/test/resources/query/sql_hive/query10.sql b/query/src/test/resources/query/sql_hive/query10.sql index 8379174..6073e25 100644 --- a/query/src/test/resources/query/sql_hive/query10.sql +++ b/query/src/test/resources/query/sql_hive/query10.sql @@ -1,7 +1,7 @@ select test_cal_dt.QTR_BEG_DT,sum(test_kylin_fact.price) as gmv , count(*) as trans_cnt from test_kylin_fact - inner JOIN test_cal_dt + inner JOIN edw.test_cal_dt as test_cal_dt ON test_kylin_fact.cal_dt = test_cal_dt.cal_dt where test_kylin_fact.lstg_format_name='FP-GTC' and test_cal_dt.week_beg_dt between '2013-05-01' and '2013-08-01' diff --git a/query/src/test/resources/query/sql_invalid/query29_invalid_SQL.sql b/query/src/test/resources/query/sql_invalid/query29_invalid_SQL.sql index 7672a93..5c050c6 100644 --- a/query/src/test/resources/query/sql_invalid/query29_invalid_SQL.sql +++ b/query/src/test/resources/query/sql_invalid/query29_invalid_SQL.sql @@ -16,7 +16,7 @@ SELECT ON test_kylin_fact.cal_dt = test_cal_dt.cal_dt inner JOIN test_category_groupings ON test_kylin_fact.leaf_categ_id = test_category_groupings.leaf_categ_id AND test_kylin_fact.lstg_site_id = test_category_groupings.site_id - inner JOIN test_sites + inner JOIN edw.test_sites as test_sites ON test_kylin_fact.lstg_site_id = test_sites.site_id inner JOIN test_seller_type_dim ON test_kylin_fact.slr_segment_cd = test_seller_type_dim.seller_type_cd diff --git a/query/src/test/resources/query/sql_lookup/query01.sql b/query/src/test/resources/query/sql_lookup/query01.sql index 724c4fe..5ebeb92 100644 --- a/query/src/test/resources/query/sql_lookup/query01.sql +++ b/query/src/test/resources/query/sql_lookup/query01.sql @@ -1,4 +1,4 @@ -select CAL_DT, WEEK_BEG_DT from test_cal_dt +select CAL_DT, WEEK_BEG_DT from edw.test_cal_dt diff --git a/query/src/test/resources/query/sql_lookup/query03.sql b/query/src/test/resources/query/sql_lookup/query03.sql index 3186374..c3ba6b3 100644 --- a/query/src/test/resources/query/sql_lookup/query03.sql +++ b/query/src/test/resources/query/sql_lookup/query03.sql @@ -1 +1 @@ -select SELLER_TYPE_DESC, SELLER_TYPE_CD from test_seller_type_dim +select SELLER_TYPE_DESC, SELLER_TYPE_CD from edw.test_seller_type_dim diff --git a/query/src/test/resources/query/sql_lookup/query04.sql b/query/src/test/resources/query/sql_lookup/query04.sql index 83598c7..1c31efa 100644 --- a/query/src/test/resources/query/sql_lookup/query04.sql +++ b/query/src/test/resources/query/sql_lookup/query04.sql @@ -1 +1 @@ -select SITE_NAME, SITE_ID from test_sites +select SITE_NAME, SITE_ID from edw.test_sites diff --git a/query/src/test/resources/query/sql_orderby/query01.sql b/query/src/test/resources/query/sql_orderby/query01.sql index afbde8e..b3359e0 100644 --- a/query/src/test/resources/query/sql_orderby/query01.sql +++ b/query/src/test/resources/query/sql_orderby/query01.sql @@ -1,6 +1,6 @@ select test_cal_dt.Week_Beg_Dt, sum(price) as c1, count(1) as c2 - from test_kylin_fact - inner JOIN test_cal_dt + 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 where test_kylin_fact.lstg_format_name='ABIN' and test_cal_dt.week_beg_dt >= DATE '2013-06-09' diff --git a/query/src/test/resources/query/sql_subquery/query00.sql b/query/src/test/resources/query/sql_subquery/query00.sql index e2737ac..75503f0 100644 --- a/query/src/test/resources/query/sql_subquery/query00.sql +++ b/query/src/test/resources/query/sql_subquery/query00.sql @@ -1,4 +1,4 @@ select test_cal_dt.week_beg_dt, sum(test_kylin_fact.price) as sum_price, count(1) as cnt_1 - from test_kylin_fact - inner join test_cal_dt ON test_kylin_fact.cal_dt = test_cal_dt.cal_dt + 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 group by test_cal_dt.week_beg_dt \ No newline at end of file diff --git a/query/src/test/resources/query/sql_subquery/query01.sql b/query/src/test/resources/query/sql_subquery/query01.sql index b5c93b2..9d7a2a0 100644 --- a/query/src/test/resources/query/sql_subquery/query01.sql +++ b/query/src/test/resources/query/sql_subquery/query01.sql @@ -2,7 +2,7 @@ SELECT sum(sum_price) AS "COL" FROM ( select test_cal_dt.week_beg_dt, sum(test_kylin_fact.price) as sum_price, count(1) as cnt_1 from test_kylin_fact - inner join test_cal_dt ON test_kylin_fact.cal_dt = test_cal_dt.cal_dt + inner join edw.test_cal_dt as test_cal_dt ON test_kylin_fact.cal_dt = test_cal_dt.cal_dt group by test_cal_dt.week_beg_dt ) "TableauSQL" HAVING COUNT(1)>0 \ No newline at end of file diff --git a/query/src/test/resources/query/sql_subquery/query03.sql b/query/src/test/resources/query/sql_subquery/query03.sql index e74cc58..2f285ad 100644 --- a/query/src/test/resources/query/sql_subquery/query03.sql +++ b/query/src/test/resources/query/sql_subquery/query03.sql @@ -1,9 +1,9 @@ select fact.cal_dt, sum(fact.price) as sum_price, count(1) as cnt_1 from test_kylin_fact fact -left join test_cal_dt cal on fact.cal_dt=cal.cal_dt +left join edw.test_cal_dt cal on fact.cal_dt=cal.cal_dt inner join ( - select test_kylin_fact.cal_dt, sum(test_kylin_fact.price) from test_kylin_fact left join test_cal_dt + select test_kylin_fact.cal_dt, sum(test_kylin_fact.price) from test_kylin_fact left join edw.test_cal_dt test_cal_dt on test_kylin_fact.cal_dt=test_cal_dt.cal_dt group by test_kylin_fact.cal_dt order by 2 desc limit 7 ) cal_2 on fact.cal_dt = cal_2.cal_dt group by fact.cal_dt \ No newline at end of file diff --git a/query/src/test/resources/query/sql_subquery/query04.sql b/query/src/test/resources/query/sql_subquery/query04.sql index 83d8ca6..52fb10f 100644 --- a/query/src/test/resources/query/sql_subquery/query04.sql +++ b/query/src/test/resources/query/sql_subquery/query04.sql @@ -1,9 +1,9 @@ select fact.cal_dt, sum(fact.price) as sum_price, count(1) as cnt_1 from test_kylin_fact fact -left join test_cal_dt cal on fact.cal_dt=cal.cal_dt +left join edw.test_cal_dt cal on fact.cal_dt=cal.cal_dt inner join ( - select test_kylin_fact.cal_dt, max(test_kylin_fact.cal_dt) as mmm from test_kylin_fact left join test_cal_dt + select test_kylin_fact.cal_dt, max(test_kylin_fact.cal_dt) as mmm from test_kylin_fact left join edw.test_cal_dt test_cal_dt on test_kylin_fact.cal_dt=test_cal_dt.cal_dt group by test_kylin_fact.cal_dt order by 2 desc limit 7 ) cal_2 on fact.cal_dt = cal_2.mmm group by fact.cal_dt \ No newline at end of file diff --git a/query/src/test/resources/query/sql_subquery/query05.sql b/query/src/test/resources/query/sql_subquery/query05.sql index 1ae2005..91b15d9 100644 --- a/query/src/test/resources/query/sql_subquery/query05.sql +++ b/query/src/test/resources/query/sql_subquery/query05.sql @@ -1,10 +1,10 @@ SELECT SUM("TEST_KYLIN_FACT"."PRICE") AS "sum_PRICE_ok" FROM "TEST_KYLIN_FACT" - INNER JOIN "TEST_CAL_DT" ON ("TEST_KYLIN_FACT"."CAL_DT" = "TEST_CAL_DT"."CAL_DT") + INNER JOIN "EDW"."TEST_CAL_DT" AS "TEST_CAL_DT" ON ("TEST_KYLIN_FACT"."CAL_DT" = "TEST_CAL_DT"."CAL_DT") INNER JOIN ( SELECT COUNT(1) AS "XTableau_join_flag", SUM("TEST_KYLIN_FACT"."PRICE") AS "X__alias__A", "TEST_KYLIN_FACT"."CAL_DT" AS "none_CAL_DT_ok" FROM "TEST_KYLIN_FACT" - INNER JOIN "TEST_CAL_DT" ON ("TEST_KYLIN_FACT"."CAL_DT" = "TEST_CAL_DT"."CAL_DT") + INNER JOIN "EDW"."TEST_CAL_DT" AS "TEST_CAL_DT" ON ("TEST_KYLIN_FACT"."CAL_DT" = "TEST_CAL_DT"."CAL_DT") GROUP BY "TEST_KYLIN_FACT"."CAL_DT" ORDER BY 2 DESC LIMIT 10 ) "t0" ON ("TEST_KYLIN_FACT"."CAL_DT" = "t0"."none_CAL_DT_ok") GROUP BY "TEST_KYLIN_FACT"."CAL_DT" \ No newline at end of file diff --git a/query/src/test/resources/query/sql_tableau/query00.sql b/query/src/test/resources/query/sql_tableau/query00.sql index 790e348..a9f4642 100644 --- a/query/src/test/resources/query/sql_tableau/query00.sql +++ b/query/src/test/resources/query/sql_tableau/query00.sql @@ -1,5 +1,5 @@ select test_cal_dt.week_beg_dt, sum(test_kylin_fact.price) from test_kylin_fact - inner join test_cal_dt ON test_kylin_fact.cal_dt = test_cal_dt.cal_dt + inner join edw.test_cal_dt as test_cal_dt ON test_kylin_fact.cal_dt = test_cal_dt.cal_dt group by test_cal_dt.week_beg_dt diff --git a/query/src/test/resources/query/sql_tableau/query01.sql b/query/src/test/resources/query/sql_tableau/query01.sql index 44e4c63..0503355 100644 --- a/query/src/test/resources/query/sql_tableau/query01.sql +++ b/query/src/test/resources/query/sql_tableau/query01.sql @@ -4,7 +4,7 @@ SELECT SUM(1) AS "COL", select test_kylin_fact.lstg_format_name, test_cal_dt.week_beg_dt,sum(test_kylin_fact.price) as GMV , count(*) as TRANS_CNT from test_kylin_fact - inner JOIN test_cal_dt + inner JOIN edw.test_cal_dt as test_cal_dt ON test_kylin_fact.cal_dt = test_cal_dt.cal_dt where test_cal_dt.week_beg_dt between DATE '2013-05-01' and DATE '2013-08-01' group by test_kylin_fact.lstg_format_name, test_cal_dt.week_beg_dt diff --git a/query/src/test/resources/query/sql_tableau/query02.sql b/query/src/test/resources/query/sql_tableau/query02.sql index ca40f11..efe6cef 100644 --- a/query/src/test/resources/query/sql_tableau/query02.sql +++ b/query/src/test/resources/query/sql_tableau/query02.sql @@ -3,7 +3,7 @@ SELECT * select test_kylin_fact.lstg_format_name, test_cal_dt.week_beg_dt,sum(test_kylin_fact.price) as GMV , count(*) as TRANS_CNT from test_kylin_fact - inner JOIN test_cal_dt + inner JOIN edw.test_cal_dt as test_cal_dt ON test_kylin_fact.cal_dt = test_cal_dt.cal_dt where test_cal_dt.week_beg_dt between DATE '2013-05-01' and DATE '2013-08-01' group by test_kylin_fact.lstg_format_name, test_cal_dt.week_beg_dt diff --git a/query/src/test/resources/query/sql_tableau/query03.sql b/query/src/test/resources/query/sql_tableau/query03.sql index b78a587..02225f0 100644 --- a/query/src/test/resources/query/sql_tableau/query03.sql +++ b/query/src/test/resources/query/sql_tableau/query03.sql @@ -6,7 +6,7 @@ SELECT ,sum(test_kylin_fact.price) as GMV , count(*) as TRANS_CNT FROM test_kylin_fact - inner JOIN test_cal_dt + inner JOIN edw.test_cal_dt as test_cal_dt ON test_kylin_fact.cal_dt = test_cal_dt.cal_dt inner JOIN test_category_groupings ON test_kylin_fact.leaf_categ_id = test_category_groupings.leaf_categ_id diff --git a/query/src/test/resources/query/sql_tableau/query04.sql b/query/src/test/resources/query/sql_tableau/query04.sql index b7c8a99..0cd6f6e 100644 --- a/query/src/test/resources/query/sql_tableau/query04.sql +++ b/query/src/test/resources/query/sql_tableau/query04.sql @@ -8,7 +8,7 @@ SELECT "TableauSQL"."META_CATEG_NAME" AS "none_META_CATEG_NAME_nk" ,sum(test_kylin_fact.price) as GMV , count(*) as TRANS_CNT FROM test_kylin_fact - inner JOIN test_cal_dt + inner JOIN edw.test_cal_dt as test_cal_dt ON test_kylin_fact.cal_dt = test_cal_dt.cal_dt inner JOIN test_category_groupings ON test_kylin_fact.leaf_categ_id = test_category_groupings.leaf_categ_id diff --git a/query/src/test/resources/query/sql_tableau/query05.sql b/query/src/test/resources/query/sql_tableau/query05.sql index 25e8f89..40062f1 100644 --- a/query/src/test/resources/query/sql_tableau/query05.sql +++ b/query/src/test/resources/query/sql_tableau/query05.sql @@ -9,7 +9,7 @@ SELECT SUM("TableauSQL"."GMV") AS "sum_GMV_ok", ,sum(test_kylin_fact.price) as GMV , count(*) as TRANS_CNT FROM test_kylin_fact - inner JOIN test_cal_dt + inner JOIN edw.test_cal_dt as test_cal_dt ON test_kylin_fact.cal_dt = test_cal_dt.cal_dt inner JOIN test_category_groupings ON test_kylin_fact.leaf_categ_id = test_category_groupings.leaf_categ_id diff --git a/query/src/test/resources/query/sql_tableau/query06.sql b/query/src/test/resources/query/sql_tableau/query06.sql index 25e8f89..40062f1 100644 --- a/query/src/test/resources/query/sql_tableau/query06.sql +++ b/query/src/test/resources/query/sql_tableau/query06.sql @@ -9,7 +9,7 @@ SELECT SUM("TableauSQL"."GMV") AS "sum_GMV_ok", ,sum(test_kylin_fact.price) as GMV , count(*) as TRANS_CNT FROM test_kylin_fact - inner JOIN test_cal_dt + inner JOIN edw.test_cal_dt as test_cal_dt ON test_kylin_fact.cal_dt = test_cal_dt.cal_dt inner JOIN test_category_groupings ON test_kylin_fact.leaf_categ_id = test_category_groupings.leaf_categ_id diff --git a/query/src/test/resources/query/sql_tableau/query07.sql b/query/src/test/resources/query/sql_tableau/query07.sql index 5cf3bae..eda5533 100644 --- a/query/src/test/resources/query/sql_tableau/query07.sql +++ b/query/src/test/resources/query/sql_tableau/query07.sql @@ -2,7 +2,7 @@ SELECT SUM("TableauSQL"."GMV") AS "sum_GMV_ok", SUM("TableauSQL"."TRANS_CNT") AS FROM ( SELECT test_cal_dt.week_beg_dt ,test_category_groupings.meta_categ_name ,test_category_groupings.categ_lvl2_name ,test_category_groupings.categ_lvl3_name ,sum(test_kylin_fact.price) as GMV , count(*) as TRANS_CNT FROM test_kylin_fact - inner JOIN test_cal_dt ON test_kylin_fact.cal_dt = test_cal_dt.cal_dt + inner JOIN edw.test_cal_dt as test_cal_dt ON test_kylin_fact.cal_dt = test_cal_dt.cal_dt inner JOIN test_category_groupings ON test_kylin_fact.leaf_categ_id = test_category_groupings.leaf_categ_id AND test_kylin_fact.lstg_site_id = test_category_groupings.site_id group by test_cal_dt.week_beg_dt ,test_category_groupings.meta_categ_name ,test_category_groupings.categ_lvl2_name ,test_category_groupings.categ_lvl3_name ) "TableauSQL" HAVING (COUNT(1) > 0) diff --git a/query/src/test/resources/query/sql_tableau/query10.sql b/query/src/test/resources/query/sql_tableau/query10.sql index 26d29a3..290fd57 100644 --- a/query/src/test/resources/query/sql_tableau/query10.sql +++ b/query/src/test/resources/query/sql_tableau/query10.sql @@ -1,5 +1,5 @@ SELECT "TEST_CAL_DT"."WEEK_BEG_DT" AS "none_WEEK_BEG_DT_nk", SUM("TEST_KYLIN_FACT"."PRICE") AS "sum_PRICE_ok" FROM "TEST_KYLIN_FACT" - inner JOIN "TEST_CAL_DT" ON ("TEST_KYLIN_FACT"."CAL_DT" = "TEST_CAL_DT"."CAL_DT") + inner JOIN "EDW"."TEST_CAL_DT" AS "TEST_CAL_DT" ON ("TEST_KYLIN_FACT"."CAL_DT" = "TEST_CAL_DT"."CAL_DT") GROUP BY "TEST_CAL_DT"."WEEK_BEG_DT" diff --git a/query/src/test/resources/query/sql_tableau/query11.sql b/query/src/test/resources/query/sql_tableau/query11.sql index d7e70c1..3b649c8 100644 --- a/query/src/test/resources/query/sql_tableau/query11.sql +++ b/query/src/test/resources/query/sql_tableau/query11.sql @@ -1,6 +1,6 @@ SELECT COUNT(1) AS cnt_ITEM_COUNT_ok, TEST_CAL_DT.WEEK_BEG_DT AS none_WEEK_BEG_DT_nk FROM "TEST_KYLIN_FACT" - inner JOIN "TEST_CAL_DT" ON ("TEST_KYLIN_FACT"."CAL_DT" = "TEST_CAL_DT"."CAL_DT") + inner JOIN "EDW"."TEST_CAL_DT" AS "TEST_CAL_DT" ON ("TEST_KYLIN_FACT"."CAL_DT" = "TEST_CAL_DT"."CAL_DT") GROUP BY "TEST_CAL_DT"."WEEK_BEG_DT" diff --git a/query/src/test/resources/query/sql_tableau/query12.sql b/query/src/test/resources/query/sql_tableau/query12.sql index 26d29a3..290fd57 100644 --- a/query/src/test/resources/query/sql_tableau/query12.sql +++ b/query/src/test/resources/query/sql_tableau/query12.sql @@ -1,5 +1,5 @@ SELECT "TEST_CAL_DT"."WEEK_BEG_DT" AS "none_WEEK_BEG_DT_nk", SUM("TEST_KYLIN_FACT"."PRICE") AS "sum_PRICE_ok" FROM "TEST_KYLIN_FACT" - inner JOIN "TEST_CAL_DT" ON ("TEST_KYLIN_FACT"."CAL_DT" = "TEST_CAL_DT"."CAL_DT") + inner JOIN "EDW"."TEST_CAL_DT" AS "TEST_CAL_DT" ON ("TEST_KYLIN_FACT"."CAL_DT" = "TEST_CAL_DT"."CAL_DT") GROUP BY "TEST_CAL_DT"."WEEK_BEG_DT" diff --git a/query/src/test/resources/query/sql_tableau/query13.sql b/query/src/test/resources/query/sql_tableau/query13.sql index 28c0e05..7896269 100644 --- a/query/src/test/resources/query/sql_tableau/query13.sql +++ b/query/src/test/resources/query/sql_tableau/query13.sql @@ -1,4 +1,4 @@ SELECT EXTRACT(YEAR FROM TEST_CAL_DT.WEEK_BEG_DT) AS yr_WEEK_BEG_DT_ok FROM TEST_KYLIN_FACT - inner JOIN TEST_CAL_DT ON (TEST_KYLIN_FACT.CAL_DT = TEST_CAL_DT.CAL_DT) + inner JOIN EDW.TEST_CAL_DT AS TEST_CAL_DT ON (TEST_KYLIN_FACT.CAL_DT = TEST_CAL_DT.CAL_DT) GROUP BY EXTRACT(YEAR FROM TEST_CAL_DT.WEEK_BEG_DT) diff --git a/query/src/test/resources/query/sql_tableau/query14.sql b/query/src/test/resources/query/sql_tableau/query14.sql index 0f5d99c..6a2d9d8 100644 --- a/query/src/test/resources/query/sql_tableau/query14.sql +++ b/query/src/test/resources/query/sql_tableau/query14.sql @@ -1 +1 @@ -SELECT QUARTER("TEST_CAL_DT"."WEEK_BEG_DT") AS "qr_WEEK_BEG_DT_ok", EXTRACT(YEAR FROM "TEST_CAL_DT"."WEEK_BEG_DT") AS "yr_WEEK_BEG_DT_ok" FROM "TEST_KYLIN_FACT" inner JOIN "TEST_CAL_DT" ON ("TEST_KYLIN_FACT"."CAL_DT" = "TEST_CAL_DT"."CAL_DT") GROUP BY QUARTER("TEST_CAL_DT"."WEEK_BEG_DT"), EXTRACT(YEAR FROM "TEST_CAL_DT"."WEEK_BEG_DT") +SELECT QUARTER("TEST_CAL_DT"."WEEK_BEG_DT") AS "qr_WEEK_BEG_DT_ok", EXTRACT(YEAR FROM "TEST_CAL_DT"."WEEK_BEG_DT") AS "yr_WEEK_BEG_DT_ok" 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") GROUP BY QUARTER("TEST_CAL_DT"."WEEK_BEG_DT"), EXTRACT(YEAR FROM "TEST_CAL_DT"."WEEK_BEG_DT") diff --git a/query/src/test/resources/query/sql_tableau/query15.sql b/query/src/test/resources/query/sql_tableau/query15.sql index 6bebae6..23c324d 100644 --- a/query/src/test/resources/query/sql_tableau/query15.sql +++ b/query/src/test/resources/query/sql_tableau/query15.sql @@ -1,4 +1,4 @@ SELECT QUARTER(TEST_CAL_DT.WEEK_BEG_DT) AS qr_WEEK_BEG_DT_ok FROM TEST_KYLIN_FACT - inner JOIN TEST_CAL_DT ON (TEST_KYLIN_FACT.CAL_DT = TEST_CAL_DT.CAL_DT) + inner JOIN EDW.TEST_CAL_DT AS TEST_CAL_DT ON (TEST_KYLIN_FACT.CAL_DT = TEST_CAL_DT.CAL_DT) GROUP BY QUARTER(TEST_CAL_DT.WEEK_BEG_DT) diff --git a/query/src/test/resources/query/sql_tableau/query16.sql b/query/src/test/resources/query/sql_tableau/query16.sql index 28d2dbb..75b66ff 100644 --- a/query/src/test/resources/query/sql_tableau/query16.sql +++ b/query/src/test/resources/query/sql_tableau/query16.sql @@ -1,4 +1,4 @@ SELECT EXTRACT(YEAR FROM TEST_CAL_DT.WEEK_BEG_DT) AS yr_WEEK_BEG_DT_ok, QUARTER(TEST_CAL_DT.WEEK_BEG_DT) AS qr_WEEK_BEG_DT_ok FROM TEST_KYLIN_FACT - inner JOIN TEST_CAL_DT ON (TEST_KYLIN_FACT.CAL_DT = TEST_CAL_DT.CAL_DT) + inner JOIN EDW.TEST_CAL_DT AS TEST_CAL_DT ON (TEST_KYLIN_FACT.CAL_DT = TEST_CAL_DT.CAL_DT) GROUP BY EXTRACT(YEAR FROM TEST_CAL_DT.WEEK_BEG_DT), QUARTER(TEST_CAL_DT.WEEK_BEG_DT) diff --git a/query/src/test/resources/query/sql_tableau/query17.sql b/query/src/test/resources/query/sql_tableau/query17.sql index c4dfba3..e1fba40 100644 --- a/query/src/test/resources/query/sql_tableau/query17.sql +++ b/query/src/test/resources/query/sql_tableau/query17.sql @@ -1 +1 @@ -SELECT EXTRACT(MONTH FROM "TEST_CAL_DT"."WEEK_BEG_DT") AS "mn_WEEK_BEG_DT_ok", (( EXTRACT(YEAR FROM "TEST_CAL_DT"."WEEK_BEG_DT") * 100) + EXTRACT(MONTH FROM "TEST_CAL_DT"."WEEK_BEG_DT")) AS "my_WEEK_BEG_DT_ok", QUARTER("TEST_CAL_DT"."WEEK_BEG_DT") AS "qr_WEEK_BEG_DT_ok", EXTRACT(YEAR FROM "TEST_CAL_DT"."WEEK_BEG_DT") AS "yr_WEEK_BEG_DT_ok" FROM "TEST_KYLIN_FACT" inner JOIN "TEST_CAL_DT" ON ("TEST_KYLIN_FACT"."CAL_DT" = "TEST_CAL_DT"."CAL_DT") GROUP BY EXTRACT(YEAR FROM "TEST_CAL_DT"."WEEK_BEG_DT"), QUARTER("TEST_CAL_DT"."WEEK_BEG_DT"), (( EXTRACT(YEAR FROM "TEST_CAL_DT"."WEEK_BEG_DT") * 100) + EXTRACT(MONTH FROM "TEST_CAL_DT"."WEEK_BEG_DT")), EXTRACT(MONTH FROM "TEST_CAL_DT"."WEEK_BEG_DT") +SELECT EXTRACT(MONTH FROM "TEST_CAL_DT"."WEEK_BEG_DT") AS "mn_WEEK_BEG_DT_ok", (( EXTRACT(YEAR FROM "TEST_CAL_DT"."WEEK_BEG_DT") * 100) + EXTRACT(MONTH FROM "TEST_CAL_DT"."WEEK_BEG_DT")) AS "my_WEEK_BEG_DT_ok", QUARTER("TEST_CAL_DT"."WEEK_BEG_DT") AS "qr_WEEK_BEG_DT_ok", EXTRACT(YEAR FROM "TEST_CAL_DT"."WEEK_BEG_DT") AS "yr_WEEK_BEG_DT_ok" 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") GROUP BY EXTRACT(YEAR FROM "TEST_CAL_DT"."WEEK_BEG_DT"), QUARTER("TEST_CAL_DT"."WEEK_BEG_DT"), (( EXTRACT(YEAR FROM "TEST_CAL_DT"."WEEK_BEG_DT") * 100) + EXTRACT(MONTH FROM "TEST_CAL_DT"."WEEK_BEG_DT")), EXTRACT(MONTH FROM "TEST_CAL_DT"."WEEK_BEG_DT") diff --git a/query/src/test/resources/query/sql_tableau/query21.sql b/query/src/test/resources/query/sql_tableau/query21.sql index a31f1a7..6905df6 100644 --- a/query/src/test/resources/query/sql_tableau/query21.sql +++ b/query/src/test/resources/query/sql_tableau/query21.sql @@ -1,7 +1,7 @@ select test_kylin_fact.lstg_format_name, test_cal_dt.week_beg_dt,sum(test_kylin_fact.price) as GMV , count(*) as TRANS_CNT from test_kylin_fact - inner JOIN test_cal_dt + inner JOIN EDW.TEST_CAL_DT AS TEST_CAL_DT ON test_kylin_fact.cal_dt = test_cal_dt.cal_dt where test_cal_dt.week_beg_dt between DATE '2013-05-01' and DATE '2013-08-01' group by test_kylin_fact.lstg_format_name, test_cal_dt.week_beg_dt diff --git a/query/src/test/resources/query/sql_tableau/query23.sql b/query/src/test/resources/query/sql_tableau/query23.sql index 50df99e..c53185a 100644 --- a/query/src/test/resources/query/sql_tableau/query23.sql +++ b/query/src/test/resources/query/sql_tableau/query23.sql @@ -1,5 +1,5 @@ select fact.cal_dt, sum(fact.price) from test_kylin_fact fact -left join test_cal_dt cal on fact.cal_dt=cal.cal_dt +left join EDW.TEST_CAL_DT cal on fact.cal_dt=cal.cal_dt where cal.cal_dt = date '2012-05-17' or cal.cal_dt = date '2013-05-17' group by fact.cal_dt \ No newline at end of file diff --git a/query/src/test/resources/query/sql_tableau/query24.sql b/query/src/test/resources/query/sql_tableau/query24.sql index 6a975b1..5593281 100644 --- a/query/src/test/resources/query/sql_tableau/query24.sql +++ b/query/src/test/resources/query/sql_tableau/query24.sql @@ -1,6 +1,6 @@ select test_kylin_fact.cal_dt, count(1) as cnt_1 from test_kylin_fact -left join test_cal_dt on test_kylin_fact.cal_dt=test_cal_dt.cal_dt +left join EDW.TEST_CAL_DT AS TEST_CAL_DT on test_kylin_fact.cal_dt=test_cal_dt.cal_dt group by test_kylin_fact.cal_dt order by 2 desc limit 3 \ No newline at end of file diff --git a/query/src/test/resources/query/sql_tableau/query25.sql b/query/src/test/resources/query/sql_tableau/query25.sql index 4b6fb88..9703ec0 100644 --- a/query/src/test/resources/query/sql_tableau/query25.sql +++ b/query/src/test/resources/query/sql_tableau/query25.sql @@ -1,10 +1,10 @@ SELECT "TEST_KYLIN_FACT"."CAL_DT", SUM("TEST_KYLIN_FACT"."PRICE") AS "sum_PRICE_ok" FROM "TEST_KYLIN_FACT" - INNER JOIN "TEST_CAL_DT" ON ("TEST_KYLIN_FACT"."CAL_DT" = "TEST_CAL_DT"."CAL_DT") + INNER JOIN "EDW"."TEST_CAL_DT" AS "TEST_CAL_DT" ON ("TEST_KYLIN_FACT"."CAL_DT" = "TEST_CAL_DT"."CAL_DT") INNER JOIN ( SELECT COUNT(1) AS "XTableau_join_flag", SUM("TEST_KYLIN_FACT"."PRICE") AS "X__alias__A", "TEST_KYLIN_FACT"."CAL_DT" AS "none_CAL_DT_ok" FROM "TEST_KYLIN_FACT" - INNER JOIN "TEST_CAL_DT" ON ("TEST_KYLIN_FACT"."CAL_DT" = "TEST_CAL_DT"."CAL_DT") + INNER JOIN "EDW"."TEST_CAL_DT" AS "TEST_CAL_DT" ON ("TEST_KYLIN_FACT"."CAL_DT" = "TEST_CAL_DT"."CAL_DT") GROUP BY "TEST_KYLIN_FACT"."CAL_DT" ORDER BY 2 DESC LIMIT 10 ) "t0" ON ("TEST_KYLIN_FACT"."CAL_DT" = "t0"."none_CAL_DT_ok") GROUP BY "TEST_KYLIN_FACT"."CAL_DT" \ No newline at end of file diff --git a/query/src/test/resources/query/sql_tableau/query27.sql b/query/src/test/resources/query/sql_tableau/query27.sql index c118f34..47e92c8 100644 --- a/query/src/test/resources/query/sql_tableau/query27.sql +++ b/query/src/test/resources/query/sql_tableau/query27.sql @@ -1,6 +1,6 @@ -SELECT "TEST_KYLIN_FACT"."CAL_DT", SUM("TEST_KYLIN_FACT"."PRICE") AS "sum_PRICE_ok" FROM "EDW"."TEST_KYLIN_FACT" "TEST_KYLIN_FACT" +SELECT "TEST_KYLIN_FACT"."CAL_DT", SUM("TEST_KYLIN_FACT"."PRICE") AS "sum_PRICE_ok" FROM "TEST_KYLIN_FACT" INNER JOIN ( - SELECT COUNT(1) AS "XTableau_join_flag", SUM("TEST_KYLIN_FACT"."PRICE") AS "X__alias__A", "TEST_KYLIN_FACT"."CAL_DT" AS "none_CAL_DT_ok" FROM "EDW"."TEST_KYLIN_FACT" "TEST_KYLIN_FACT" + SELECT COUNT(1) AS "XTableau_join_flag", SUM("TEST_KYLIN_FACT"."PRICE") AS "X__alias__A", "TEST_KYLIN_FACT"."CAL_DT" AS "none_CAL_DT_ok" FROM "TEST_KYLIN_FACT" GROUP BY "TEST_KYLIN_FACT"."CAL_DT" ORDER BY 2 DESC LIMIT 7 ) "t0" ON ("TEST_KYLIN_FACT"."CAL_DT" = "t0"."none_CAL_DT_ok") GROUP BY "TEST_KYLIN_FACT"."CAL_DT" diff --git a/storage/src/main/java/com/kylinolap/storage/filter/ColumnTupleFilter.java b/storage/src/main/java/com/kylinolap/storage/filter/ColumnTupleFilter.java index 1ad0e5f..c3923c0 100644 --- a/storage/src/main/java/com/kylinolap/storage/filter/ColumnTupleFilter.java +++ b/storage/src/main/java/com/kylinolap/storage/filter/ColumnTupleFilter.java @@ -99,12 +99,15 @@ public boolean isEvaluable() { @Override public void deserialize(byte[] bytes) { + ColumnDesc column = new ColumnDesc(); ByteBuffer buffer = ByteBuffer.wrap(bytes); - TableDesc table = new TableDesc(); - table.setName(BytesUtil.readUTFString(buffer)); + String tableName = BytesUtil.readUTFString(buffer); + if(tableName != null) { + TableDesc table = new TableDesc(); + table.setName(tableName); + column.setTable(table); + } - ColumnDesc column = new ColumnDesc(); - column.setTable(table); column.setName(BytesUtil.readUTFString(buffer)); column.setDatatype(BytesUtil.readUTFString(buffer)); diff --git a/storage/src/test/java/com/kylinolap/storage/filter/FilterBaseTest.java b/storage/src/test/java/com/kylinolap/storage/filter/FilterBaseTest.java index bfae2d3..3f85c79 100644 --- a/storage/src/test/java/com/kylinolap/storage/filter/FilterBaseTest.java +++ b/storage/src/test/java/com/kylinolap/storage/filter/FilterBaseTest.java @@ -39,7 +39,7 @@ TableDesc t1 = new TableDesc(); t1.setName("TEST_KYLIN_FACT"); - t1.setDatabase("EDW"); + t1.setDatabase("DEFAULT"); ColumnDesc c1 = new ColumnDesc(); c1.setName("CAL_DT"); c1.setDatatype("String"); @@ -49,7 +49,7 @@ TableDesc t2 = new TableDesc(); t2.setName("TEST_CATEGORY_GROUPINGS"); - t2.setDatabase("EDW"); + t2.setDatabase("DEFAULT"); ColumnDesc c2 = new ColumnDesc(); c2.setName("META_CATEG_NAME"); c1.setDatatype("String");