[CARBONDATA-1314] Fix scalatest issues Fix scalatest issues, as below : Error:(238, 16) can't expand macros compiled by previous versions of Scala assert(false)
This closes #1184 Project: http://git-wip-us.apache.org/repos/asf/carbondata/repo Commit: http://git-wip-us.apache.org/repos/asf/carbondata/commit/b23d357e Tree: http://git-wip-us.apache.org/repos/asf/carbondata/tree/b23d357e Diff: http://git-wip-us.apache.org/repos/asf/carbondata/diff/b23d357e Branch: refs/heads/master Commit: b23d357ecf4bcba96413df772109e15dafe0aee3 Parents: a03f7b1 Author: chenliang613 <[email protected]> Authored: Wed Jul 19 00:21:39 2017 +0800 Committer: Ravindra Pesala <[email protected]> Committed: Wed Jul 19 08:20:39 2017 +0530 ---------------------------------------------------------------------- .../src/test/resources/alldatatypescube.xml | 109 -- .../src/test/resources/integertypecube.xml | 55 - .../src/test/resources/numerictypecube.xml | 41 - .../src/test/resources/stringtypecube.xml | 55 - .../src/test/resources/timestamptypecube.xml | 50 - .../AllDataTypesTestCaseAggregate.scala | 18 +- .../allqueries/AllDataTypesTestCase.scala | 1157 +++++++++++++++++ .../AllDataTypesTestCaseAggregate.scala | 1160 ------------------ .../detailquery/AllDataTypesTestCase.scala | 48 - .../detailquery/AllQueriesSpark2TestCase.scala | 48 + integration/spark-common/pom.xml | 1 + .../AllDataTypesTestCaseAggregate.scala | 60 - .../allqueries/AllQueriesSpark1TestCase.scala | 60 + 13 files changed, 1274 insertions(+), 1588 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/carbondata/blob/b23d357e/integration/spark-common-test/src/test/resources/alldatatypescube.xml ---------------------------------------------------------------------- diff --git a/integration/spark-common-test/src/test/resources/alldatatypescube.xml b/integration/spark-common-test/src/test/resources/alldatatypescube.xml deleted file mode 100644 index 84a4a68..0000000 --- a/integration/spark-common-test/src/test/resources/alldatatypescube.xml +++ /dev/null @@ -1,109 +0,0 @@ -<!-- - ~ Licensed to the Apache Software Foundation (ASF) under one - ~ or more contributor license agreements. See the NOTICE file - ~ distributed with this work for additional information - ~ regarding copyright ownership. The ASF licenses this file - ~ to you under the Apache License, Version 2.0 (the - ~ "License"); you may not use this file except in compliance - ~ with the License. You may obtain a copy of the License at - ~ - ~ http://www.apache.org/licenses/LICENSE-2.0 - ~ - ~ Unless required by applicable law or agreed to in writing, - ~ software distributed under the License is distributed on an - ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - ~ KIND, either express or implied. See the License for the - ~ specific language governing permissions and limitations - ~ under the License. - --> - -<Schema name="default"> - <Cube name="alldatatypescube" visible="true" cache="true" enabled="true"> - <Table name="alldatatypescube" alias=""> - </Table> - <Dimension type="StandardDimension" visible="true" highCardinality="false" name="empno"> - <Hierarchy name="empno" hasAll="true" normalized="false"> - <Level name="empno" column="empno" type="Integer" levelType="Regular"> - </Level> - </Hierarchy> - </Dimension> - <Dimension type="StandardDimension" visible="true" highCardinality="false" name="empname"> - <Hierarchy name="empname" hasAll="true" normalized="false"> - <Level name="empname" column="empname" type="String" levelType="Regular"> - </Level> - </Hierarchy> - </Dimension> - <Dimension type="StandardDimension" visible="true" highCardinality="false" - name="designation"> - <Hierarchy name="designation" hasAll="true" normalized="false"> - <Level name="designation" column="designation" type="String" levelType="Regular"> - </Level> - </Hierarchy> - </Dimension> - <Dimension type="StandardDimension" visible="true" highCardinality="false" name="doj"> - <Hierarchy name="doj" hasAll="true" normalized="false"> - <Level name="doj" column="doj" type="Timestamp" levelType="Regular"> - </Level> - </Hierarchy> - </Dimension> - <Dimension type="StandardDimension" visible="true" highCardinality="false" - name="workgroupcategory"> - <Hierarchy name="workgroupcategory" hasAll="true" normalized="false"> - <Level name="workgroupcategory" column="workgroupcategory" type="Integer" - levelType="Regular"> - </Level> - </Hierarchy> - </Dimension> - <Dimension type="StandardDimension" visible="true" highCardinality="false" - name="workgroupcategoryname"> - <Hierarchy name="workgroupcategoryname" hasAll="true" normalized="false"> - <Level name="workgroupcategoryname" column="workgroupcategoryname" type="String" - levelType="Regular"> - </Level> - </Hierarchy> - </Dimension> - <Dimension type="StandardDimension" visible="true" highCardinality="false" name="deptno"> - <Hierarchy name="deptno" hasAll="true" normalized="false"> - <Level name="deptno" column="deptno" type="Integer" levelType="Regular"> - </Level> - </Hierarchy> - </Dimension> - <Dimension type="StandardDimension" visible="true" highCardinality="false" name="deptname"> - <Hierarchy name="deptname" hasAll="true" normalized="false"> - <Level name="deptname" column="deptname" type="String" levelType="Regular"> - </Level> - </Hierarchy> - </Dimension> - <Dimension type="StandardDimension" visible="true" highCardinality="false" - name="projectcode"> - <Hierarchy name="projectcode" hasAll="true" normalized="false"> - <Level name="projectcode" column="projectcode" type="Integer" levelType="Regular"> - </Level> - </Hierarchy> - </Dimension> - <Dimension type="StandardDimension" visible="true" highCardinality="false" - name="projectjoindate"> - <Hierarchy name="projectjoindate" hasAll="true" normalized="false"> - <Level name="projectjoindate" column="projectjoindate" type="Timestamp" - levelType="Regular"> - </Level> - </Hierarchy> - </Dimension> - <Dimension type="StandardDimension" visible="true" highCardinality="false" - name="projectenddate"> - <Hierarchy name="projectenddate" hasAll="true" normalized="false"> - <Level name="projectenddate" column="projectenddate" type="Timestamp" - levelType="Regular"> - </Level> - </Hierarchy> - </Dimension> - <Measure name="attendance" column="attendance" datatype="Integer" aggregator="sum" - visible="true"> - </Measure> - <Measure name="utilization" column="utilization" datatype="Integer" aggregator="sum" - visible="true"> - </Measure> - <Measure name="salary" column="salary" datatype="Integer" aggregator="sum" visible="true"> - </Measure> - </Cube> -</Schema> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/carbondata/blob/b23d357e/integration/spark-common-test/src/test/resources/integertypecube.xml ---------------------------------------------------------------------- diff --git a/integration/spark-common-test/src/test/resources/integertypecube.xml b/integration/spark-common-test/src/test/resources/integertypecube.xml deleted file mode 100644 index 3642411..0000000 --- a/integration/spark-common-test/src/test/resources/integertypecube.xml +++ /dev/null @@ -1,55 +0,0 @@ -<!-- - ~ Licensed to the Apache Software Foundation (ASF) under one - ~ or more contributor license agreements. See the NOTICE file - ~ distributed with this work for additional information - ~ regarding copyright ownership. The ASF licenses this file - ~ to you under the Apache License, Version 2.0 (the - ~ "License"); you may not use this file except in compliance - ~ with the License. You may obtain a copy of the License at - ~ - ~ http://www.apache.org/licenses/LICENSE-2.0 - ~ - ~ Unless required by applicable law or agreed to in writing, - ~ software distributed under the License is distributed on an - ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - ~ KIND, either express or implied. See the License for the - ~ specific language governing permissions and limitations - ~ under the License. - --> - -<Schema name="default"> - <Cube name="integertypecube" visible="true" cache="true" enabled="true"> - <Table name="integertypecube" alias=""> - </Table> - <Dimension type="StandardDimension" visible="true" highCardinality="false" name="empno"> - <Hierarchy name="empno" hasAll="true" normalized="false"> - <Level name="empno" column="empno" type="Integer" levelType="Regular"> - </Level> - </Hierarchy> - </Dimension> - <Dimension type="StandardDimension" visible="true" highCardinality="false" - name="workgroupcategory"> - <Hierarchy name="workgroupcategory" hasAll="true" normalized="false"> - <Level name="workgroupcategory" column="workgroupcategory" type="Integer" - levelType="Regular"> - </Level> - </Hierarchy> - </Dimension> - <Dimension type="StandardDimension" visible="true" highCardinality="false" name="deptno"> - <Hierarchy name="deptno" hasAll="true" normalized="false"> - <Level name="deptno" column="deptno" type="Integer" levelType="Regular"> - </Level> - </Hierarchy> - </Dimension> - <Dimension type="StandardDimension" visible="true" highCardinality="false" - name="projectcode"> - <Hierarchy name="projectcode" hasAll="true" normalized="false"> - <Level name="projectcode" column="projectcode" type="Integer" levelType="Regular"> - </Level> - </Hierarchy> - </Dimension> - <Measure name="attendance" column="attendance" datatype="Integer" aggregator="sum" - visible="true"> - </Measure> - </Cube> -</Schema> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/carbondata/blob/b23d357e/integration/spark-common-test/src/test/resources/numerictypecube.xml ---------------------------------------------------------------------- diff --git a/integration/spark-common-test/src/test/resources/numerictypecube.xml b/integration/spark-common-test/src/test/resources/numerictypecube.xml deleted file mode 100644 index 58b5644..0000000 --- a/integration/spark-common-test/src/test/resources/numerictypecube.xml +++ /dev/null @@ -1,41 +0,0 @@ -<!-- - ~ Licensed to the Apache Software Foundation (ASF) under one - ~ or more contributor license agreements. See the NOTICE file - ~ distributed with this work for additional information - ~ regarding copyright ownership. The ASF licenses this file - ~ to you under the Apache License, Version 2.0 (the - ~ "License"); you may not use this file except in compliance - ~ with the License. You may obtain a copy of the License at - ~ - ~ http://www.apache.org/licenses/LICENSE-2.0 - ~ - ~ Unless required by applicable law or agreed to in writing, - ~ software distributed under the License is distributed on an - ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - ~ KIND, either express or implied. See the License for the - ~ specific language governing permissions and limitations - ~ under the License. - --> - -<Schema name="default"> - <Cube name="numerictypecube" visible="true" cache="true" enabled="true"> - <Table name="numerictypecube" alias=""> - </Table> - <Dimension type="StandardDimension" visible="true" highCardinality="false" - name="utilization"> - <Hierarchy name="utilization" hasAll="true" normalized="false"> - <Level name="utilization" column="utilization" type="Numeric" levelType="Regular"> - </Level> - </Hierarchy> - </Dimension> - <Dimension type="StandardDimension" visible="true" highCardinality="false" name="salary"> - <Hierarchy name="salary" hasAll="true" normalized="false"> - <Level name="salary" column="salary" type="Numeric" levelType="Regular"> - </Level> - </Hierarchy> - </Dimension> - <Measure name="default_dummy_measure" column="default_dummy_measure" datatype="Numeric" - aggregator="sum" visible="false"> - </Measure> - </Cube> -</Schema> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/carbondata/blob/b23d357e/integration/spark-common-test/src/test/resources/stringtypecube.xml ---------------------------------------------------------------------- diff --git a/integration/spark-common-test/src/test/resources/stringtypecube.xml b/integration/spark-common-test/src/test/resources/stringtypecube.xml deleted file mode 100644 index dff7ccc..0000000 --- a/integration/spark-common-test/src/test/resources/stringtypecube.xml +++ /dev/null @@ -1,55 +0,0 @@ -<!-- - ~ Licensed to the Apache Software Foundation (ASF) under one - ~ or more contributor license agreements. See the NOTICE file - ~ distributed with this work for additional information - ~ regarding copyright ownership. The ASF licenses this file - ~ to you under the Apache License, Version 2.0 (the - ~ "License"); you may not use this file except in compliance - ~ with the License. You may obtain a copy of the License at - ~ - ~ http://www.apache.org/licenses/LICENSE-2.0 - ~ - ~ Unless required by applicable law or agreed to in writing, - ~ software distributed under the License is distributed on an - ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - ~ KIND, either express or implied. See the License for the - ~ specific language governing permissions and limitations - ~ under the License. - --> - -<Schema name="default"> - <Cube name="stringtypecube" visible="true" cache="true" enabled="true"> - <Table name="stringtypecube" alias=""> - </Table> - <Dimension type="StandardDimension" visible="true" highCardinality="false" name="empname"> - <Hierarchy name="empname" hasAll="true" normalized="false"> - <Level name="empname" column="empname" type="String" levelType="Regular"> - </Level> - </Hierarchy> - </Dimension> - <Dimension type="StandardDimension" visible="true" highCardinality="false" - name="designation"> - <Hierarchy name="designation" hasAll="true" normalized="false"> - <Level name="designation" column="designation" type="String" levelType="Regular"> - </Level> - </Hierarchy> - </Dimension> - <Dimension type="StandardDimension" visible="true" highCardinality="false" - name="workgroupcategoryname"> - <Hierarchy name="workgroupcategoryname" hasAll="true" normalized="false"> - <Level name="workgroupcategoryname" column="workgroupcategoryname" type="String" - levelType="Regular"> - </Level> - </Hierarchy> - </Dimension> - <Dimension type="StandardDimension" visible="true" highCardinality="false" name="deptname"> - <Hierarchy name="deptname" hasAll="true" normalized="false"> - <Level name="deptname" column="deptname" type="String" levelType="Regular"> - </Level> - </Hierarchy> - </Dimension> - <Measure name="default_dummy_measure" column="default_dummy_measure" datatype="Numeric" - aggregator="sum" visible="false"> - </Measure> - </Cube> -</Schema> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/carbondata/blob/b23d357e/integration/spark-common-test/src/test/resources/timestamptypecube.xml ---------------------------------------------------------------------- diff --git a/integration/spark-common-test/src/test/resources/timestamptypecube.xml b/integration/spark-common-test/src/test/resources/timestamptypecube.xml deleted file mode 100644 index 885eb44..0000000 --- a/integration/spark-common-test/src/test/resources/timestamptypecube.xml +++ /dev/null @@ -1,50 +0,0 @@ -<!-- - ~ Licensed to the Apache Software Foundation (ASF) under one - ~ or more contributor license agreements. See the NOTICE file - ~ distributed with this work for additional information - ~ regarding copyright ownership. The ASF licenses this file - ~ to you under the Apache License, Version 2.0 (the - ~ "License"); you may not use this file except in compliance - ~ with the License. You may obtain a copy of the License at - ~ - ~ http://www.apache.org/licenses/LICENSE-2.0 - ~ - ~ Unless required by applicable law or agreed to in writing, - ~ software distributed under the License is distributed on an - ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - ~ KIND, either express or implied. See the License for the - ~ specific language governing permissions and limitations - ~ under the License. - --> - -<Schema name="default"> - <Cube name="timestamptypecube" visible="true" cache="true" enabled="true"> - <Table name="timestamptypecube" alias=""> - </Table> - <Dimension type="StandardDimension" visible="true" highCardinality="false" name="doj"> - <Hierarchy name="doj" hasAll="true" normalized="false"> - <Level name="doj" column="doj" type="Timestamp" levelType="Regular"> - </Level> - </Hierarchy> - </Dimension> - <Dimension type="StandardDimension" visible="true" highCardinality="false" - name="projectjoindate"> - <Hierarchy name="projectjoindate" hasAll="true" normalized="false"> - <Level name="projectjoindate" column="projectjoindate" type="Timestamp" - levelType="Regular"> - </Level> - </Hierarchy> - </Dimension> - <Dimension type="StandardDimension" visible="true" highCardinality="false" - name="projectenddate"> - <Hierarchy name="projectenddate" hasAll="true" normalized="false"> - <Level name="projectenddate" column="projectenddate" type="Timestamp" - levelType="Regular"> - </Level> - </Hierarchy> - </Dimension> - <Measure name="default_dummy_measure" column="default_dummy_measure" datatype="Numeric" - aggregator="sum" visible="false"> - </Measure> - </Cube> -</Schema> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/carbondata/blob/b23d357e/integration/spark-common-test/src/test/scala/org/apache/carbondata/spark/testsuite/aggquery/AllDataTypesTestCaseAggregate.scala ---------------------------------------------------------------------- diff --git a/integration/spark-common-test/src/test/scala/org/apache/carbondata/spark/testsuite/aggquery/AllDataTypesTestCaseAggregate.scala b/integration/spark-common-test/src/test/scala/org/apache/carbondata/spark/testsuite/aggquery/AllDataTypesTestCaseAggregate.scala index 70698fe..0f18d63 100644 --- a/integration/spark-common-test/src/test/scala/org/apache/carbondata/spark/testsuite/aggquery/AllDataTypesTestCaseAggregate.scala +++ b/integration/spark-common-test/src/test/scala/org/apache/carbondata/spark/testsuite/aggquery/AllDataTypesTestCaseAggregate.scala @@ -32,7 +32,6 @@ class AllDataTypesTestCaseAggregate extends QueryTest with BeforeAndAfterAll { CarbonProperties.getInstance() .addProperty(CarbonCommonConstants.CARBON_TIMESTAMP_FORMAT, "dd-MM-yyyy") sql("DROP TABLE IF EXISTS alldatatypestableAGG") - sql("DROP TABLE IF EXISTS alldatatypescubeAGG_hive") sql( "CREATE TABLE alldatatypestableAGG (empno int, empname String, designation String, doj " + "Timestamp, workgroupcategory int, workgroupcategoryname String, deptno int, deptname " + @@ -41,14 +40,14 @@ class AllDataTypesTestCaseAggregate extends QueryTest with BeforeAndAfterAll { sql( s"LOAD DATA LOCAL INPATH '$resourcesPath/data.csv' INTO TABLE alldatatypestableAGG " + "OPTIONS('DELIMITER'= ',', 'QUOTECHAR'= '\"')") - sql("DROP TABLE IF EXISTS alldatatypescubeAGG_hive") + sql("DROP TABLE IF EXISTS alldatatypesAGG_hive") sql( - "CREATE TABLE alldatatypescubeAGG_hive (empno int, empname String, designation String, doj " + + "CREATE TABLE alldatatypesAGG_hive (empno int, empname String, designation String, doj " + "Timestamp, workgroupcategory int, workgroupcategoryname String, deptno int, deptname " + "String, projectcode int, projectjoindate Timestamp, projectenddate Timestamp,attendance " + "int,utilization int,salary int)row format delimited fields terminated by ','") sql( - s"LOAD DATA LOCAL INPATH '$resourcesPath/datawithoutheader.csv' INTO TABLE alldatatypescubeAGG_hive") + s"LOAD DATA LOCAL INPATH '$resourcesPath/datawithoutheader.csv' INTO TABLE alldatatypesAGG_hive") } test( @@ -60,7 +59,7 @@ class AllDataTypesTestCaseAggregate extends QueryTest with BeforeAndAfterAll { "select empno,empname,utilization,count(salary),sum(empno) from alldatatypestableAGG where" + " empname in ('arvind','ayushi') group by empno,empname,utilization"), sql( - "select empno,empname,utilization,count(salary),sum(empno) from alldatatypescubeAGG_hive where" + + "select empno,empname,utilization,count(salary),sum(empno) from alldatatypesAGG_hive where" + " empname in ('arvind','ayushi') group by empno,empname,utilization")) } @@ -73,7 +72,7 @@ class AllDataTypesTestCaseAggregate extends QueryTest with BeforeAndAfterAll { "select empname,trim(designation),avg(salary),avg(empno) from alldatatypestableAGG where " + "empname in ('arvind','ayushi') group by empname,trim(designation)"), sql( - "select empname,trim(designation),avg(salary),avg(empno) from alldatatypescubeAGG_hive where " + + "select empname,trim(designation),avg(salary),avg(empno) from alldatatypesAGG_hive where " + "empname in ('arvind','ayushi') group by empname,trim(designation)")) } @@ -89,7 +88,7 @@ class AllDataTypesTestCaseAggregate extends QueryTest with BeforeAndAfterAll { "(designation) order by empname"), sql( "select empname,length(designation),max(empno),min(empno), avg(empno) from " + - "alldatatypescubeAGG_hive where empname in ('arvind','ayushi') group by empname,length" + + "alldatatypesAGG_hive where empname in ('arvind','ayushi') group by empname,length" + "(designation) order by empname")) } @@ -97,12 +96,11 @@ class AllDataTypesTestCaseAggregate extends QueryTest with BeforeAndAfterAll { { checkAnswer( sql("select count(empno), count(distinct(empno)) from alldatatypestableAGG"), - sql("select count(empno), count(distinct(empno)) from alldatatypescubeAGG_hive")) + sql("select count(empno), count(distinct(empno)) from alldatatypesAGG_hive")) } override def afterAll { sql("DROP TABLE IF EXISTS alldatatypestableAGG") - sql("DROP TABLE IF EXISTS alldatatypescubeAGG") - sql("DROP TABLE IF EXISTS alldatatypescubeAGG_hive") + sql("DROP TABLE IF EXISTS alldatatypesAGG_hive") } } \ No newline at end of file
