Repository: incubator-carbondata
Updated Branches:
refs/heads/master 1d8ad7dfa -> 87f745c60
http://git-wip-us.apache.org/repos/asf/incubator-carbondata/blob/92f7637c/integration-testcases/src/test/scala/org/apache/spark/testsuite/allqueries/AllDataTypesTestCase2.scala
----------------------------------------------------------------------
diff --git a/integration-testcases/src/test/scala/org/apache/spark/testsuite/allqueries/AllDataTypesTestCase2.scala b/integration-testcases/src/test/scala/org/apache/spark/testsuite/allqueries/AllDataTypesTestCase2.scala
index 86b88a7..6011647 100644
--- a/integration-testcases/src/test/scala/org/apache/spark/testsuite/allqueries/AllDataTypesTestCase2.scala
+++ b/integration-testcases/src/test/scala/org/apache/spark/testsuite/allqueries/AllDataTypesTestCase2.scala
@@ -21,15 +21,12 @@ package org.apache.carbondata.spark.testsuite.allqueries
import java.io.File
-import org.apache.spark.sql.Row
+import org.apache.carbondata.core.constants.CarbonCommonConstants
+import org.apache.carbondata.core.util.CarbonProperties
import org.apache.spark.sql.common.util.CarbonHiveContext._
import org.apache.spark.sql.common.util.QueryTest
-
-import org.apache.carbondata.core.util.CarbonProperties
import org.scalatest.BeforeAndAfterAll
-import org.apache.carbondata.core.constants.CarbonCommonConstants
-
/**
* Test Class for all queries on multiple datatypes
* Manohar
@@ -40,110 +37,113 @@ class AllDataTypesTestCase2 extends QueryTest with BeforeAndAfterAll {
val currentDirectory = new File(this.getClass.getResource("/").getPath + "/../../")
.getCanonicalPath
+
try {
sql(
"create table Carbon_automation_test2 (imei string,deviceInformationId int,MAC string," +
- "deviceColor string,device_backColor string,modelId string,marketName string,AMSize " +
- "string,ROMSize string,CUPAudit string,CPIClocked string,series string,productionDate " +
- "string,bomCode string,internalModels string, deliveryTime string, channelsId string, " +
- "channelsName string , deliveryAreaId string, deliveryCountry string, deliveryProvince " +
- "string, deliveryCity string,deliveryDistrict string, deliveryStreet string, " +
- "oxSingleNumber string, ActiveCheckTime string, ActiveAreaId string, ActiveCountry " +
- "string, ActiveProvince string, Activecity string, ActiveDistrict string, ActiveStreet " +
- "string, ActiveOperatorId string, Active_releaseId string, Active_EMUIVersion string, " +
- "Active_operaSysVersion string, Active_BacVerNumber string, Active_BacFlashVer string, " +
- "Active_webUIVersion string, Active_webUITypeCarrVer string,Active_webTypeDataVerNumber " +
- "string, Active_operatorsVersion string, Active_phonePADPartitionedVersions string, " +
- "Latest_YEAR int, Latest_MONTH int, Latest_DAY int, Latest_HOUR string, Latest_areaId " +
- "string, Latest_country string, Latest_province string, Latest_city string, " +
- "Latest_district string, Latest_street string, Latest_releaseId string, " +
- "Latest_EMUIVersion string, Latest_operaSysVersion string, Latest_BacVerNumber string, " +
- "Latest_BacFlashVer string, Latest_webUIVersion string, Latest_webUITypeCarrVer string, " +
- "Latest_webTypeDataVerNumber string, Latest_operatorsVersion string, " +
- "Latest_phonePADPartitionedVersions string, Latest_operatorId string, " +
- "gamePointDescription string, gamePointId int,contractNumber int) stored by 'org.apache" +
- ".carbondata.format' TBLPROPERTIES('DICTIONARY_INCLUDE'='Latest_DAY,deviceInformationId')")
+ "deviceColor string,device_backColor string,modelId string,marketName string,AMSize " +
+ "string,ROMSize string,CUPAudit string,CPIClocked string,series string,productionDate " +
+ "string,bomCode string,internalModels string, deliveryTime string, channelsId string, " +
+ "channelsName string , deliveryAreaId string, deliveryCountry string, deliveryProvince " +
+ "string, deliveryCity string,deliveryDistrict string, deliveryStreet string, " +
+ "oxSingleNumber string, ActiveCheckTime string, ActiveAreaId string, ActiveCountry " +
+ "string, ActiveProvince string, Activecity string, ActiveDistrict string, ActiveStreet " +
+ "string, ActiveOperatorId string, Active_releaseId string, Active_EMUIVersion string, " +
+ "Active_operaSysVersion string, Active_BacVerNumber string, Active_BacFlashVer string, " +
+ "Active_webUIVersion string, Active_webUITypeCarrVer string,Active_webTypeDataVerNumber " +
+ "string, Active_operatorsVersion string, Active_phonePADPartitionedVersions string, " +
+ "Latest_YEAR int, Latest_MONTH int, Latest_DAY int, Latest_HOUR string, Latest_areaId " +
+ "string, Latest_country string, Latest_province string, Latest_city string, " +
+ "Latest_district string, Latest_street string, Latest_releaseId string, " +
+ "Latest_EMUIVersion string, Latest_operaSysVersion string, Latest_BacVerNumber string, " +
+ "Latest_BacFlashVer string, Latest_webUIVersion string, Latest_webUITypeCarrVer string, " +
+ "Latest_webTypeDataVerNumber string, Latest_operatorsVersion string, " +
+ "Latest_phonePADPartitionedVersions string, Latest_operatorId string, " +
+ "gamePointDescription string, gamePointId int,contractNumber int) stored by 'org.apache" +
+ ".carbondata.format' TBLPROPERTIES('DICTIONARY_INCLUDE'='Latest_webTypeDataVerNumber')")
+
CarbonProperties.getInstance()
.addProperty(CarbonCommonConstants.CARBON_TIMESTAMP_FORMAT,
CarbonCommonConstants.CARBON_TIMESTAMP_DEFAULT_FORMAT
)
+
sql("LOAD DATA LOCAL INPATH '" + currentDirectory +
- "/src/test/resources/100_olap.csv' INTO table Carbon_automation_test2 OPTIONS" +
- "('DELIMITER'= ',' ,'QUOTECHAR'= '\"', 'FILEHEADER'= 'imei,deviceInformationId,MAC," +
- "deviceColor,device_backColor,modelId,marketName,AMSize,ROMSize,CUPAudit,CPIClocked," +
- "series,productionDate,bomCode,internalModels,deliveryTime,channelsId,channelsName," +
- "deliveryAreaId,deliveryCountry,deliveryProvince,deliveryCity,deliveryDistrict," +
- "deliveryStreet,oxSingleNumber,contractNumber,ActiveCheckTime,ActiveAreaId," +
- "ActiveCountry,ActiveProvince,Activecity,ActiveDistrict,ActiveStreet,ActiveOperatorId," +
- "Active_releaseId,Active_EMUIVersion,Active_operaSysVersion,Active_BacVerNumber," +
- "Active_BacFlashVer,Active_webUIVersion,Active_webUITypeCarrVer," +
- "Active_webTypeDataVerNumber,Active_operatorsVersion," +
- "Active_phonePADPartitionedVersions,Latest_YEAR,Latest_MONTH,Latest_DAY,Latest_HOUR," +
- "Latest_areaId,Latest_country,Latest_province,Latest_city,Latest_district," +
- "Latest_street,Latest_releaseId,Latest_EMUIVersion,Latest_operaSysVersion," +
- "Latest_BacVerNumber,Latest_BacFlashVer,Latest_webUIVersion,Latest_webUITypeCarrVer," +
- "Latest_webTypeDataVerNumber,Latest_operatorsVersion," +
- "Latest_phonePADPartitionedVersions,Latest_operatorId,gamePointId,gamePointDescription')")
+ "/src/test/resources/100_olap.csv' INTO table Carbon_automation_test2 OPTIONS" +
+ "('DELIMITER'= ',' ,'QUOTECHAR'= '\"', 'FILEHEADER'= 'imei,deviceInformationId,MAC," +
+ "deviceColor,device_backColor,modelId,marketName,AMSize,ROMSize,CUPAudit,CPIClocked," +
+ "series,productionDate,bomCode,internalModels,deliveryTime,channelsId,channelsName," +
+ "deliveryAreaId,deliveryCountry,deliveryProvince,deliveryCity,deliveryDistrict," +
+ "deliveryStreet,oxSingleNumber,contractNumber,ActiveCheckTime,ActiveAreaId," +
+ "ActiveCountry,ActiveProvince,Activecity,ActiveDistrict,ActiveStreet,ActiveOperatorId," +
+ "Active_releaseId,Active_EMUIVersion,Active_operaSysVersion,Active_BacVerNumber," +
+ "Active_BacFlashVer,Active_webUIVersion,Active_webUITypeCarrVer," +
+ "Active_webTypeDataVerNumber,Active_operatorsVersion," +
+ "Active_phonePADPartitionedVersions,Latest_YEAR,Latest_MONTH,Latest_DAY,Latest_HOUR," +
+ "Latest_areaId,Latest_country,Latest_province,Latest_city,Latest_district," +
+ "Latest_street,Latest_releaseId,Latest_EMUIVersion,Latest_operaSysVersion," +
+ "Latest_BacVerNumber,Latest_BacFlashVer,Latest_webUIVersion,Latest_webUITypeCarrVer," +
+ "Latest_webTypeDataVerNumber,Latest_operatorsVersion," +
+ "Latest_phonePADPartitionedVersions,Latest_operatorId,gamePointId,gamePointDescription')")
sql(
"create table Carbon_automation_hive (imei string,deviceInformationId int,MAC string," +
- "deviceColor string,device_backColor string,modelId string,marketName string,AMSize " +
- "string,ROMSize string,CUPAudit string,CPIClocked string,series string,productionDate " +
- "string,bomCode string,internalModels string, deliveryTime string, channelsId string, " +
- "channelsName string , deliveryAreaId string, deliveryCountry string, deliveryProvince " +
- "string, deliveryCity string,deliveryDistrict string, deliveryStreet string, " +
- "oxSingleNumber string, ActiveCheckTime string, ActiveAreaId string, ActiveCountry " +
- "string, ActiveProvince string, Activecity string, ActiveDistrict string, ActiveStreet " +
- "string, ActiveOperatorId string, Active_releaseId string, Active_EMUIVersion string, " +
- "Active_operaSysVersion string, Active_BacVerNumber string, Active_BacFlashVer string, " +
- "Active_webUIVersion string, Active_webUITypeCarrVer string,Active_webTypeDataVerNumber " +
- "string, Active_operatorsVersion string, Active_phonePADPartitionedVersions string, " +
- "Latest_YEAR int, Latest_MONTH int, Latest_DAY int, Latest_HOUR string, Latest_areaId " +
- "string, Latest_country string, Latest_province string, Latest_city string, " +
- "Latest_district string, Latest_street string, Latest_releaseId string, " +
- "Latest_EMUIVersion string, Latest_operaSysVersion string, Latest_BacVerNumber string, " +
- "Latest_BacFlashVer string, Latest_webUIVersion string, Latest_webUITypeCarrVer string, " +
- "Latest_webTypeDataVerNumber string, Latest_operatorsVersion string, " +
- "Latest_phonePADPartitionedVersions string, Latest_operatorId string, " +
- "gamePointDescription string, gamePointId int,contractNumber int)" +
- " row format delimited fields terminated by ','"
+ "deviceColor string,device_backColor string,modelId string,marketName string,AMSize " +
+ "string,ROMSize string,CUPAudit string,CPIClocked string,series string,productionDate " +
+ "string,bomCode string,internalModels string, deliveryTime string, channelsId string, " +
+ "channelsName string , deliveryAreaId string, deliveryCountry string, deliveryProvince " +
+ "string, deliveryCity string,deliveryDistrict string, deliveryStreet string, " +
+ "oxSingleNumber string, ActiveCheckTime string, ActiveAreaId string, ActiveCountry " +
+ "string, ActiveProvince string, Activecity string, ActiveDistrict string, ActiveStreet " +
+ "string, ActiveOperatorId string, Active_releaseId string, Active_EMUIVersion string, " +
+ "Active_operaSysVersion string, Active_BacVerNumber string, Active_BacFlashVer string, " +
+ "Active_webUIVersion string, Active_webUITypeCarrVer string,Active_webTypeDataVerNumber " +
+ "string, Active_operatorsVersion string, Active_phonePADPartitionedVersions string, " +
+ "Latest_YEAR int, Latest_MONTH int, Latest_DAY int, Latest_HOUR string, Latest_areaId " +
+ "string, Latest_country string, Latest_province string, Latest_city string, " +
+ "Latest_district string, Latest_street string, Latest_releaseId string, " +
+ "Latest_EMUIVersion string, Latest_operaSysVersion string, Latest_BacVerNumber string, " +
+ "Latest_BacFlashVer string, Latest_webUIVersion string, Latest_webUITypeCarrVer string, " +
+ "Latest_webTypeDataVerNumber string, Latest_operatorsVersion string, " +
+ "Latest_phonePADPartitionedVersions string, Latest_operatorId string, " +
+ "gamePointDescription string, gamePointId int,contractNumber int)" +
+ " row format delimited fields terminated by ','"
)
sql("LOAD DATA LOCAL INPATH '" + currentDirectory + "/src/test/resources/100_olap.csv' INTO " +
- "table Carbon_automation_hive ")
+ "table Carbon_automation_hive ")
sql(
"create table if not exists Carbon_automation_hive2(imei string,deviceInformationId int," +
- "MAC string,deviceColor string,device_backColor string,modelId string,marketName " +
- "string,AMSize string,ROMSize string,CUPAudit string,CPIClocked string,series string," +
- "productionDate timestamp,bomCode string,internalModels string, deliveryTime string, " +
- "channelsId string, channelsName string , deliveryAreaId string, deliveryCountry " +
- "string, deliveryProvince string, deliveryCity string,deliveryDistrict string, " +
- "deliveryStreet string, oxSingleNumber string,contractNumber int, ActiveCheckTime string, ActiveAreaId " +
- "string, ActiveCountry string, ActiveProvince string, Activecity string, ActiveDistrict" +
- " string, ActiveStreet string, ActiveOperatorId string, Active_releaseId string, " +
- "Active_EMUIVersion string, Active_operaSysVersion string, Active_BacVerNumber string, " +
- "Active_BacFlashVer string, Active_webUIVersion string, Active_webUITypeCarrVer string," +
- "Active_webTypeDataVerNumber string, Active_operatorsVersion string, " +
- "Active_phonePADPartitionedVersions string, Latest_YEAR int, Latest_MONTH int, " +
- "Latest_DAY int, Latest_HOUR string, Latest_areaId string, Latest_country string, " +
- "Latest_province string, Latest_city string, Latest_district string, Latest_street " +
- "string, Latest_releaseId string, Latest_EMUIVersion string, Latest_operaSysVersion " +
- "string, Latest_BacVerNumber string, Latest_BacFlashVer string, Latest_webUIVersion " +
- "string, Latest_webUITypeCarrVer string, Latest_webTypeDataVerNumber string, " +
- "Latest_operatorsVersion string, Latest_phonePADPartitionedVersions string, " +
- "Latest_operatorId string, gamePointId int,gamePointDescription string" +
- ") row format delimited fields terminated by ','"
+ "MAC string,deviceColor string,device_backColor string,modelId string,marketName " +
+ "string,AMSize string,ROMSize string,CUPAudit string,CPIClocked string,series string," +
+ "productionDate timestamp,bomCode string,internalModels string, deliveryTime string, " +
+ "channelsId string, channelsName string , deliveryAreaId string, deliveryCountry " +
+ "string, deliveryProvince string, deliveryCity string,deliveryDistrict string, " +
+ "deliveryStreet string, oxSingleNumber string,contractNumber int, ActiveCheckTime string, ActiveAreaId " +
+ "string, ActiveCountry string, ActiveProvince string, Activecity string, ActiveDistrict" +
+ " string, ActiveStreet string, ActiveOperatorId string, Active_releaseId string, " +
+ "Active_EMUIVersion string, Active_operaSysVersion string, Active_BacVerNumber string, " +
+ "Active_BacFlashVer string, Active_webUIVersion string, Active_webUITypeCarrVer string," +
+ "Active_webTypeDataVerNumber string, Active_operatorsVersion string, " +
+ "Active_phonePADPartitionedVersions string, Latest_YEAR int, Latest_MONTH int, " +
+ "Latest_DAY int, Latest_HOUR string, Latest_areaId string, Latest_country string, " +
+ "Latest_province string, Latest_city string, Latest_district string, Latest_street " +
+ "string, Latest_releaseId string, Latest_EMUIVersion string, Latest_operaSysVersion " +
+ "string, Latest_BacVerNumber string, Latest_BacFlashVer string, Latest_webUIVersion " +
+ "string, Latest_webUITypeCarrVer string, Latest_webTypeDataVerNumber string, " +
+ "Latest_operatorsVersion string, Latest_phonePADPartitionedVersions string, " +
+ "Latest_operatorId string, gamePointId int,gamePointDescription string" +
+ ") row format delimited fields terminated by ','"
)
sql("LOAD DATA LOCAL INPATH '" + currentDirectory + "/src/test/resources/100_olap.csv' INTO " +
- "table Carbon_automation_hive2 ")
+ "table Carbon_automation_hive2 ")
} catch {
case e: Exception => print("ERROR : " + e.getMessage)
}
}
override def afterAll {
- //CarbonProperties.getInstance().addProperty(CarbonCommonConstants.CARBON_TIMESTAMP_FORMAT, "dd-MM-yyyy")
+ CarbonProperties.getInstance().addProperty(CarbonCommonConstants.CARBON_TIMESTAMP_FORMAT, "dd-MM-yyyy")
try {
sql("drop table Carbon_automation_test2")
sql("drop table Carbon_automation_hive")
@@ -153,33 +153,24 @@ class AllDataTypesTestCase2 extends QueryTest with BeforeAndAfterAll {
}
}
+
//Test-23
test(
"select channelsId, sum(gamePointId+ 10) Total from Carbon_automation_test2 group by " +
"channelsId order by Total"
) {
+
checkAnswer(
sql(
"select channelsId, sum(gamePointId+ 10) Total from Carbon_automation_test2 group by " +
"channelsId order by Total"
),
- Seq(Row("2", 18659),
- Row("7", 20484),
- Row("1", 20934),
- Row("4", 20991.197),
- Row("5", 23024),
- Row("3", 25241),
- Row("6", 28542)
- )
+ sql("select channelsId, sum(gamePointId+ 10) Total from Carbon_automation_hive2 group by " +
+ "channelsId order by Total")
)
}
-
-
-
-
-
//Test-28
test(
"select channelsId, avg(gamePointId+ 10) Total from Carbon_automation_test2 group by " +
@@ -189,20 +180,14 @@ class AllDataTypesTestCase2 extends QueryTest with BeforeAndAfterAll {
sql(
"select channelsId, avg(gamePointId+ 10) Total from Carbon_automation_test2 group by " +
"channelsId order by Total"
- ),
- Seq(Row("7", 1138),
- Row("6", 1502.2105263157894),
- Row("3", 1577.5625),
- Row("1", 1744.5),
- Row("4", 1749.2664166666666),
- Row("2", 1865.9),
- Row("5", 1918.66666666666667)
- )
+ ), sql(
+ "select channelsId, avg(gamePointId+ 10) Total from Carbon_automation_hive2 group by " +
+ "channelsId order by Total")
+
)
}
-
//Test-32
test(
"select channelsId, count(gamePointId+ 10) Total from Carbon_automation_test2 group by " +
@@ -212,15 +197,11 @@ class AllDataTypesTestCase2 extends QueryTest with BeforeAndAfterAll {
sql(
"select channelsId, count(gamePointId+ 10) Total from Carbon_automation_test2 group by " +
"channelsId order by Total"
- ),
- Seq(Row("2", 10),
- Row("1", 12),
- Row("4", 12),
- Row("5", 12),
- Row("3", 16),
- Row("7", 18),
- Row("6", 19)
+ ), sql(
+ "select channelsId, count(gamePointId+ 10) Total from Carbon_automation_hive2 group by " +
+ "channelsId order by Total"
)
+
)
}
@@ -235,21 +216,15 @@ class AllDataTypesTestCase2 extends QueryTest with BeforeAndAfterAll {
sql(
"select channelsId, min(gamePointId+ 10) Total from Carbon_automation_test2 group by " +
"channelsId order by Total"
- ),
- Seq(Row("1", 39),
- Row("6", 89),
- Row("3", 161),
- Row("7", 266),
- Row("5", 308),
- Row("4", 451),
- Row("2", 578)
+ ), sql(
+ "select channelsId, min(gamePointId+ 10) Total from Carbon_automation_test2 group by " +
+ "channelsId order by Total"
)
+
)
}
-
-
//Test-40
test(
"select channelsId, max(gamePointId+ 10) Total from Carbon_automation_test2 group by " +
@@ -259,15 +234,11 @@ class AllDataTypesTestCase2 extends QueryTest with BeforeAndAfterAll {
sql(
"select channelsId, max(gamePointId+ 10) Total from Carbon_automation_test2 group by " +
"channelsId order by Total"
- ),
- Seq(Row("3", 2249),
- Row("7", 2358),
- Row("4", 2836),
- Row("1", 2873),
- Row("6", 2962),
- Row("2", 2980),
- Row("5", 2982)
+ ), sql(
+ "select channelsId, max(gamePointId+ 10) Total from Carbon_automation_hive2 group by " +
+ "channelsId order by Total"
)
+
)
}
@@ -282,49 +253,9 @@ class AllDataTypesTestCase2 extends QueryTest with BeforeAndAfterAll {
sql(
"select Latest_YEAR ,count(distinct Latest_YEAR) from Carbon_automation_test2 group by " +
"Latest_YEAR"
- ),
- Seq(Row(2015, 1))
- )
- }
- )
- //TC_053
- test("select avg(gamepointid) +10 as a ,series from Carbon_automation_test2 group by series")({
- checkAnswer(
- sql("select avg(gamepointid) +10 as a ,series from Carbon_automation_test2 group by series"),
- Seq(Row(1445.7777777777778, "6Series"),
- Row(1735.3333333333333, "0Series"),
- Row(1553.0, "4Series"),
- Row(1243.3636363636363, "8Series"),
- Row(1700.1088181818182, "7Series"),
- Row(1343.6666666666667, "1Series"),
- Row(1720.0588235294117, "5Series"),
- Row(1625.0, "9Series"),
- Row(1914.375, "3Series"),
- Row(1382.6666666666667, "2Series")
- )
- )
- }
- )
-
- //TC_059
- test(
- "select count(distinct gamepointid)+10 as a,series from Carbon_automation_test2 group by series"
- )({
- checkAnswer(
- sql(
- "select count(distinct gamepointid)+10 as a,series from Carbon_automation_test2 group by " +
- "series"
- ),
- Seq(Row(19, "6Series"),
- Row(25, "0Series"),
- Row(18, "4Series"),
- Row(21, "8Series"),
- Row(21, "7Series"),
- Row(13, "1Series"),
- Row(26, "5Series"),
- Row(18, "9Series"),
- Row(18, "3Series"),
- Row(19, "2Series")
+ ), sql(
+ "select Latest_YEAR ,count(distinct Latest_YEAR) from Carbon_automation_hive2 group by " +
+ "Latest_YEAR"
)
)
}
@@ -333,8 +264,9 @@ class AllDataTypesTestCase2 extends QueryTest with BeforeAndAfterAll {
//TC_068
test("select count (if(gamePointId>100,NULL,gamePointId)) a from Carbon_automation_test2")({
checkAnswer(
- sql("select count (if(gamePointId>100,NULL,gamePointId)) a from Carbon_automation_test2"),
- Seq(Row(2))
+ sql("select count (if(gamePointId>100,NULL,gamePointId)) a from Carbon_automation_hive2"),
+ sql("select count (if(gamePointId>100,NULL,gamePointId)) a from " +
+ "Carbon_automation_test2")
)
}
)
@@ -343,7 +275,8 @@ class AllDataTypesTestCase2 extends QueryTest with BeforeAndAfterAll {
test("select count(DISTINCT gamePointId) as a from Carbon_automation_test2")({
checkAnswer(
sql("select count(DISTINCT gamePointId) as a from Carbon_automation_test2"),
- Seq(Row(97))
+ sql("select count(DISTINCT gamePointId) as a from Carbon_automation_hive2")
+
)
}
)
@@ -352,7 +285,7 @@ class AllDataTypesTestCase2 extends QueryTest with BeforeAndAfterAll {
test("select sum( DISTINCT gamePointId) a from Carbon_automation_test2")({
checkAnswer(
sql("select sum( DISTINCT gamePointId) a from Carbon_automation_test2"),
- Seq(Row(153284.19700000001))
+ sql("select sum( DISTINCT gamePointId) a from Carbon_automation_hive2")
)
}
)
@@ -360,8 +293,8 @@ class AllDataTypesTestCase2 extends QueryTest with BeforeAndAfterAll {
//TC_079
test("select sum (if(gamePointId>100,NULL,gamePointId)) a from Carbon_automation_test2")({
checkAnswer(
- sql("select sum (if(gamePointId>100,NULL,gamePointId)) a from Carbon_automation_test2"),
- Seq(Row(108.0))
+ sql("select sum (if(gamePointId>100,NULL,gamePointId)) a from Carbon_automation_hive2"),
+ sql("select sum (if(gamePointId>100,NULL,gamePointId)) a from Carbon_automation_test2")
)
}
)
@@ -370,7 +303,7 @@ class AllDataTypesTestCase2 extends QueryTest with BeforeAndAfterAll {
test("select avg(gamePointId) a from Carbon_automation_test2")({
checkAnswer(
sql("select avg(gamePointId) a from Carbon_automation_test2"),
- Seq(Row(1584.6989595959594))
+ sql("select avg(gamePointId) a from Carbon_automation_hive2")
)
}
)
@@ -379,7 +312,8 @@ class AllDataTypesTestCase2 extends QueryTest with BeforeAndAfterAll {
test("select avg (if(gamePointId>100,NULL,gamePointId)) a from Carbon_automation_test2")({
checkAnswer(
sql("select avg (if(gamePointId>100,NULL,gamePointId)) a from Carbon_automation_test2"),
- Seq(Row(54.0))
+ sql("select avg (if(gamePointId>100,NULL,gamePointId)) a from Carbon_automation_hive2")
+
)
}
)
@@ -389,7 +323,7 @@ class AllDataTypesTestCase2 extends QueryTest with BeforeAndAfterAll {
test("select min(gamePointId) a from Carbon_automation_test2")({
checkAnswer(
sql("select min(gamePointId) a from Carbon_automation_test2"),
- Seq(Row(29.0))
+ sql("select min(gamePointId) a from Carbon_automation_hive2")
)
}
)
@@ -399,7 +333,7 @@ class AllDataTypesTestCase2 extends QueryTest with BeforeAndAfterAll {
test("select min (if(gamePointId>100,NULL,gamePointId)) a from Carbon_automation_test2")({
checkAnswer(
sql("select min (if(gamePointId>100,NULL,gamePointId)) a from Carbon_automation_test2"),
- Seq(Row(29.0))
+ sql("select min (if(gamePointId>100,NULL,gamePointId)) a from Carbon_automation_hive2")
)
}
)
@@ -408,7 +342,7 @@ class AllDataTypesTestCase2 extends QueryTest with BeforeAndAfterAll {
test("select max(gamePointId) a from Carbon_automation_test2")({
checkAnswer(
sql("select max(gamePointId) a from Carbon_automation_test2"),
- Seq(Row(2972.0))
+ sql("select max(gamePointId) a from Carbon_automation_hive2")
)
}
)
@@ -417,7 +351,7 @@ class AllDataTypesTestCase2 extends QueryTest with BeforeAndAfterAll {
test("select max (if(gamePointId>100,NULL,gamePointId)) a from Carbon_automation_test2")({
checkAnswer(
sql("select max (if(gamePointId>100,NULL,gamePointId)) a from Carbon_automation_test2"),
- Seq(Row(79.0))
+ sql("select max (if(gamePointId>100,NULL,gamePointId)) a from Carbon_automation_hive2")
)
}
)
@@ -426,7 +360,7 @@ class AllDataTypesTestCase2 extends QueryTest with BeforeAndAfterAll {
test("select stddev_pop(gamePointId) as a from Carbon_automation_test2")({
checkAnswer(
sql("select stddev_pop(gamePointId) as a from Carbon_automation_test2"),
- Seq(Row(809.1896217395077))
+ sql("select stddev_pop(gamePointId) as a from Carbon_automation_hive2")
)
}
)
@@ -435,7 +369,7 @@ class AllDataTypesTestCase2 extends QueryTest with BeforeAndAfterAll {
test("select covar_pop(gamePointId,gamePointId) as a from Carbon_automation_test2")({
checkAnswer(
sql("select covar_pop(gamePointId,gamePointId) as a from Carbon_automation_test2"),
- Seq(Row(654787.8439309277))
+ sql("select covar_pop(gamePointId,gamePointId) as a from Carbon_automation_hive2")
)
}
)
@@ -444,7 +378,7 @@ class AllDataTypesTestCase2 extends QueryTest with BeforeAndAfterAll {
test("select covar_samp(gamePointId,gamePointId) as a from Carbon_automation_test2")({
checkAnswer(
sql("select covar_samp(gamePointId,gamePointId) as a from Carbon_automation_test2"),
- Seq(Row(661469.3525424678))
+ sql("select covar_samp(gamePointId,gamePointId) as a from Carbon_automation_hive2")
)
}
)
@@ -453,53 +387,7 @@ class AllDataTypesTestCase2 extends QueryTest with BeforeAndAfterAll {
test("select percentile_approx(gamePointId,0.2) as a from Carbon_automation_test2")({
checkAnswer(
sql("select percentile_approx(gamePointId,0.2) as a from Carbon_automation_test2"),
- Seq(Row(746.4))
- )
- }
- )
-
- //TC_140
- test(
- "select count(distinct deviceColor) a,deliveryProvince,series from Carbon_automation_test2 " +
- "group by deliveryProvince,series order by deliveryProvince,series"
- )({
- checkAnswer(
- sql(
- "select count(distinct deviceColor) a,deliveryProvince,series from " +
- "Carbon_automation_test2 group by deliveryProvince,series order by deliveryProvince," +
- "series"
- ),
- Seq(Row(5, "Guangdong Province", "0Series"),
- Row(1, "Guangdong Province", "1Series"),
- Row(2, "Guangdong Province", "2Series"),
- Row(3, "Guangdong Province", "3Series"),
- Row(1, "Guangdong Province", "4Series"),
- Row(6, "Guangdong Province", "5Series"),
- Row(1, "Guangdong Province", "6Series"),
- Row(1, "Guangdong Province", "7Series"),
- Row(3, "Guangdong Province", "8Series"),
- Row(2, "Guangdong Province", "9Series"),
- Row(3, "Hubei Province", "0Series"),
- Row(1, "Hubei Province", "1Series"),
- Row(4, "Hubei Province", "2Series"),
- Row(1, "Hubei Province", "3Series"),
- Row(2, "Hubei Province", "4Series"),
- Row(1, "Hubei Province", "5Series"),
- Row(2, "Hubei Province", "6Series"),
- Row(6, "Hubei Province", "7Series"),
- Row(3, "Hubei Province", "8Series"),
- Row(2, "Hubei Province", "9Series"),
- Row(6, "Hunan Province", "0Series"),
- Row(1, "Hunan Province", "1Series"),
- Row(3, "Hunan Province", "2Series"),
- Row(1, "Hunan Province", "3Series"),
- Row(4, "Hunan Province", "4Series"),
- Row(7, "Hunan Province", "5Series"),
- Row(6, "Hunan Province", "6Series"),
- Row(3, "Hunan Province", "7Series"),
- Row(5, "Hunan Province", "8Series"),
- Row(3, "Hunan Province", "9Series")
- )
+ sql("select percentile_approx(gamePointId,0.2) as a from Carbon_automation_hive2")
)
}
)
@@ -515,38 +403,12 @@ class AllDataTypesTestCase2 extends QueryTest with BeforeAndAfterAll {
"select deliveryCountry,deliveryProvince,series,sum(gamePointId) a from " +
"Carbon_automation_test2 group by deliveryCountry,deliveryProvince,series order by " +
"deliveryCountry,deliveryProvince,series"
- ),
- Seq(Row("Chinese", "Guangdong Province", "0Series", 11182.0),
- Row("Chinese", "Guangdong Province", "1Series", 1053.0),
- Row("Chinese", "Guangdong Province", "2Series", 3468.0),
- Row("Chinese", "Guangdong Province", "3Series", 11206.0),
- Row("Chinese", "Guangdong Province", "4Series", 1337.0),
- Row("Chinese", "Guangdong Province", "5Series", 10962.0),
- Row("Chinese", "Guangdong Province", "6Series", 1229.0),
- Row("Chinese", "Guangdong Province", "7Series", 3543.0),
- Row("Chinese", "Guangdong Province", "8Series", 3859.0),
- Row("Chinese", "Guangdong Province", "9Series", 1525.0),
- Row("Chinese", "Hubei Province", "0Series", 5545.0),
- Row("Chinese", "Hubei Province", "1Series", 2593.0),
- Row("Chinese", "Hubei Province", "2Series", 4344.0),
- Row("Chinese", "Hubei Province", "3Series", 2077.0),
- Row("Chinese", "Hubei Province", "4Series", 3542.0),
- Row("Chinese", "Hubei Province", "5Series", 692.0),
- Row("Chinese", "Hubei Province", "6Series", 1657.0),
- Row("Chinese", "Hubei Province", "7Series", 10629.197),
- Row("Chinese", "Hubei Province", "8Series", 3279.0),
- Row("Chinese", "Hubei Province", "9Series", 3088.0),
- Row("Chinese", "Hunan Province", "0Series", 9153.0),
- Row("Chinese", "Hunan Province", "1Series", 355.0),
- Row("Chinese", "Hunan Province", "2Series", 4542.0),
- Row("Chinese", "Hunan Province", "3Series", 1952.0),
- Row("Chinese", "Hunan Province", "4Series", 7465.0),
- Row("Chinese", "Hunan Province", "5Series", 17417.0),
- Row("Chinese", "Hunan Province", "6Series", 10036.0),
- Row("Chinese", "Hunan Province", "7Series", 4419.0),
- Row("Chinese", "Hunan Province", "8Series", 6429.0),
- Row("Chinese", "Hunan Province", "9Series", 8307.0)
+ ), sql(
+ "select deliveryCountry,deliveryProvince,series,sum(gamePointId) a from " +
+ "Carbon_automation_hive2 group by deliveryCountry,deliveryProvince,series order by " +
+ "deliveryCountry,deliveryProvince,series"
)
+
)
}
)
@@ -559,18 +421,11 @@ class AllDataTypesTestCase2 extends QueryTest with BeforeAndAfterAll {
sql(
"select series,avg(gamePointId) a from Carbon_automation_test2 group by series order by " +
"series"
- ),
- Seq(Row("0Series", 1725.3333333333333),
- Row("1Series", 1333.6666666666667),
- Row("2Series", 1372.6666666666667),
- Row("3Series", 1904.375),
- Row("4Series", 1543.0),
- Row("5Series", 1710.0588235294117),
- Row("6Series", 1435.7777777777778),
- Row("7Series", 1690.1088181818182),
- Row("8Series", 1233.3636363636363),
- Row("9Series", 1615.0)
+ ), sql(
+ "select series,avg(gamePointId) a from Carbon_automation_hive2 group by series order by " +
+ "series"
)
+
)
}
)
@@ -586,38 +441,12 @@ class AllDataTypesTestCase2 extends QueryTest with BeforeAndAfterAll {
"select deliveryCountry,deliveryProvince,series,avg(gamePointId) a from " +
"Carbon_automation_test2 group by deliveryCountry,deliveryProvince,series order by " +
"deliveryCountry,deliveryProvince,series"
- ),
- Seq(Row("Chinese", "Guangdong Province", "0Series", 1863.6666666666667),
- Row("Chinese", "Guangdong Province", "1Series", 1053.0),
- Row("Chinese", "Guangdong Province", "2Series", 1734.0),
- Row("Chinese", "Guangdong Province", "3Series", 2241.2),
- Row("Chinese", "Guangdong Province", "4Series", 1337.0),
- Row("Chinese", "Guangdong Province", "5Series", 1566.0),
- Row("Chinese", "Guangdong Province", "6Series", 1229.0),
- Row("Chinese", "Guangdong Province", "7Series", 1771.5),
- Row("Chinese", "Guangdong Province", "8Series", 1286.3333333333333),
- Row("Chinese", "Guangdong Province", "9Series", 762.5),
- Row("Chinese", "Hubei Province", "0Series", 1848.3333333333333),
- Row("Chinese", "Hubei Province", "1Series", 2593.0),
- Row("Chinese", "Hubei Province", "2Series", 1086.0),
- Row("Chinese", "Hubei Province", "3Series", 2077.0),
- Row("Chinese", "Hubei Province", "4Series", 1771.0),
- Row("Chinese", "Hubei Province", "5Series", 692.0),
- Row("Chinese", "Hubei Province", "6Series", 828.5),
- Row("Chinese", "Hubei Province", "7Series", 1771.5328333333334),
- Row("Chinese", "Hubei Province", "8Series", 1093.0),
- Row("Chinese", "Hubei Province", "9Series", 1544.0),
- Row("Chinese", "Hunan Province", "0Series", 1525.5),
- Row("Chinese", "Hunan Province", "1Series", 355.0),
- Row("Chinese", "Hunan Province", "2Series", 1514.0),
- Row("Chinese", "Hunan Province", "3Series", 976.0),
- Row("Chinese", "Hunan Province", "4Series", 1493.0),
- Row("Chinese", "Hunan Province", "5Series", 1935.2222222222222),
- Row("Chinese", "Hunan Province", "6Series", 1672.6666666666667),
- Row("Chinese", "Hunan Province", "7Series", 1473.0),
- Row("Chinese", "Hunan Province", "8Series", 1285.8),
- Row("Chinese", "Hunan Province", "9Series", 2076.75)
+ ), sql(
+ "select deliveryCountry,deliveryProvince,series,avg(gamePointId) a from " +
+ "Carbon_automation_hive2 group by deliveryCountry,deliveryProvince,series order by " +
+ "deliveryCountry,deliveryProvince,series"
)
+
)
}
)
@@ -630,4132 +459,675 @@ class AllDataTypesTestCase2 extends QueryTest with BeforeAndAfterAll {
sql(
"select series,min(gamePointId) a from Carbon_automation_test2 group by series order by " +
"series"
- ),
- Seq(Row("0Series", 202.0),
- Row("1Series", 355.0),
- Row("2Series", 29.0),
- Row("3Series", 79.0),
- Row("4Series", 448.0),
- Row("5Series", 151.0),
- Row("6Series", 750.0),
- Row("7Series", 1015.0),
- Row("8Series", 412.0),
- Row("9Series", 136.0)
+ ), sql(
+ "select series,min(gamePointId) a from Carbon_automation_hive2 group by series order by " +
+ "series"
)
+
)
}
)
- //TC_152
+
+
+ //TC_156
test(
- "select deliveryCountry,deliveryProvince,series,min(gamePointId) a from " +
- "Carbon_automation_test2 group by deliveryCountry,deliveryProvince,series order by " +
- "deliveryCountry,deliveryProvince,series"
+ "select series,max(gamePointId) a from Carbon_automation_test2 group by series order by series"
)({
checkAnswer(
sql(
- "select deliveryCountry,deliveryProvince,series,min(gamePointId) a from " +
- "Carbon_automation_test2 group by deliveryCountry,deliveryProvince,series order by " +
- "deliveryCountry,deliveryProvince,series"
- ),
- Seq(Row("Chinese", "Guangdong Province", "0Series", 202.0),
- Row("Chinese", "Guangdong Province", "1Series", 1053.0),
- Row("Chinese", "Guangdong Province", "2Series", 1407.0),
- Row("Chinese", "Guangdong Province", "3Series", 1077.0),
- Row("Chinese", "Guangdong Province", "4Series", 1337.0),
- Row("Chinese", "Guangdong Province", "5Series", 256.0),
- Row("Chinese", "Guangdong Province", "6Series", 1229.0),
- Row("Chinese", "Guangdong Province", "7Series", 1368.0),
- Row("Chinese", "Guangdong Province", "8Series", 412.0),
- Row("Chinese", "Guangdong Province", "9Series", 571.0),
- Row("Chinese", "Hubei Province", "0Series", 732.0),
- Row("Chinese", "Hubei Province", "1Series", 2593.0),
- Row("Chinese", "Hubei Province", "2Series", 29.0),
- Row("Chinese", "Hubei Province", "3Series", 2077.0),
- Row("Chinese", "Hubei Province", "4Series", 572.0),
- Row("Chinese", "Hubei Province", "5Series", 692.0),
- Row("Chinese", "Hubei Province", "6Series", 750.0),
- Row("Chinese", "Hubei Province", "7Series", 1080.0),
- Row("Chinese", "Hubei Province", "8Series", 441.0),
- Row("Chinese", "Hubei Province", "9Series", 136.0),
- Row("Chinese", "Hunan Province", "0Series", 505.0),
- Row("Chinese", "Hunan Province", "1Series", 355.0),
- Row("Chinese", "Hunan Province", "2Series", 298.0),
- Row("Chinese", "Hunan Province", "3Series", 79.0),
- Row("Chinese", "Hunan Province", "4Series", 448.0),
- Row("Chinese", "Hunan Province", "5Series", 151.0),
- Row("Chinese", "Hunan Province", "6Series", 845.0),
- Row("Chinese", "Hunan Province", "7Series", 1015.0),
- Row("Chinese", "Hunan Province", "8Series", 538.0),
- Row("Chinese", "Hunan Province", "9Series", 1823.0)
+ "select series,max(gamePointId) a from Carbon_automation_test2 group by series order by " +
+ "series"
+ ), sql(
+ "select series,max(gamePointId) a from Carbon_automation_hive2 group by series order by " +
+ "series"
)
+
)
}
)
- //TC_153
- test(
- "select deliveryProvince,series,min(deviceInformationId) a from Carbon_automation_test2 group" +
- " by deliveryProvince,series order by deliveryProvince,series"
- )({
+ //TC_169
+ test("select imei,series,gamePointId from Carbon_automation_test2 limit 10")({
checkAnswer(
- sql(
- "select deliveryProvince,series,min(deviceInformationId) a from Carbon_automation_test2 " +
- "group by deliveryProvince,series order by deliveryProvince,series"
- ),
- Seq(Row("Guangdong Province", "0Series", 100011),
- Row("Guangdong Province", "1Series", 100032),
- Row("Guangdong Province", "2Series", 100034),
- Row("Guangdong Province", "3Series", 10006),
- Row("Guangdong Province", "4Series", 100059),
- Row("Guangdong Province", "5Series", 10004),
- Row("Guangdong Province", "6Series", 100038),
- Row("Guangdong Province", "7Series", 10000),
- Row("Guangdong Province", "8Series", 100039),
- Row("Guangdong Province", "9Series", 100043),
- Row("Hubei Province", "0Series", 10002),
- Row("Hubei Province", "1Series", 100005),
- Row("Hubei Province", "2Series", 100050),
- Row("Hubei Province", "3Series", 100077),
- Row("Hubei Province", "4Series", 100004),
- Row("Hubei Province", "5Series", 1000),
- Row("Hubei Province", "6Series", 100056),
- Row("Hubei Province", "7Series", 1),
- Row("Hubei Province", "8Series", 100018),
- Row("Hubei Province", "9Series", 100000),
- Row("Hunan Province", "0Series", 100001),
- Row("Hunan Province", "1Series", 100013),
- Row("Hunan Province", "2Series", 10001),
- Row("Hunan Province", "3Series", 100010),
- Row("Hunan Province", "4Series", 100012),
- Row("Hunan Province", "5Series", 100),
- Row("Hunan Province", "6Series", 100006),
- Row("Hunan Province", "7Series", 10003),
- Row("Hunan Province", "8Series", 10005),
- Row("Hunan Province", "9Series", 100007)
- )
+ sql("select imei,series,gamePointId from Carbon_automation_test2 limit 10"),
+ sql("select imei,series,gamePointId from Carbon_automation_hive2 limit 10")
+
+ )
+ }
+ )
+
+ //TC_174
+ test("select distinct gamePointId from Carbon_automation_test2")({
+ checkAnswer(
+ sql("select distinct gamePointId from Carbon_automation_test2"),
+ sql("select distinct gamePointId from Carbon_automation_hive2")
+
+ )
+ }
+ )
+
+ //TC_188
+ test("select series,gamePointId as a from Carbon_automation_test2 order by a asc limit 10")({
+ checkAnswer(
+ sql("select series,gamePointId as a from Carbon_automation_test2 order by a asc limit 10"),
+ sql("select series,gamePointId as a from Carbon_automation_hive2 order by a asc limit 10")
+
+ )
+ }
+ )
+
+ //TC_189
+ test("select series,gamePointId as a from Carbon_automation_test2 order by a desc limit 10")({
+ checkAnswer(
+ sql("select series,gamePointId as a from Carbon_automation_test2 order by a desc limit 10"),
+ sql("select series,gamePointId as a from Carbon_automation_hive2 order by a desc limit 10")
+
)
}
)
- //TC_154
+ //TC_192
test(
- "select deliveryProvince,series,min(channelsId) a from Carbon_automation_test2 group by " +
- "deliveryProvince,series order by deliveryProvince,series"
+ "select imei from Carbon_automation_test2 where (contractNumber == 5281803) and " +
+ "(gamePointId==2738.5621) "
)({
checkAnswer(
sql(
- "select deliveryProvince,series,min(channelsId) a from Carbon_automation_test2 group by " +
- "deliveryProvince,series order by deliveryProvince,series"
- ),
- Seq(Row("Guangdong Province", "0Series", "1"),
- Row("Guangdong Province", "1Series", "7"),
- Row("Guangdong Province", "2Series", "6"),
- Row("Guangdong Province", "3Series", "1"),
- Row("Guangdong Province", "4Series", "7"),
- Row("Guangdong Province", "5Series", "1"),
- Row("Guangdong Province", "6Series", "3"),
- Row("Guangdong Province", "7Series", "1"),
- Row("Guangdong Province", "8Series", "1"),
- Row("Guangdong Province", "9Series", "6"),
- Row("Hubei Province", "0Series", "3"),
- Row("Hubei Province", "1Series", "1"),
- Row("Hubei Province", "2Series", "1"),
- Row("Hubei Province", "3Series", "6"),
- Row("Hubei Province", "4Series", "2"),
- Row("Hubei Province", "5Series", "3"),
- Row("Hubei Province", "6Series", "5"),
- Row("Hubei Province", "7Series", "1"),
- Row("Hubei Province", "8Series", "4"),
- Row("Hubei Province", "9Series", "6"),
- Row("Hunan Province", "0Series", "2"),
- Row("Hunan Province", "1Series", "6"),
- Row("Hunan Province", "2Series", "5"),
- Row("Hunan Province", "3Series", "3"),
- Row("Hunan Province", "4Series", "1"),
- Row("Hunan Province", "5Series", "3"),
- Row("Hunan Province", "6Series", "2"),
- Row("Hunan Province", "7Series", "3"),
- Row("Hunan Province", "8Series", "1"),
- Row("Hunan Province", "9Series", "1")
+ "select imei from Carbon_automation_test2 where (contractNumber == 5281803) and " +
+ "(gamePointId==2738.5621)"
+ ), sql(
+ "select imei from Carbon_automation_hive2 where (contractNumber == 5281803) and " +
+ "(gamePointId==2738.5621)"
)
)
}
)
- //TC_155
+ //TC_200
test(
- "select deliveryProvince,series,min(bomCode) a from Carbon_automation_test2 group by " +
- "deliveryProvince,series order by deliveryProvince,series"
+ "select contractNumber,gamePointId,series from Carbon_automation_test2 where " +
+ "(deviceInformationId=100 and deviceColor='1Device Color') OR (deviceInformationId=10 and " +
+ "deviceColor='0Device Color')"
)({
checkAnswer(
sql(
- "select deliveryProvince,series,min(bomCode) a from Carbon_automation_test2 group by " +
- "deliveryProvince,series order by deliveryProvince,series"
- ),
- Seq(Row("Guangdong Province", "0Series", "100011"),
- Row("Guangdong Province", "1Series", "100032"),
- Row("Guangdong Province", "2Series", "100034"),
- Row("Guangdong Province", "3Series", "100042"),
- Row("Guangdong Province", "4Series", "100059"),
- Row("Guangdong Province", "5Series", "100020"),
- Row("Guangdong Province", "6Series", "100038"),
- Row("Guangdong Province", "7Series", "10000"),
- Row("Guangdong Province", "8Series", "100039"),
- Row("Guangdong Province", "9Series", "100043"),
- Row("Hubei Province", "0Series", "100009"),
- Row("Hubei Province", "1Series", "100005"),
- Row("Hubei Province", "2Series", "100050"),
- Row("Hubei Province", "3Series", "100077"),
- Row("Hubei Province", "4Series", "100004"),
- Row("Hubei Province", "5Series", "1000"),
- Row("Hubei Province", "6Series", "100056"),
- Row("Hubei Province", "7Series", "1"),
- Row("Hubei Province", "8Series", "100018"),
- Row("Hubei Province", "9Series", "100000"),
- Row("Hunan Province", "0Series", "100001"),
- Row("Hunan Province", "1Series", "100013"),
- Row("Hunan Province", "2Series", "10001"),
- Row("Hunan Province", "3Series", "100010"),
- Row("Hunan Province", "4Series", "100012"),
- Row("Hunan Province", "5Series", "100"),
- Row("Hunan Province", "6Series", "100006"),
- Row("Hunan Province", "7Series", "10003"),
- Row("Hunan Province", "8Series", "100008"),
- Row("Hunan Province", "9Series", "100007")
- )
- )
+ "select contractNumber,gamePointId,series from Carbon_automation_test2 where " +
+ "(deviceInformationId=100 and deviceColor='1Device Color') OR (deviceInformationId=10 " +
+ "and deviceColor='0Device Color')"
+ ), sql(
+ "select contractNumber,gamePointId,series from Carbon_automation_hive2 where " +
+ "(deviceInformationId=100 and deviceColor='1Device Color') OR (deviceInformationId=10 " +
+ "and deviceColor='0Device Color')"
+ ))
}
)
- //TC_156
+ //TC_201
test(
- "select series,max(gamePointId) a from Carbon_automation_test2 group by series order by series"
+ "select contractNumber,gamePointId,series from Carbon_automation_test2 where series !='8Series'"
)({
checkAnswer(
sql(
- "select series,max(gamePointId) a from Carbon_automation_test2 group by series order by " +
- "series"
- ),
- Seq(Row("0Series", 2972.0),
- Row("1Series", 2593.0),
- Row("2Series", 2553.0),
- Row("3Series", 2745.0),
- Row("4Series", 2970.0),
- Row("5Series", 2849.0),
- Row("6Series", 2572.0),
- Row("7Series", 2738.562),
- Row("8Series", 2078.0),
- Row("9Series", 2952.0)
+ "select contractNumber,gamePointId,series from Carbon_automation_test2 where series " +
+ "!='8Series'"
+ ), sql(
+ "select contractNumber,gamePointId,series from Carbon_automation_hive2 where series " +
+ "!='8Series'"
)
+
)
}
)
- //TC_157
+ //TC_202
test(
- "select deliveryCountry,deliveryProvince,series,max(gamePointId) a from " +
- "Carbon_automation_test2 group by deliveryCountry,deliveryProvince,series order by " +
- "deliveryCountry,deliveryProvince,series"
+ "select contractNumber,gamePointId,series from Carbon_automation_test2 where series " +
+ "!='8Series' and internalModels !='8Internal models'"
)({
checkAnswer(
sql(
- "select deliveryCountry,deliveryProvince,series,max(gamePointId) a from " +
- "Carbon_automation_test2 group by deliveryCountry,deliveryProvince,series order by " +
- "deliveryCountry,deliveryProvince,series"
- ),
- Seq(Row("Chinese", "Guangdong Province", "0Series", 2890.0),
- Row("Chinese", "Guangdong Province", "1Series", 1053.0),
- Row("Chinese", "Guangdong Province", "2Series", 2061.0),
- Row("Chinese", "Guangdong Province", "3Series", 2745.0),
- Row("Chinese", "Guangdong Province", "4Series", 1337.0),
- Row("Chinese", "Guangdong Province", "5Series", 2734.0),
- Row("Chinese", "Guangdong Province", "6Series", 1229.0),
- Row("Chinese", "Guangdong Province", "7Series", 2175.0),
- Row("Chinese", "Guangdong Province", "8Series", 1750.0),
- Row("Chinese", "Guangdong Province", "9Series", 954.0),
- Row("Chinese", "Hubei Province", "0Series", 2972.0),
- Row("Chinese", "Hubei Province", "1Series", 2593.0),
- Row("Chinese", "Hubei Province", "2Series", 1655.0),
- Row("Chinese", "Hubei Province", "3Series", 2077.0),
- Row("Chinese", "Hubei Province", "4Series", 2970.0),
- Row("Chinese", "Hubei Province", "5Series", 692.0),
- Row("Chinese", "Hubei Province", "6Series", 907.0),
- Row("Chinese", "Hubei Province", "7Series", 2738.562),
- Row("Chinese", "Hubei Province", "8Series", 2078.0),
- Row("Chinese", "Hubei Province", "9Series", 2952.0),
- Row("Chinese", "Hunan Province", "0Series", 2436.0),
- Row("Chinese", "Hunan Province", "1Series", 355.0),
- Row("Chinese", "Hunan Province", "2Series", 2553.0),
- Row("Chinese", "Hunan Province", "3Series", 1873.0),
- Row("Chinese", "Hunan Province", "4Series", 2863.0),
- Row("Chinese", "Hunan Province", "5Series", 2849.0),
- Row("Chinese", "Hunan Province", "6Series", 2572.0),
- Row("Chinese", "Hunan Province", "7Series", 2071.0),
- Row("Chinese", "Hunan Province", "8Series", 1608.0),
- Row("Chinese", "Hunan Province", "9Series", 2288.0)
+ "select contractNumber,gamePointId,series from Carbon_automation_test2 where series " +
+ "!='8Series' and internalModels !='8Internal models'"
+ ), sql(
+ "select contractNumber,gamePointId,series from Carbon_automation_hive2 where series " +
+ "!='8Series' and internalModels !='8Internal models'"
)
+
)
}
)
- //TC_158
+ //TC_207
test(
- "select deliveryProvince,series,max(deviceInformationId) a from Carbon_automation_test2 group" +
- " by deliveryProvince,series order by deliveryProvince,series"
+ "select contractNumber,gamePointId,series from Carbon_automation_test2 where gamePointId " +
+ ">2738.562"
)({
checkAnswer(
sql(
- "select deliveryProvince,series,max(deviceInformationId) a from Carbon_automation_test2 " +
- "group by deliveryProvince,series order by deliveryProvince,series"
- ),
- Seq(Row("Guangdong Province", "0Series", 100084),
- Row("Guangdong Province", "1Series", 100032),
- Row("Guangdong Province", "2Series", 100051),
- Row("Guangdong Province", "3Series", 100075),
- Row("Guangdong Province", "4Series", 100059),
- Row("Guangdong Province", "5Series", 100081),
- Row("Guangdong Province", "6Series", 100038),
- Row("Guangdong Province", "7Series", 100054),
- Row("Guangdong Province", "8Series", 100068),
- Row("Guangdong Province", "9Series", 100080),
- Row("Hubei Province", "0Series", 100076),
- Row("Hubei Province", "1Series", 100005),
- Row("Hubei Province", "2Series", 100078),
- Row("Hubei Province", "3Series", 100077),
- Row("Hubei Province", "4Series", 100067),
- Row("Hubei Province", "5Series", 1000),
- Row("Hubei Province", "6Series", 100074),
- Row("Hubei Province", "7Series", 1000000),
- Row("Hubei Province", "8Series", 100040),
- Row("Hubei Province", "9Series", 100062),
- Row("Hunan Province", "0Series", 100083),
- Row("Hunan Province", "1Series", 100013),
- Row("Hunan Province", "2Series", 100045),
- Row("Hunan Province", "3Series", 100016),
- Row("Hunan Province", "4Series", 100079),
- Row("Hunan Province", "5Series", 100082),
- Row("Hunan Province", "6Series", 100066),
- Row("Hunan Province", "7Series", 100037),
- Row("Hunan Province", "8Series", 100069),
- Row("Hunan Province", "9Series", 100057)
+ "select contractNumber,gamePointId,series from Carbon_automation_test2 where gamePointId " +
+ ">2738.562"
+ ), sql(
+ "select contractNumber,gamePointId,series from Carbon_automation_hive2 where gamePointId " +
+ ">2738.562"
)
+
)
}
)
- //TC_159
+ //TC_217
test(
- "select deliveryProvince,series,max(channelsId) a from Carbon_automation_test2 group by " +
- "deliveryProvince,series order by deliveryProvince,series"
+ "select imei, Latest_DAY from Carbon_automation_test2 where Latest_DAY BETWEEN Latest_areaId " +
+ "AND Latest_HOUR"
)({
checkAnswer(
sql(
- "select deliveryProvince,series,max(channelsId) a from Carbon_automation_test2 group by " +
- "deliveryProvince,series order by deliveryProvince,series"
- ),
- Seq(Row("Guangdong Province", "0Series", "6"),
- Row("Guangdong Province", "1Series", "7"),
- Row("Guangdong Province", "2Series", "7"),
- Row("Guangdong Province", "3Series", "6"),
- Row("Guangdong Province", "4Series", "7"),
- Row("Guangdong Province", "5Series", "7"),
- Row("Guangdong Province", "6Series", "3"),
- Row("Guangdong Province", "7Series", "2"),
- Row("Guangdong Province", "8Series", "7"),
- Row("Guangdong Province", "9Series", "6"),
- Row("Hubei Province", "0Series", "7"),
- Row("Hubei Province", "1Series", "1"),
- Row("Hubei Province", "2Series", "5"),
- Row("Hubei Province", "3Series", "6"),
- Row("Hubei Province", "4Series", "7"),
- Row("Hubei Province", "5Series", "3"),
- Row("Hubei Province", "6Series", "7"),
- Row("Hubei Province", "7Series", "7"),
- Row("Hubei Province", "8Series", "7"),
- Row("Hubei Province", "9Series", "6"),
- Row("Hunan Province", "0Series", "7"),
- Row("Hunan Province", "1Series", "6"),
- Row("Hunan Province", "2Series", "6"),
- Row("Hunan Province", "3Series", "6"),
- Row("Hunan Province", "4Series", "7"),
- Row("Hunan Province", "5Series", "7"),
- Row("Hunan Province", "6Series", "7"),
- Row("Hunan Province", "7Series", "6"),
- Row("Hunan Province", "8Series", "5"),
- Row("Hunan Province", "9Series", "6")
+ "select imei, Latest_DAY from Carbon_automation_test2 where Latest_DAY BETWEEN " +
+ "Latest_areaId AND Latest_HOUR"
+ ), sql(
+ "select imei, Latest_DAY from Carbon_automation_hive2 where Latest_DAY BETWEEN " +
+ "Latest_areaId AND Latest_HOUR"
)
+
+
)
}
)
- //TC_160
+ //TC_221
test(
- "select deliveryProvince,series,max(bomCode) a from Carbon_automation_test2 group by " +
- "deliveryProvince,series order by deliveryProvince,series"
+ "select imei, Latest_DAY from Carbon_automation_test2 where Latest_DAY NOT LIKE Latest_areaId" +
+ " AND Latest_DAY NOT LIKE Latest_HOUR"
)({
checkAnswer(
sql(
- "select deliveryProvince,series,max(bomCode) a from Carbon_automation_test2 group by " +
- "deliveryProvince,series order by deliveryProvince,series"
- ),
- Seq(Row("Guangdong Province", "0Series", "100084"),
- Row("Guangdong Province", "1Series", "100032"),
- Row("Guangdong Province", "2Series", "100051"),
- Row("Guangdong Province", "3Series", "100075"),
- Row("Guangdong Province", "4Series", "100059"),
- Row("Guangdong Province", "5Series", "100081"),
- Row("Guangdong Province", "6Series", "100038"),
- Row("Guangdong Province", "7Series", "100054"),
- Row("Guangdong Province", "8Series", "100068"),
- Row("Guangdong Province", "9Series", "100080"),
- Row("Hubei Province", "0Series", "100076"),
- Row("Hubei Province", "1Series", "100005"),
- Row("Hubei Province", "2Series", "100078"),
- Row("Hubei Province", "3Series", "100077"),
- Row("Hubei Province", "4Series", "100067"),
- Row("Hubei Province", "5Series", "1000"),
- Row("Hubei Province", "6Series", "100074"),
- Row("Hubei Province", "7Series", "100055"),
- Row("Hubei Province", "8Series", "100040"),
- Row("Hubei Province", "9Series", "100062"),
- Row("Hunan Province", "0Series", "100083"),
- Row("Hunan Province", "1Series", "100013"),
- Row("Hunan Province", "2Series", "100045"),
- Row("Hunan Province", "3Series", "100016"),
- Row("Hunan Province", "4Series", "100079"),
- Row("Hunan Province", "5Series", "100082"),
- Row("Hunan Province", "6Series", "100066"),
- Row("Hunan Province", "7Series", "100037"),
- Row("Hunan Province", "8Series", "10007"),
- Row("Hunan Province", "9Series", "100057")
+ "select imei, Latest_DAY from Carbon_automation_test2 where Latest_DAY NOT LIKE " +
+ "Latest_areaId AND Latest_DAY NOT LIKE Latest_HOUR"
+ ), sql(
+ "select imei, Latest_DAY from Carbon_automation_hive2 where Latest_DAY NOT LIKE " +
+ "Latest_areaId AND Latest_DAY NOT LIKE Latest_HOUR"
)
+
)
}
)
- //TC_169
- test("select imei,series,gamePointId from Carbon_automation_test2 limit 10")({
+ //TC_225
+ test("select imei,gamePointId from Carbon_automation_test2 where gamePointId >505")({
checkAnswer(
- sql("select imei,series,gamePointId from Carbon_automation_test2 limit 10"),
- Seq(Row("1AA1", "7Series", 2738.562),
- Row("1AA10", "7Series", 1714.635),
- Row("1AA100", "5Series", 1271.0),
- Row("1AA1000", "5Series", 692.0),
- Row("1AA10000", "7Series", 2175.0),
- Row("1AA100000", "9Series", 136.0),
- Row("1AA1000000", "7Series", 1600.0),
- Row("1AA100001", "0Series", 505.0),
- Row("1AA100002", "0Series", 1341.0),
- Row("1AA100003", "5Series", 2239.0)
- )
+ sql("select imei,gamePointId from Carbon_automation_test2 where gamePointId >505"),
+ sql("select imei,gamePointId from Carbon_automation_hive2 where gamePointId >505")
+
)
}
)
- //TC_174
- test("select distinct gamePointId from Carbon_automation_test2")({
+ //TC_226
+ test("select imei,gamePointId from Carbon_automation_test2 where gamePointId <505")({
checkAnswer(
- sql("select distinct gamePointId from Carbon_automation_test2"),
- Seq(Row(1350.0),
- Row(412.0),
- Row(2952.0),
- Row(2077.0),
- Row(1750.0),
- Row(1600.0),
- Row(2436.0),
- Row(2061.0),
- Row(1442.0),
- Row(1717.0),
- Row(1567.0),
- Row(1434.0),
- Row(2745.0),
- Row(954.0),
- Row(2970.0),
- Row(1226.0),
- Row(750.0),
- Row(256.0),
- Row(2488.0),
- Row(1768.0),
- Row(1368.0),
- Row(571.0),
- Row(2863.0),
- Row(79.0),
- Row(2288.0),
- Row(2972.0),
- Row(2572.0),
- Row(692.0),
- Row(1077.0),
- Row(613.0),
- Row(813.0),
- Row(538.0),
- Row(2890.0),
- Row(202.0),
- Row(448.0),
- Row(298.0),
- Row(2399.0),
- Row(2849.0),
- Row(2224.0),
- Row(151.0),
- Row(1778.0),
- Row(2483.0),
- Row(901.0),
- Row(1053.0),
- Row(1728.0),
- Row(2192.0),
- Row(2142.0),
- Row(572.0),
- Row(29.0),
- Row(1337.0),
- Row(568.0),
- Row(2826.0),
- Row(2738.562),
- Row(2635.0),
- Row(1229.0),
- Row(1271.0),
- Row(2194.0),
- Row(760.0),
- Row(2553.0),
- Row(2078.0),
- Row(2478.0),
- Row(1655.0),
- Row(1080.0),
- Row(505.0),
- Row(355.0),
- Row(1697.0),
- Row(2071.0),
- Row(2205.0),
- Row(1864.0),
- Row(1015.0),
- Row(2239.0),
- Row(865.0),
- Row(1873.0),
- Row(1098.0),
- Row(2348.0),
- Row(1823.0),
- Row(1973.0),
- Row(2507.0),
- Row(732.0),
- Row(907.0),
- Row(1714.635),
- Row(1407.0),
- Row(1724.0),
- Row(1999.0),
- Row(2175.0),
- Row(1991.0),
- Row(1691.0),
- Row(441.0),
- Row(136.0),
- Row(1341.0),
- Row(845.0),
- Row(2734.0),
- Row(1841.0),
- Row(1491.0),
- Row(1333.0),
- Row(2593.0),
- Row(1608.0)
- )
+ sql("select imei,gamePointId from Carbon_automation_test2 where gamePointId <505"),
+ sql("select imei,gamePointId from Carbon_automation_hive2 where gamePointId <505")
+
)
}
)
- //TC_188
- test("select series,gamePointId as a from Carbon_automation_test2 order by a asc limit 10")({
+ //TC_229
+ test("select imei,gamePointId from Carbon_automation_test2 where gamePointId >=505")({
checkAnswer(
- sql("select series,gamePointId as a from Carbon_automation_test2 order by a asc limit 10"),
- Seq(Row("2Series", 29.0),
- Row("3Series", 79.0),
- Row("9Series", 136.0),
- Row("5Series", 151.0),
- Row("0Series", 202.0),
- Row("5Series", 256.0),
- Row("2Series", 298.0),
- Row("1Series", 355.0),
- Row("8Series", 412.0),
- Row("8Series", 441.0)
- )
+ sql("select imei,gamePointId from Carbon_automation_test2 where gamePointId >=505"),
+ sql("select imei,gamePointId from Carbon_automation_hive2 where gamePointId >=505")
+
)
}
)
- //TC_189
- test("select series,gamePointId as a from Carbon_automation_test2 order by a desc limit 10")({
+ //TC_230
+ test("select imei,gamePointId from Carbon_automation_test2 where gamePointId <=505")({
checkAnswer(
- sql("select series,gamePointId as a from Carbon_automation_test2 order by a desc limit 10"),
- Seq(Row("0Series", 2972.0),
- Row("4Series", 2970.0),
- Row("9Series", 2952.0),
- Row("0Series", 2890.0),
- Row("4Series", 2863.0),
- Row("5Series", 2849.0),
- Row("0Series", 2826.0),
- Row("3Series", 2745.0),
- Row("7Series", 2738.562),
- Row("5Series", 2734.0)
- )
+ sql("select imei,gamePointId from Carbon_automation_test2 where gamePointId <=505"),
+ sql("select imei,gamePointId from Carbon_automation_hive2 where gamePointId <=505")
+
)
}
)
- //TC_192
+ //TC_241
test(
- "select imei from Carbon_automation_test2 where (contractNumber == 5281803) and " +
- "(gamePointId==2738.562)1 "
+ "select imei from Carbon_automation_test2 where (contractNumber == 5281803) OR " +
+ "(gamePointId==2738.562) order by contractNumber"
)({
checkAnswer(
sql(
- "select imei from Carbon_automation_test2 where (contractNumber == 5281803) and " +
- "(gamePointId==2738.562)"
- ),
- Seq(Row("1AA1"))
+ "select imei from Carbon_automation_test2 where (contractNumber == 5281803) OR " +
+ "(gamePointId==2738.562) order by contractNumber"
+ ), sql(
+ "select imei from Carbon_automation_hive2 where (contractNumber == 5281803) OR " +
+ "(gamePointId==2738.562) order by contractNumber"
+ )
)
}
)
- //TC_193
+ //TC_242
test(
- "select contractNumber,gamePointId,series from Carbon_automation_test2 where (contractNumber" +
- " == 5281803) and (gamePointId==2738.562)"
+ "select channelsId from Carbon_automation_test2 where (channelsId == '4') OR " +
+ "(gamePointId==2738.562) order by channelsId"
)({
checkAnswer(
sql(
- "select contractNumber,gamePointId,series from Carbon_automation_test2 where " +
- "(contractNumber == 5281803) and (gamePointId==2738.562)"
- ),
- Seq(Row(5281803.0, 2738.562, "7Series"))
+ "select channelsId from Carbon_automation_test2 where (channelsId == '4') OR " +
+ "(gamePointId==2738.562) order by channelsId"
+ ), sql(
+ "select channelsId from Carbon_automation_hive2 where (channelsId == '4') OR " +
+ "(gamePointId==2738.562) order by channelsId"
+ )
+
)
}
)
- //TC_194
+
+
+ //TC_244
test(
- "select contractNumber,gamePointId,series from Carbon_automation_test2 where series='8Series'"
+ "select imei, gamePointId from Carbon_automation_test2 where contractNumber in (5281803) and " +
+ "gamePointId IN (2738.562) ORDER BY gamePointId"
)({
checkAnswer(
sql(
- "select contractNumber,gamePointId,series from Carbon_automation_test2 where " +
- "series='8Series'"
- ),
- Seq(Row(1070757.0, 1442.0, "8Series"),
- Row(574375.0, 441.0, "8Series"),
- Row(8229807.0, 760.0, "8Series"),
- Row(1901889.0, 1750.0, "8Series"),
- Row(7880439.0, 2078.0, "8Series"),
- Row(5659107.0, 1697.0, "8Series"),
- Row(6190068.0, 1608.0, "8Series"),
- Row(7420815.0, 538.0, "8Series"),
- Row(3235086.0, 412.0, "8Series"),
- Row(7917206.0, 1491.0, "8Series"),
- Row(4156339.0, 1350.0, "8Series")
+ "select imei, gamePointId from Carbon_automation_test2 where contractNumber in (5281803) " +
+ "and gamePointId IN (2738.562) ORDER BY gamePointId"
+ ), sql(
+ "select imei, gamePointId from Carbon_automation_hive2 where contractNumber in (5281803) " +
+ "and gamePointId IN (2738.562) ORDER BY gamePointId"
)
)
}
)
- //TC_195
+ //TC_245
test(
- "select contractNumber,gamePointId,series from Carbon_automation_test2 where series='8Series'" +
- " and internalModels='8Internal models'"
+ "select channelsId from Carbon_automation_test2 where channelsId in ('4') or gamePointId IN " +
+ "(2738.562) ORDER BY channelsId"
)({
checkAnswer(
sql(
- "select contractNumber,gamePointId,series from Carbon_automation_test2 where " +
- "series='8Series' and internalModels='8Internal models'"
- ),
- Seq(Row(1070757.0, 1442.0, "8Series"), Row(7880439.0, 2078.0, "8Series"))
- )
+ "select channelsId from Carbon_automation_test2 where channelsId in ('4') or gamePointId" +
+ " IN (2738.562) ORDER BY channelsId"
+ ), sql(
+ "select channelsId from Carbon_automation_hive2 where channelsId in ('4') or gamePointId" +
+ " IN (2738.562) ORDER BY channelsId"
+ )
+
+ )
}
)
- //TC_196
+ //TC_246
test(
- "select contractNumber,gamePointId,series from Carbon_automation_test2 where series='8Series'" +
- " or internalModels='8Internal models'"
+ "select deliveryCity from Carbon_automation_test2 where deliveryCity IN ('yichang') AND " +
+ "deliveryStreet IN ('yichang') ORDER BY deliveryCity"
)({
checkAnswer(
sql(
- "select contractNumber,gamePointId,series from Carbon_automation_test2 where " +
- "series='8Series' or internalModels='8Internal models'"
- ),
- Seq(Row(88231.0, 2239.0, "5Series"),
- Row(335583.0, 1991.0, "9Series"),
- Row(1070757.0, 1442.0, "8Series"),
- Row(574375.0, 441.0, "8Series"),
- Row(833654.0, 256.0, "5Series"),
- Row(6533899.0, 1724.0, "0Series"),
- Row(8229807.0, 760.0, "8Series"),
- Row(1901889.0, 1750.0, "8Series"),
- Row(7880439.0, 2078.0, "8Series"),
- Row(5659107.0, 1697.0, "8Series"),
- Row(7839922.0, 1823.0, "9Series"),
- Row(9500486.0, 2399.0, "3Series"),
- Row(6190068.0, 1608.0, "8Series"),
- Row(7236919.0, 1407.0, "2Series"),
- Row(7342321.0, 1728.0, "7Series"),
- Row(7420815.0, 538.0, "8Series"),
- Row(9318234.0, 1226.0, "2Series"),
- Row(3235086.0, 412.0, "8Series"),
- Row(7917206.0, 1491.0, "8Series"),
- Row(4156339.0, 1350.0, "8Series")
+ "select deliveryCity from Carbon_automation_test2 where deliveryCity IN ('yichang') AND " +
+ " deliveryStreet IN ('yichang') ORDER BY deliveryCity"
+ ), sql(
+ "select deliveryCity from Carbon_automation_hive2 where deliveryCity IN ('yichang') AND " +
+ " deliveryStreet IN ('yichang') ORDER BY deliveryCity"
)
+
)
}
)
- //TC_197
+ //TC_247
test(
- "select contractNumber,gamePointId,series from Carbon_automation_test2 where series='8Series'" +
- " or series='7Series'"
+ "select imei,gamePointId, channelsId,series from Carbon_automation_test2 where channelsId > " +
+ "4 ORDER BY gamePointId limit 5"
)({
checkAnswer(
sql(
- "select contractNumber,gamePointId,series from Carbon_automation_test2 where " +
- "series='8Series' or series='7Series'"
- ),
- Seq(Row(5281803.0, 2738.562, "7Series"),
- Row(6805600.0, 1714.635, "7Series"),
- Row(3784858.0, 2175.0, "7Series"),
- Row(9737768.0, 1600.0, "7Series"),
- Row(1070757.0, 1442.0, "8Series"),
- Row(574375.0, 441.0, "8Series"),
- Row(7487134.0, 1768.0, "7Series"),
- Row(5586718.0, 2071.0, "7Series"),
- Row(5857263.0, 1333.0, "7Series"),
- Row(6416074.0, 1080.0, "7Series"),
- Row(8229807.0, 760.0, "8Series"),
- Row(3311312.0, 1015.0, "7Series"),
- Row(1901889.0, 1750.0, "8Series"),
- Row(7880439.0, 2078.0, "8Series"),
- Row(5659107.0, 1697.0, "8Series"),
- Row(6190068.0, 1608.0, "8Series"),
- Row(6283156.0, 1368.0, "7Series"),
- Row(7342321.0, 1728.0, "7Series"),
- Row(7420815.0, 538.0, "8Series"),
- Row(3235086.0, 412.0, "8Series"),
- Row(7917206.0, 1491.0, "8Series"),
- Row(4156339.0, 1350.0, "8Series")
+ "select imei,gamePointId, channelsId,series from Carbon_automation_test2 where " +
+ "channelsId > 4 ORDER BY gamePointId limit 5"
+ ), sql(
+ "select imei,gamePointId, channelsId,series from Carbon_automation_hive2 where " +
+ "channelsId > 4 ORDER BY gamePointId limit 5"
)
+
)
}
)
- //TC_198
+ //TC_248
test(
- "select contractNumber,gamePointId,series from Carbon_automation_test2 where gamePointId=2738" +
- ".562"
+ "select imei,gamePointId, channelsId,series from Carbon_automation_test2 where channelsId < " +
+ "4 ORDER BY gamePointId limit 5"
)({
checkAnswer(
sql(
- "select contractNumber,gamePointId,series from Carbon_automation_test2 where " +
- "gamePointId=2738.562"
- ),
- Seq(Row(5281803.0, 2738.562, "7Series"))
+ "select imei,gamePointId, channelsId,series from Carbon_automation_test2 where " +
+ "channelsId < 4 ORDER BY gamePointId limit 5"
+ ), sql(
+ "select imei,gamePointId, channelsId,series from Carbon_automation_hive2 where " +
+ "channelsId < 4 ORDER BY gamePointId limit 5"
+ )
+
)
}
)
- //TC_199
+ //TC_249
test(
- "select contractNumber,gamePointId,series from Carbon_automation_test2 where " +
- "deviceInformationId=10"
+ "select imei,gamePointId, channelsId,series from Carbon_automation_test2 where channelsId >=" +
+ " 4 ORDER BY gamePointId limit 5"
)({
checkAnswer(
sql(
- "select contractNumber,gamePointId,series from Carbon_automation_test2 where " +
- "deviceInformationId=10"
- ),
- Seq(Row(6805600.0, 1714.635, "7Series"))
+ "select imei,gamePointId, channelsId,series from Carbon_automation_test2 where " +
+ "channelsId >= 4 ORDER BY gamePointId limit 5"
+ ), sql(
+ "select imei,gamePointId, channelsId,series from Carbon_automation_hive2 where " +
+ "channelsId >= 4 ORDER BY gamePointId limit 5"
+ )
+
)
}
)
- //TC_200
+ //TC_250
test(
- "select contractNumber,gamePointId,series from Carbon_automation_test2 where " +
- "(deviceInformationId=100 and deviceColor='1Device Color') OR (deviceInformationId=10 and " +
- "deviceColor='0Device Color')"
+ "select imei,gamePointId, channelsId,series from Carbon_automation_test2 where channelsId <=" +
+ " 4 ORDER BY gamePointId limit 5"
)({
checkAnswer(
sql(
- "select contractNumber,gamePointId,series from Carbon_automation_test2 where " +
- "(deviceInformationId=100 and deviceColor='1Device Color') OR (deviceInformationId=10 " +
- "and deviceColor='0Device Color')"
- ),
- Seq(Row(6805600.0, 1714.635, "7Series"), Row(8231335.0, 1271.0, "5Series"))
+ "select imei,gamePointId, channelsId,series from Carbon_automation_test2 where " +
+ "channelsId <= 4 ORDER BY gamePointId limit 5"
+ ), sql(
+ "select imei,gamePointId, channelsId,series from Carbon_automation_hive2 where " +
+ "channelsId <= 4 ORDER BY gamePointId limit 5"
+ )
+
)
}
)
- //TC_201
+ //TC_251
test(
- "select contractNumber,gamePointId,series from Carbon_automation_test2 where series !='8Series'"
+ "select imei,gamePointId, channelsId,series from Carbon_automation_test2 where channelsId " +
+ "BETWEEN 4 AND 5 ORDER BY gamePointId limit 5"
)({
checkAnswer(
sql(
- "select contractNumber,gamePointId,series from Carbon_automation_test2 where series " +
- "!='8Series'"
- ),
- Seq(Row(5281803.0, 2738.562, "7Series"),
- Row(6805600.0, 1714.635, "7Series"),
- Row(8231335.0, 1271.0, "5Series"),
- Row(8978765.0, 692.0, "5Series"),
- Row(3784858.0, 2175.0, "7Series"),
- Row(1602458.0, 136.0, "9Series"),
- Row(9737768.0, 1600.0, "7Series"),
- Row(2919786.0, 505.0, "0Series"),
- Row(9455612.0, 1341.0, "0Series"),
- Row(88231.0, 2239.0, "5Series"),
- Row(1439363.0, 2970.0, "4Series"),
- Row(3940720.0, 2593.0, "1Series"),
- Row(4451217.0, 2572.0, "6Series"),
- Row(335583.0, 1991.0, "9Series"),
- Row(2389657.0, 1841.0, "0Series"),
- Row(5986189.0, 298.0, "2Series"),
- Row(8543280.0, 79.0, "3Series"),
- Row(4816260.0, 202.0, "0Series"),
- Row(8453995.0, 568.0, "4Series"),
- Row(2051539.0, 355.0, "1Series"),
- Row(7610075.0, 151.0, "5Series"),
- Row(6663091.0, 2863.0, "4Series"),
- Row(6495292.0, 1873.0, "3Series"),
- Row(2611464.0, 2205.0, "9Series"),
- Row(4459076.0, 2194.0, "5Series"),
- Row(5204739.0, 2972.0, "0Series"),
- Row(833654.0, 256.0, "5Series"),
- Row(566917.0, 1778.0, "0Series"),
- Row(832387.0, 1999.0, "5Series"),
- Row(2850246.0, 2194.0, "5Series"),
- Row(6169467.0, 2483.0, "6Series"),
- Row(6533899.0, 1724.0, "0Series"),
- Row(7487134.0, 1768.0, "7Series"),
- Row(4750239.0, 2436.0, "0Series"),
- Row(8880112.0, 2849.0, "5Series"),
- Row(7774590.0, 1691.0, "2Series"),
- Row(5586718.0, 2071.0, "7Series"),
- Row(5857263.0, 1333.0, "7Series"),
- Row(6416074.0, 1080.0, "7Series"),
- Row(6994063.0, 1053.0, "1Series"),
- Row(5797079.0, 2061.0, "2Series"),
- Row(6283062.0, 2142.0, "5Series"),
- Row(8431770.0, 2224.0, "5Series"),
- Row(3311312.0, 1015.0, "7Series"),
- Row(2843881.0, 1229.0, "6Series"),
- Row(3077303.0, 1717.0, "5Series"),
- Row(3454331.0, 2734.0, "5Series"),
- Row(23250.0, 2745.0, "3Series"),
- Row(3278167.0, 571.0, "9Series"),
- Row(9952232.0, 2553.0, "2Series"),
- Row(424923.0, 1077.0, "3Series"),
- Row(7839922.0, 1823.0, "9Series"),
- Row(9500486.0, 2399.0, "3Series"),
- Row(1952050.0, 2890.0, "0Series"),
- Row(7768468.0, 29.0, "2Series"),
- Row(7236919.0, 1407.0, "2Series"),
- Row(167725.0, 845.0, "6Series"),
- Row(2651084.0, 1655.0, "2Series"),
- Row(6283156.0, 1368.0, "7Series"),
- Row(7342321.0, 1728.0, "7Series"),
- Row(1753823.0, 750.0, "6Series"),
- Row(5451533.0, 2288.0, "9Series"),
- Row(5403108.0, 2635.0, "5Series"),
- Row(168757.0, 1337.0, "4Series"),
- Row(9394732.0, 2478.0, "3Series"),
- Row(4358621.0, 1407.0, "6Series"),
- Row(2362114.0, 2952.0, "9Series"),
- Row(9318234.0, 1226.0, "2Series"),
- Row(5565240.0, 865.0, "6Series"),
- Row(3166724.0, 901.0, "0Series"),
- Row(5592457.0, 1864.0, "6Series"),
- Row(7575196.0, 572.0, "4Series"),
- Row(4202614.0, 1567.0, "0Series"),
- Row(2199957.0, 1973.0, "0Series"),
- Row(511128.0, 448.0, "4Series"),
- Row(580612.0, 2488.0, "4Series"),
- Row(275342.0, 907.0, "6Series"),
- Row(3215327.0, 2507.0, "3Series"),
- Row(8069859.0, 732.0, "0Series"),
- Row(6383562.0, 2077.0, "3Series"),
- Row(6428516.0, 1434.0, "2Series"),
- Row(5159121.0, 1098.0, "4Series"),
- Row(3360388.0, 813.0, "5Series"),
- Row(5152985.0, 954.0, "9Series"),
- Row(3335480.0, 613.0, "5Series"),
- Row(994815.0, 2348.0, "5Series"),
- Row(507229.0, 2192.0, "0Series"),
- Row(8976568.0, 2826.0, "0Series")
+ "select imei,gamePointId, channelsId,series from Carbon_automation_test2 where " +
+ "channelsId BETWEEN 4 AND 5 ORDER BY gamePointId limit 5"
+ ), sql(
+ "select imei,gamePointId, channelsId,series from Carbon_automation_hive2 where " +
+ "channelsId BETWEEN 4 AND 5 ORDER BY gamePointId limit 5"
)
+
)
}
)
- //TC_202
+ //TC_252
test(
- "select contractNumber,gamePointId,series from Carbon_automation_test2 where series " +
- "!='8Series' and internalModels !='8Internal models'"
+ "select imei,gamePointId, channelsId,series from Carbon_automation_test2 where channelsId " +
+ "NOT BETWEEN 4 AND 5 ORDER BY gamePointId limit 5"
)({
checkAnswer(
sql(
- "select contractNumber,gamePointId,series from Carbon_automation_test2 where series " +
- "!='8Series' and internalModels !='8Internal models'"
- ),
- Seq(Row(5281803.0, 2738.562, "7Series"),
- Row(6805600.0, 1714.635, "7Series"),
- Row(8231335.0, 1271.0, "5Series"),
- Row(8978765.0, 692.0, "5Series"),
- Row(3784858.0, 2175.0, "7Series"),
- Row(1602458.0, 136.0, "9Series"),
- Row(9737768.0, 1600.0, "7Series"),
- Row(2919786.0, 505.0, "0Series"),
- Row(9455612.0, 1341.0, "0Series"),
- Row(1439363.0, 2970.0, "4Series"),
- Row(3940720.0, 2593.0, "1Series"),
- Row(4451217.0, 2572.0, "6Series"),
- Row(2389657.0, 1841.0, "0Series"),
- Row(5986189.0, 298.0, "2Series"),
- Row(8543280.0, 79.0, "3Series"),
- Row(4816260.0, 202.0, "0Series"),
- Row(8453995.0, 568.0, "4Series"),
- Row(2051539.0, 355.0, "1Series"),
- Row(7610075.0, 151.0, "5Series"),
- Row(6663091.0, 2863.0, "4Series"),
- Row(6495292.0, 1873.0, "3Series"),
- Row(2611464.0, 2205.0, "9Series"),
- Row(4459076.0, 2194.0, "5Series"),
- Row(5204739.0, 2972.0, "0Series"),
- Row(566917.0, 1778.0, "0Series"),
- Row(832387.0, 1999.0, "5Series"),
- Row(2850246.0, 2194.0, "5Series"),
- Row(6169467.0, 2483.0, "6Series"),
- Row(7487134.0, 1768.0, "7Series"),
- Row(4750239.0, 2436.0, "0Series"),
- Row(8880112.0, 2849.0, "5Series"),
- Row(7774590.0, 1691.0, "2Series"),
- Row(5586718.0, 2071.0, "7Series"),
- Row(5857263.0, 1333.0, "7Series"),
- Row(6416074.0, 1080.0, "7Series"),
- Row(6994063.0, 1053.0, "1Series"),
- Row(5797079.0, 2061.0, "2Series"),
- Row(6283062.0, 2142.0, "5Series"),
- Row(8431770.0, 2224.0, "5Series"),
- Row(3311312.0, 1015.0, "7Series"),
- Row(2843881.0, 1229.0, "6Series"),
- Row(3077303.0, 1717.0, "5Series"),
- Row(3454331.0, 2734.0, "5Series"),
- Row(23250.0, 2745.0, "3Series"),
- Row(3278167.0, 571.0, "9Series"),
- Row(9952232.0, 2553.0, "2Series"),
- Row(424923.0, 1077.0, "3Series"),
- Row(1952050.0, 2890.0, "0Series"),
- Row(7768468.0, 29.0, "2Series"),
- Row(167725.0, 845.0, "6Series"),
- Row(2651084.0, 1655.0, "2Series"),
- Row(6283156.0, 1368.0, "7Series"),
- Row(1753823.0, 750.0, "6Series"),
- Row(5451533.0, 2288.0, "9Series"),
- Row(5403108.0, 2635.0, "5Series"),
- Row(168757.0, 1337.0, "4Series"),
- Row(9394732.0, 2478.0, "3Series"),
- Row(4358621.0, 1407.0, "6Series"),
- Row(2362114.0, 2952.0, "9Series"),
- Row(5565240.0, 865.0, "6Series"),
- Row(3166724.0, 901.0, "0Series"),
- Row(5592457.0, 1864.0, "6Series"),
- Row(7575196.0, 572.0, "4Series"),
- Row(4202614.0, 1567.0, "0Series"),
- Row(2199957.0, 1973.0, "0Series"),
- Row(511128.0, 448.0, "4Series"),
- Row(580612.0, 2488.0, "4Series"),
- Row(275342.0, 907.0, "6Series"),
- Row(3215327.0, 2507.0, "3Series"),
- Row(8069859.0, 732.0, "0Series"),
- Row(6383562.0, 2077.0, "3Series"),
- Row(6428516.0, 1434.0, "2Series"),
- Row(5159121.0, 1098.0, "4Series"),
- Row(3360388.0, 813.0, "5Series"),
- Row(5152985.0, 954.0, "9Series"),
- Row(3335480.0, 613.0, "5Series"),
- Row(994815.0, 2348.0, "5Series"),
- Row(507229.0, 2192.0, "0Series"),
- Row(8976568.0, 2826.0, "0Series")
+ "select imei,gamePointId, channelsId,series from Carbon_automation_test2 where " +
+ "channelsId NOT BETWEEN 4 AND 5 ORDER BY gamePointId limit 5"
+ ), sql(
+ "select imei,gamePointId, channelsId,series from Carbon_automation_hive2 where " +
+ "channelsId NOT BETWEEN 4 AND 5 ORDER BY gamePointId limit 5"
)
+
)
}
)
- //TC_203
+ //TC_253
test(
- "select contractNumber,gamePointId,series from Carbon_automation_test2 where series " +
- "!='8Series' or internalModels !='8Internal models'"
+ "select imei,gamePointId, channelsId,series from Carbon_automation_test2 where channelsId " +
+ "LIKE 4 ORDER BY gamePointId limit 5"
)({
checkAnswer(
sql(
- "select contractNumber,gamePointId,series from Carbon_automation_test2 where series " +
- "!='8Series' or internalModels !='8Internal models'"
- ),
- Seq(Row(5281803.0, 2738.562, "7Series"),
- Row(6805600.0, 1714.635, "7Series"),
- Row(8231335.0, 1271.0, "5Series"),
- Row(8978765.0, 692.0, "5Series"),
- Row(3784858.0, 2175.0, "7Series"),
- Row(1602458.0, 136.0, "9Series"),
- Row(9737768.0, 1600.0, "7Series"),
- Row(2919786.0, 505.0, "0Series"),
- Row(9455612.0, 1341.0, "0Series"),
- Row(88231.0, 2239.0, "5Series"),
- Row(1439363.0, 2970.0, "4Series"),
- Row(3940720.0, 2593.0, "1Series"),
- Row(4451217.0, 2572.0, "6Series"),
- Row(335583.0, 1991.0, "9Series"),
- Row(2389657.0, 1841.0, "0Series"),
- Row(5986189.0, 298.0, "2Series"),
- Row(8543280.0, 79.0, "3Series"),
- Row(4816260.0, 202.0, "0Series"),
- Row(8453995.0, 568.0, "4Series"),
- Row(2051539.0, 355.0, "1Series"),
- Row(7610075.0, 151.0, "5Series"),
- Row(6663091.0, 2863.0, "4Series"),
- Row(6495292.0, 1873.0, "3Series"),
- Row(2611464.0, 2205.0, "9Series"),
- Row(574375.0, 441.0, "8Series"),
- Row(4459076.0, 2194.0, "5Series"),
- Row(5204739.0, 2972.0, "0Series"),
- Row(833654.0, 256.0, "5Series"),
- Row(566917.0, 1778.0, "0Series"),
- Row(832387.0, 1999.0, "5Series"),
- Row(2850246.0, 2194.0, "5Series"),
- Row(6169467.0, 2483.0, "6Series"),
- Row(6533899.0, 1724.0, "0Series"),
- Row(7487134.0, 1768.0, "7Series"),
- Row(4750239.0, 2436.0, "0Series"),
- Row(8880112.0, 2849.0, "5Series"),
- Row(7774590.0, 1691.0, "2Series"),
- Row(5586718.0, 2071.0, "7Series"),
- Row(5857263.0, 1333.0, "7Series"),
- Row(6416074.0, 1080.0, "7Series"),
- Row(6994063.0, 1053.0, "1Series"),
- Row(8229807.0, 760.0, "8Series"),
- Row(5797079.0, 2061.0, "2Series"),
- Row(6283062.0, 2142.0, "5Series"),
- Row(8431770.0, 2224.0, "5Series"),
- Row(3311312.0, 1015.0, "7Series"),
- Row(2843881.0, 1229.0, "6Series"),
- Row(1901889.0, 1750.0, "8Series"),
- Row(3077303.0, 1717.0, "5Series"),
- Row(3454331.0, 2734.0, "5Series"),
- Row(23250.0, 2745.0, "3Series"),
- Row(3278167.0, 571.0, "9Series"),
- Row(5659107.0, 1697.0, "8Series"),
- Row(9952232.0, 2553.0, "2Series"),
- Row(424923.0, 1077.0, "3Series"),
- Row(7839922.0, 1823.0, "9Series"),
- Row(9500486.0, 2399.0, "3Series"),
- Row(1952050.0, 2890.0, "0Series"),
- Row(6190068.0, 1608.0, "8Series"),
- Row(7768468.0, 29.0, "2Series"),
- Row(7236919.0, 1407.0, "2Series"),
- Row(167725.0, 845.0, "6Series"),
- Row(2651084.0, 1655.0, "2Series"),
- Row(6283156.0, 1368.0, "7Series"),
- Row(7342321.0, 1728.0, "7Series"),
- Row(1753823.0, 750.0, "6Series"),
- Row(5451533.0, 2288.0, "9Series"),
- Row(5403108.0, 2635.0, "5Series"),
- Row(168757.0, 1337.0, "4Series"),
- Row(9394732.0, 2478.0, "3Series"),
- Row(7420815.0, 538.0, "8Series"),
- Row(4358621.0, 1407.0, "6Series"),
- Row(2362114.0, 2952.0, "9Series"),
- Row(9318234.0, 1226.0, "2Series"),
- Row(5565240.0, 865.0, "6Series"),
- Row(3166724.0, 901.0, "0Series"),
- Row(5592457.0, 1864.0, "6Series"),
- Row(7575196.0, 572.0, "4Series"),
- Row(3235086.0, 412.0, "8Series"),
- Row(7917206.0, 1491.0, "8Series"),
- Row(4156339.0, 1350.0, "8Series"),
- Row(4202614.0, 1567.0, "0Series"),
- Row(2199957.0, 1973.0, "0Series"),
- Row(511128.0, 448.0, "4Series"),
- Row(580612.0, 2488.0, "4Series"),
- Row(275342.0, 907.0, "6Series"),
- Row(3215327.0, 2507.0, "3Series"),
- Row(8069859.0, 732.0, "0Series"),
- Row(6383562.0, 2077.0, "3Series"),
- Row(6428516.0, 1434.0, "2Series"),
- Row(5159121.0, 1098.0, "4Series"),
- Row(3360388.0, 813.0, "5Series"),
- Row(5152985.0, 954.0, "9Series"),
- Row(3335480.0, 613.0, "5Series"),
- Row(994815.0, 2348.0, "5Series"),
- Row(507229.0, 2192.0, "0Series"),
- Row(8976568.0, 2826.0, "0Series")
+ "select imei,gamePointId, channelsId,series from Carbon_automation_test2 where " +
+ "channelsId LIKE 4 ORDER BY gamePointId limit 5"
+ ), sql(
+ "select imei,gamePointId, channelsId,series from Carbon_automation_hive2 where " +
+ "channelsId LIKE 4 ORDER BY gamePointId
<TRUNCATED>
|