You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@carbondata.apache.org by ra...@apache.org on 2016/12/11 04:04:17 UTC

[1/2] incubator-carbondata git commit: improved integration test-case for AllDataTypesTestCase3

Repository: incubator-carbondata
Updated Branches:
  refs/heads/master 26e3e0023 -> a0714f511


improved integration test-case for AllDataTypesTestCase3


Project: http://git-wip-us.apache.org/repos/asf/incubator-carbondata/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-carbondata/commit/bbe43da6
Tree: http://git-wip-us.apache.org/repos/asf/incubator-carbondata/tree/bbe43da6
Diff: http://git-wip-us.apache.org/repos/asf/incubator-carbondata/diff/bbe43da6

Branch: refs/heads/master
Commit: bbe43da625f91ffefb4cb1316849e444e79301b8
Parents: 26e3e00
Author: anubhav100 <an...@knoldus.in>
Authored: Thu Nov 24 13:40:10 2016 +0530
Committer: ravipesala <ra...@gmail.com>
Committed: Sun Dec 11 09:33:06 2016 +0530

----------------------------------------------------------------------
 .../allqueries/AllDataTypesTestCase3.scala      | 776 ++++++++++++++-----
 1 file changed, 565 insertions(+), 211 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-carbondata/blob/bbe43da6/integration-testcases/src/test/scala/org/apache/spark/testsuite/allqueries/AllDataTypesTestCase3.scala
----------------------------------------------------------------------
diff --git a/integration-testcases/src/test/scala/org/apache/spark/testsuite/allqueries/AllDataTypesTestCase3.scala b/integration-testcases/src/test/scala/org/apache/spark/testsuite/allqueries/AllDataTypesTestCase3.scala
index 9937bb9..a3ee3f0 100644
--- a/integration-testcases/src/test/scala/org/apache/spark/testsuite/allqueries/AllDataTypesTestCase3.scala
+++ b/integration-testcases/src/test/scala/org/apache/spark/testsuite/allqueries/AllDataTypesTestCase3.scala
@@ -1,3 +1,5 @@
+
+
 /*
  * Licensed to the Apache Software Foundation (ASF) under one
  * or more contributor license agreements.  See the NOTICE file
@@ -21,11 +23,10 @@ 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.{NonRunningTests, QueryTest}
-
-import org.apache.carbondata.core.util.CarbonProperties
 import org.scalatest.BeforeAndAfterAll
 
 /**
@@ -39,49 +40,94 @@ class AllDataTypesTestCase3 extends QueryTest with BeforeAndAfterAll {
     val currentDirectory = new File(this.getClass.getResource("/").getPath + "/../../")
       .getCanonicalPath
     CarbonProperties.getInstance().addProperty("carbon.direct.surrogate", "false")
+
     try {
       sql(
-        "create table Carbon_automation_test3 (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_EXCLUDE'='Latest_MONTH," +
-        "deviceInformationId')")
+        "create table if not exists traffic_2g_3g_4g (source_info string , app_category_id string" +
+          " ,app_category_name string ,app_sub_category_id string , app_sub_category_name string ," +
+          "rat_name string ,imsi string ,offer_msisdn string , offer_id string ,offer_option_1 " +
+          "string ,offer_option_2 string ,offer_option_3 string , msisdn string ,package_type " +
+          "string ,package_price string ,tag_imsi string ,tag_msisdn string ,province string ,city " +
+          "string ,area_code string ,tac string ,imei string , terminal_type string ,terminal_brand" +
+          " string ,terminal_model string ,price_level string  ,network string ,shipped_os string ," +
+          "wifi string ,wifi_hotspot string ,gsm string , wcdma string ,td_scdma string ,lte_fdd " +
+          "string ,lte_tdd string ,cdma string , screen_size string ,screen_resolution string ," +
+          "host_name string ,website_name string , operator string ,srv_type_name string ,tag_host " +
+          "string ,cgi string ,cell_name string , coverity_type1 string ,coverity_type2 string ," +
+          "coverity_type3 string ,coverity_type4  string ,coverity_type5 string ,latitude string ," +
+          "longitude string ,azimuth string , tag_cgi string ,apn string ,user_agent string ,day " +
+          "string ,hour string ,`min` string , is_default_bear int ,eps_bearer_id string ,qci int ," +
+          "user_filter string , analysis_period string, up_throughput decimal,down_throughput " +
+          "decimal, up_pkt_num decimal,down_pkt_num decimal,app_request_num decimal," +
+          "pkt_num_len_1_64  decimal,pkt_num_len_64_128 decimal,pkt_num_len_128_256 decimal," +
+          "pkt_num_len_256_512  decimal,pkt_num_len_512_768 decimal,pkt_num_len_768_1024 decimal," +
+          "pkt_num_len_1024_all  decimal,ip_flow_mark decimal)" +
+          " stored by 'org.apache.carbondata.format'")
+    }
+    catch {
+      case e: Exception => print("ERROR : " + e.getMessage)
+    }
+    try {
       sql("LOAD DATA LOCAL INPATH '" + currentDirectory +
-          "/src/test/resources/100_olap.csv' INTO table Carbon_automation_test3 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 myvmallTest (imei String,uuid String,MAC String,device_color String," +
+        "/src/test/resources/FACT_UNITED_DATA_INFO_sample_table.csv ' INTO table traffic_2g_3g_4g OPTIONS" +
+        "('DELIMITER'= ',' ,'QUOTECHAR'= '\"', 'FILEHEADER'= 'source_info,app_category_id,app_category_name,app_sub_category_name " +
+        "rat_name,imsi,offer_msisdn,offer_id,offer_option_1,offer_option_2,offer_option_3, msisdn," +
+        "package_type ,package_price,tag_imsi,tag_msisdn,province,city,area_code," +
+        "tac,imei,terminal_type,terminal_brand,terminal_model," +
+        "price_level,network,shipped_os,wifi,wifi_hotspot,gsm," +
+        "wcdma,td_scdma,lte_fdd,lte_tdd," +
+        "cdma,screen_size,screen_resolution," +
+        "host_name,website_name," +
+        "operator,srv_type_name,tag_host,cgi,cell_name," +
+        "coverity_type1,coverity_type2,coverity_type3,coverity_type4,coverity_type5," +
+        "latitude,longitude,azimuth, tag_cgi," +
+        "apn ,user_agent ,day,hour,`min`,is_default_bear,eps_bearer_id ,qci,user_filter,analysis_period," +
+        "up_throughput,down_throughput,up_pkt_num,down_pkt_num,app_request_num,pkt_num_len_1_64,pkt_num_len_64_128," +
+        "pkt_num_len_128_256,pkt_num_len_256_512 ,pkt_num_len_512_768,pkt_num_len_768_1024,pkt_num_len_1024_all,ip_flow_mark')")
+
+    }
+    catch {
+      case e: Exception => //print("ERROR : " + e.getMessage)
+    }
+    try {
+
+      sql(
+        "create table if not exists traffic_2g_3g_4g_hive(source_info string , app_category_id string" +
+          " ,app_category_name string ,app_sub_category_id string , app_sub_category_name string ," +
+          "rat_name string ,imsi string ,offer_msisdn string , offer_id string ,offer_option_1 " +
+          "string ,offer_option_2 string ,offer_option_3 string , msisdn string ,package_type " +
+          "string ,package_price string ,tag_imsi string ,tag_msisdn string ,province string ,city " +
+          "string ,area_code string ,tac string ,imei string , terminal_type string ,terminal_brand" +
+          " string ,terminal_model string ,price_level string  ,network string ,shipped_os string ," +
+          "wifi string ,wifi_hotspot string ,gsm string , wcdma string ,td_scdma string ,lte_fdd " +
+          "string ,lte_tdd string ,cdma string , screen_size string ,screen_resolution string ," +
+          "host_name string ,website_name string , operator string ,srv_type_name string ,tag_host " +
+          "string ,cgi string ,cell_name string , coverity_type1 string ,coverity_type2 string ," +
+          "coverity_type3 string ,coverity_type4  string ,coverity_type5 string ,latitude string ," +
+          "longitude string ,azimuth string , tag_cgi string ,apn string ,user_agent string ,day " +
+          "string ,hour string ,`min` string , is_default_bear int ,eps_bearer_id string ,qci int ," +
+          "user_filter string , analysis_period string, up_throughput decimal,down_throughput " +
+          "decimal, up_pkt_num decimal,down_pkt_num decimal,app_request_num decimal," +
+          "pkt_num_len_1_64  decimal,pkt_num_len_64_128 decimal,pkt_num_len_128_256 decimal," +
+          "pkt_num_len_256_512  decimal,pkt_num_len_512_768 decimal,pkt_num_len_768_1024 decimal," +
+          "pkt_num_len_1024_all  decimal,ip_flow_mark decimal " +
+          ") row format delimited fields terminated by ','")
+    }
+    catch {
+      case e: Exception => print("ERROR : " + e.getMessage)
+    }
+    try {
+      sql(
+        "LOAD DATA local inpath'" + currentDirectory + "/src/test/resources/FACT_UNITED_DATA_INFO_sample_table.csv'" +
+          " overwrite INTO table traffic_2g_3g_4g_hive")
+    }
+    catch {
+      case e: Exception => print("ERROR " + e.getMessage)
+    }
+
+    try {
+
+      sql("create table if not exists myvmallTest(imei String,uuid String,MAC String,device_color String," +
         "device_shell_color String,device_name String,product_name String,ram String,rom  String," +
         "cpu_clock String,series String,check_date String,check_month int , check_day int," +
         "check_hour int,bom String,inside_name String,packing_date  String,packing_year String," +
@@ -98,76 +144,166 @@ class AllDataTypesTestCase3 extends QueryTest with BeforeAndAfterAll {
         "String,Latest_os_version String,Latest_network String,site String, site_desc String," +
         "product String,product_desc String,check_year int) " +
         "stored by 'org.apache.carbondata.format'")
+
+    }
+    catch {
+      case e: Exception => print("ERROR : " + e.getMessage)
+    }
+    try {
       sql("LOAD DATA LOCAL INPATH '" + currentDirectory +
-          "/src/test/resources/100_VMALL_1_Day_DATA_2015-09-15.csv' INTO table myvmallTest " +
-          "OPTIONS('DELIMITER'= ',' ,'QUOTECHAR'= '\"', 'FILEHEADER'= 'imei,uuid,MAC," +
-          "device_color,device_shell_color,device_name,product_name,ram,rom,cpu_clock,series," +
-          "check_date,check_year,check_month,check_day,check_hour,bom,inside_name,packing_date," +
-          "packing_year,packing_month,packing_day,packing_hour,customer_name,deliveryAreaId," +
-          "deliveryCountry,deliveryProvince,deliveryCity,deliveryDistrict,packing_list_no," +
-          "order_no,Active_check_time,Active_check_year,Active_check_month,Active_check_day," +
-          "Active_check_hour,ActiveAreaId,ActiveCountry,ActiveProvince,Activecity,ActiveDistrict," +
-          "Active_network,Active_firmware_version,Active_emui_version,Active_os_version," +
-          "Latest_check_time,Latest_check_year,Latest_check_month,Latest_check_day," +
-          "Latest_check_hour,Latest_areaId,Latest_country,Latest_province,Latest_city," +
-          "Latest_district,Latest_firmware_version,Latest_emui_version,Latest_os_version," +
-          "Latest_network,site,site_desc,product,product_desc')")
+        "/src/test/resources/100_VMALL_1_Day_DATA_2015-09-15.csv' INTO table myvmallTest " +
+        "OPTIONS('DELIMITER'= ',' ,'QUOTECHAR'= '\"', 'FILEHEADER'= 'imei,uuid,MAC," +
+        "device_color,device_shell_color,device_name,product_name,ram,rom,cpu_clock,series," +
+        "check_date,check_month,check_day,check_hour,bom,inside_name,packing_date," +
+        "packing_year,packing_month,packing_day,packing_hour,customer_name,deliveryAreaId," +
+        "deliveryCountry,deliveryProvince,deliveryCity,deliveryDistrict,packing_list_no," +
+        "order_no,Active_check_time,Active_check_year,Active_check_month,Active_check_day," +
+        "Active_check_hour,ActiveAreaId,ActiveCountry,ActiveProvince,Activecity,ActiveDistrict," +
+        "Active_network,Active_firmware_version,Active_emui_version,Active_os_version," +
+        "Latest_check_time,Latest_check_year,Latest_check_month,Latest_check_day," +
+        "Latest_check_hour,Latest_areaId,Latest_country,Latest_province,Latest_city," +
+        "Latest_district,Latest_firmware_version,Latest_emui_version,Latest_os_version," +
+        "Latest_network,site,site_desc,product,product_desc,check_year')")
+    }
+    catch {
+      case e: Exception => print("ERROR : " + e.getMessage)
+    }
+    try {
 
       sql(
-        "create table if not exists traffic_2g_3g_4g (source_info string , app_category_id string" +
-        " ,app_category_name string ,app_sub_category_id string , app_sub_category_name string ," +
-        "rat_name string ,imsi string ,offer_msisdn string , offer_id string ,offer_option_1 " +
-        "string ,offer_option_2 string ,offer_option_3 string , msisdn string ,package_type " +
-        "string ,package_price string ,tag_imsi string ,tag_msisdn string ,province string ,city " +
-        "string ,area_code string ,tac string ,imei string , terminal_type string ,terminal_brand" +
-        " string ,terminal_model string ,price_level string  ,network string ,shipped_os string ," +
-        "wifi string ,wifi_hotspot string ,gsm string , wcdma string ,td_scdma string ,lte_fdd " +
-        "string ,lte_tdd string ,cdma string , screen_size string ,screen_resolution string ," +
-        "host_name string ,website_name string , operator string ,srv_type_name string ,tag_host " +
-        "string ,cgi string ,cell_name string , coverity_type1 string ,coverity_type2 string ," +
-        "coverity_type3 string ,coverity_type4  string ,coverity_type5 string ,latitude string ," +
-        "longitude string ,azimuth string , tag_cgi string ,apn string ,user_agent string ,day " +
-        "string ,hour string ,`min` string , is_default_bear int ,eps_bearer_id string ,qci int ," +
-        "user_filter string , analysis_period string, up_throughput decimal,down_throughput " +
-        "decimal, up_pkt_num decimal,down_pkt_num decimal,app_request_num decimal," +
-        "pkt_num_len_1_64  decimal,pkt_num_len_64_128 decimal,pkt_num_len_128_256 decimal," +
-        "pkt_num_len_256_512  decimal,pkt_num_len_512_768 decimal,pkt_num_len_768_1024 decimal," +
-        "pkt_num_len_1024_all  decimal,ip_flow_mark decimal)" +
-        " stored by 'org.apache.carbondata.format'")
-
-      sql("LOAD DATA LOCAL INPATH '" + currentDirectory +
-        "/src/test/resources/FACT_UNITED_DATA_INFO_sample_table.csv' INTO table traffic_2g_3g_4g " +
-        "OPTIONS('DELIMITER'= ',' ,'QUOTECHAR'= '\"', 'FILEHEADER'= '')")
+        "create table if not exists myvmall_hiveTest(imei String,uuid String,MAC String,device_color String," +
+          "device_shell_color String,device_name String,product_name String,ram String,rom  String," +
+          "cpu_clock String,series String,check_date String,check_month int , check_day int," +
+          "check_hour int,bom String,inside_name String,packing_date  String,packing_year String," +
+          "packing_month String,packing_day String,packing_hour String,customer_name String," +
+          "deliveryAreaId String,deliveryCountry String, deliveryProvince String,deliveryCity " +
+          "String,deliveryDistrict String,packing_list_no String,order_no String,Active_check_time " +
+          "String,Active_check_year int, Active_check_month int,Active_check_day int," +
+          "Active_check_hour int, ActiveAreaId String,ActiveCountry String,ActiveProvince String," +
+          "Activecity String, ActiveDistrict String,Active_network String,Active_firmware_version " +
+          "String, Active_emui_version String,Active_os_version String,Latest_check_time String, " +
+          "Latest_check_year int,Latest_check_month int,Latest_check_day int, Latest_check_hour " +
+          "int,Latest_areaId String,Latest_country String,Latest_province  String,Latest_city " +
+          "String,Latest_district String,Latest_firmware_version String, Latest_emui_version " +
+          "String,Latest_os_version String,Latest_network String,site String, site_desc String," +
+          "product String,product_desc String,check_year String " +
+          ") row format delimited fields terminated by ','")
+    }
+    catch {
+      case e: Exception => print("ERROR : " + e.getMessage)
+    }
+    try {
+      sql(
+        "LOAD DATA local inpath'" + currentDirectory + "/src/test/resources/100_VMALL_1_Day_DATA_2015-09-15.csv'" +
+          " overwrite INTO table myvmall_hiveTest")
+    }
+    catch {
+      case e: Exception => print("ERROR : " + e.getMessage)
+    }
+    try {
+      sql(
+        "create table if not exists hiveTest(imei String,uuid String,MAC String,device_color String," +
+          "device_shell_color String,device_name String,product_name String,ram String,rom  String," +
+          "cpu_clock String,series String,check_date String,check_month int , check_day int," +
+          "check_hour int,bom String,inside_name String,packing_date String,packing_year String," +
+          "packing_month String,packing_day String,packing_hour String,customer_name String," +
+          "deliveryAreaId String,deliveryCountry String, deliveryProvince String,deliveryCity " +
+          "String,deliveryDistrict String,packing_list_no String,order_no String,Active_check_time " +
+          "String,Active_check_year int, Active_check_month int,Active_check_day int," +
+          "Active_check_hour int, ActiveAreaId String,ActiveCountry String,ActiveProvince String," +
+          "Activecity String, ActiveDistrict String,Active_network String,Active_firmware_version " +
+          "String, Active_emui_version String,Active_os_version String,Latest_check_time String, " +
+          "Latest_check_year int,Latest_check_month int,Latest_check_day int, Latest_check_hour " +
+          "int,Latest_areaId String,Latest_country String,Latest_province  String,Latest_city " +
+          "String,Latest_district String,Latest_firmware_version String, Latest_emui_version " +
+          "String,Latest_os_version String,Latest_network String,site String, site_desc String," +
+          "product_desc String,product String " +
+          ") row format delimited fields terminated by ','" )
+    }
+    catch {
+      case e: Exception => print("ERROR " + e.getMessage)
+    }
 
+    try {
       sql(
-        "create table hivetable(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, " +
+        "create table Carbon_automation_test3 (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, " +
+          "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_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 ','"
-      )
+          "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_test3 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')")
+    }
+    catch {
+      case e: Exception => print("ERROR in carbon_automation: " + e.getMessage)
+
 
+    }
+    try {
       sql(
-        "LOAD DATA local inpath'" + currentDirectory + "/src/test/resources/100_olap.csv'" +
-          " overwrite INTO table hivetable"
+        "create table if not exists hivetable(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 ','"
       )
-
+    }
+    try {
+      sql("LOAD DATA LOCAL INPATH '" + currentDirectory + "/src/test/resources/100_olap.csv' INTO " +
+        "table hivetable ")
     } catch {
       case e: Exception => print("ERROR : " + e.getMessage)
     }
@@ -176,13 +312,19 @@ class AllDataTypesTestCase3 extends QueryTest with BeforeAndAfterAll {
 
   override def afterAll {
     try {
-      sql("drop table Carbon_automation_test3")
-      sql("drop table myvmallTest")
-      sql("drop table traffic_2g_3g_4g")
-      sql("drop table hivetable")
+
+      sql("drop table if exists Carbon_automation_test3")
+      sql("drop table if exists myvmallTest")
+      sql("drop table if exists hivetable")
+      sql("drop table if exists myvmall_hiveTest")
+      sql("drop table if exists traffic_2g_3g_4g")
+      sql("drop table if exists traffic_2g_3g_4g_hive")
+
+
     } catch {
       case e: Exception => print("ERROR : " + e.getMessage)
     }
+
   }
 
   //TC_222
@@ -194,8 +336,10 @@ class AllDataTypesTestCase3 extends QueryTest with BeforeAndAfterAll {
       sql(
         "select imei, Latest_DAY from Carbon_automation_test3 where Latest_DAY  LIKE " +
           "Latest_areaId AND  Latest_DAY  LIKE Latest_HOUR"
-      ),
-      Seq()
+      ), sql(
+        "select imei, Latest_DAY from hivetable where Latest_DAY  LIKE " +
+          "Latest_areaId AND  Latest_DAY  LIKE Latest_HOUR"
+      )
     )
   }
   )
@@ -209,8 +353,10 @@ class AllDataTypesTestCase3 extends QueryTest with BeforeAndAfterAll {
       sql(
         "select * from (select if( Latest_areaId=7,7,NULL) as babu,Latest_MONTH from " +
           "Carbon_automation_test3) qq where babu NOT LIKE   Latest_MONTH"
-      ),
-      Seq()
+      ), sql(
+        "select * from (select if( Latest_areaId=7,7,NULL) as babu,Latest_MONTH from " +
+          "hivetable) qq where babu NOT LIKE   Latest_MONTH"
+      )
     )
   }
   )
@@ -225,7 +371,8 @@ class AllDataTypesTestCase3 extends QueryTest with BeforeAndAfterAll {
         "select count(imei) ,series from Carbon_automation_test3 group by series having sum " +
           "(Latest_DAY) == 99"
       ),
-      Seq()
+      sql("select count(imei) ,series from hivetable group by series having sum " +
+        "(Latest_DAY) == 99")
     )
   }
   )
@@ -241,8 +388,11 @@ class AllDataTypesTestCase3 extends QueryTest with BeforeAndAfterAll {
         "SELECT AMSize, ActiveAreaId, SUM(gamePointId) AS Sum_gamePointId FROM (select * from " +
           "Carbon_automation_test3) SUB_QRY WHERE AMSize = \"\" GROUP BY AMSize, ActiveAreaId " +
           "ORDER BY AMSize ASC, ActiveAreaId ASC"
-      ),
-      Seq()
+      ), sql(
+        "SELECT AMSize, ActiveAreaId, SUM(gamePointId) AS Sum_gamePointId FROM (select * from " +
+          "hivetable) SUB_QRY WHERE AMSize = \"\" GROUP BY AMSize, ActiveAreaId " +
+          "ORDER BY AMSize ASC, ActiveAreaId ASC"
+      )
     )
   }
   )
@@ -260,8 +410,12 @@ class AllDataTypesTestCase3 extends QueryTest with BeforeAndAfterAll {
           "FROM (select * from Carbon_automation_test3) SUB_QRY WHERE gamePointId > 1.0E9 GROUP " +
           "BY ActiveCountry, ActiveDistrict, Activecity ORDER BY ActiveCountry ASC, " +
           "ActiveDistrict ASC, Activecity ASC"
-      ),
-      Seq()
+      ), sql(
+        "SELECT ActiveCountry, ActiveDistrict, Activecity, SUM(gamePointId) AS Sum_gamePointId " +
+          "FROM (select * from hivetable) SUB_QRY WHERE gamePointId > 1.0E9 GROUP " +
+          "BY ActiveCountry, ActiveDistrict, Activecity ORDER BY ActiveCountry ASC, " +
+          "ActiveDistrict ASC, Activecity ASC"
+      )
     )
   }
   )
@@ -276,8 +430,11 @@ class AllDataTypesTestCase3 extends QueryTest with BeforeAndAfterAll {
         "SELECT latest_year, latest_day, imei, gamepointid, deviceinformationid, series, imei, " +
           "deliverycity FROM (select * from Carbon_automation_test3) SUB_QRY WHERE deliverycity " +
           "IS NULL"
-      ),
-      Seq()
+      ), sql(
+        "SELECT latest_year, latest_day, imei, gamepointid, deviceinformationid, series, imei, " +
+          "deliverycity FROM (select * from hivetable) SUB_QRY WHERE deliverycity " +
+          "IS NULL"
+      )
     )
   }
   )
@@ -286,7 +443,7 @@ class AllDataTypesTestCase3 extends QueryTest with BeforeAndAfterAll {
   test("select  gamePointId from Carbon_automation_test3 where  modelId is  null")({
     checkAnswer(
       sql("select  gamePointId from Carbon_automation_test3 where  modelId is  null"),
-      Seq()
+      sql("select  gamePointId from hivetable where  modelId is  null")
     )
   }
   )
@@ -295,7 +452,7 @@ class AllDataTypesTestCase3 extends QueryTest with BeforeAndAfterAll {
   test("select  contractNumber from Carbon_automation_test3 where bomCode is  null")({
     checkAnswer(
       sql("select  contractNumber from Carbon_automation_test3 where bomCode is  null"),
-      Seq()
+      sql("select  contractNumber from hivetable where bomCode is  null")
     )
   }
   )
@@ -304,7 +461,7 @@ class AllDataTypesTestCase3 extends QueryTest with BeforeAndAfterAll {
   test("select  imei from Carbon_automation_test3 where AMSIZE is  null")({
     checkAnswer(
       sql("select  imei from Carbon_automation_test3 where AMSIZE is  null"),
-      Seq()
+      sql("select  imei from hivetable where AMSIZE is  null")
     )
   }
   )
@@ -313,7 +470,7 @@ class AllDataTypesTestCase3 extends QueryTest with BeforeAndAfterAll {
   test("select  bomCode from Carbon_automation_test3 where contractnumber is  null")({
     checkAnswer(
       sql("select  bomCode from Carbon_automation_test3 where contractnumber is  null"),
-      Seq()
+      sql("select  bomCode from hivetable where contractnumber is  null")
     )
   }
   )
@@ -322,7 +479,7 @@ class AllDataTypesTestCase3 extends QueryTest with BeforeAndAfterAll {
   test("select  latest_day from Carbon_automation_test3 where  modelId is  null")({
     checkAnswer(
       sql("select  latest_day from Carbon_automation_test3 where  modelId is  null"),
-      Seq()
+      sql("select  latest_day from hivetable where  modelId is  null")
     )
   }
   )
@@ -331,7 +488,7 @@ class AllDataTypesTestCase3 extends QueryTest with BeforeAndAfterAll {
   test("select  latest_day from Carbon_automation_test3 where  deviceinformationid is  null")({
     checkAnswer(
       sql("select  latest_day from Carbon_automation_test3 where  deviceinformationid is  null"),
-      Seq()
+      sql("select  latest_day from hivetable where  deviceinformationid is  null")
     )
   }
   )
@@ -340,7 +497,7 @@ class AllDataTypesTestCase3 extends QueryTest with BeforeAndAfterAll {
   test("select  deviceinformationid from Carbon_automation_test3 where  modelId is  null")({
     checkAnswer(
       sql("select  deviceinformationid from Carbon_automation_test3 where  modelId is  null"),
-      Seq()
+      sql("select  deviceinformationid from hivetable where  modelId is  null")
     )
   }
   )
@@ -353,8 +510,10 @@ class AllDataTypesTestCase3 extends QueryTest with BeforeAndAfterAll {
       sql(
         "select  deviceinformationid from Carbon_automation_test3 where  deviceinformationid is  " +
           "null"
-      ),
-      Seq()
+      ), sql(
+        "select  deviceinformationid from hivetable where  deviceinformationid is  " +
+          "null"
+      )
     )
   }
   )
@@ -362,8 +521,8 @@ class AllDataTypesTestCase3 extends QueryTest with BeforeAndAfterAll {
   //TC_417
   test("select  imei from Carbon_automation_test3 where  modelId is  null")({
     checkAnswer(
-      sql("select  imei from Carbon_automation_test3 where  modelId is  null"),
-      Seq()
+      sql("select  imei from Carbon_automation_test3  where  modelId is  null"),
+      sql("select  imei from hivetable  where  modelId is  null")
     )
   }
   )
@@ -372,7 +531,7 @@ class AllDataTypesTestCase3 extends QueryTest with BeforeAndAfterAll {
   test("select  imei from Carbon_automation_test3 where  deviceinformationid is  null")({
     checkAnswer(
       sql("select  imei from Carbon_automation_test3 where  deviceinformationid is  null"),
-      Seq()
+      sql("select  imei from hivetable where  deviceinformationid is  null")
     )
   }
   )
@@ -476,6 +635,7 @@ class AllDataTypesTestCase3 extends QueryTest with BeforeAndAfterAll {
   //TC_133
   test("select histogram_numeric(gamePointId,2)  as a from Carbon_automation_test3",
     NonRunningTests)({
+    pending
     validateResult(
       sql("select histogram_numeric(gamePointId,2)  as a from Carbon_automation_test3"),
       "TC_133.csv"
@@ -558,6 +718,7 @@ class AllDataTypesTestCase3 extends QueryTest with BeforeAndAfterAll {
   //TC_491
   test("select collect_set(gamePointId) from Carbon_automation_test3",
     NonRunningTests)({
+    pending
     validateResult(
       sql("select collect_set(gamePointId) from Carbon_automation_test3"),
       "TC_491.csv"
@@ -629,7 +790,19 @@ class AllDataTypesTestCase3 extends QueryTest with BeforeAndAfterAll {
           "Carbon_automation_test3.gamePointId ORDER BY Carbon_automation_test3.AMSize ASC, " +
           "Carbon_automation_test3.ActiveCountry ASC, Carbon_automation_test3.Activecity ASC"
       ),
-      Seq()
+      sql(
+        "SELECT hivetable.gamePointId AS gamePointId,hivetable.AMSize" +
+          " AS AMSize, hivetable.ActiveCountry AS ActiveCountry, " +
+          "hivetable.Activecity AS Activecity FROM ( SELECT AMSize,gamePointId, " +
+          "ActiveCountry, Activecity FROM (select * from hivetable) SUB_QRY ) " +
+          "hivetable INNER JOIN ( SELECT ActiveCountry, Activecity, AMSize FROM " +
+          "(select * from hivetable) SUB_QRY ) hivetable1 ON " +
+          "hivetable.AMSize = hivetable1.AMSize WHERE " +
+          "hivetable.AMSize IS NULL GROUP BY hivetable.AMSize, " +
+          "hivetable.ActiveCountry, hivetable.Activecity ," +
+          "hivetable.gamePointId ORDER BY hivetable.AMSize ASC, " +
+          "hivetable.ActiveCountry ASC, hivetable.Activecity ASC"
+      )
     )
   }
   )
@@ -662,7 +835,19 @@ class AllDataTypesTestCase3 extends QueryTest with BeforeAndAfterAll {
           "Carbon_automation_test3.gamePointId ORDER BY Carbon_automation_test3.AMSize ASC, " +
           "Carbon_automation_test3.ActiveCountry ASC, Carbon_automation_test3.Activecity ASC"
       ),
-      Seq()
+      sql(
+        "SELECT hivetable.gamePointId AS gamePointId,hivetable.AMSize" +
+          " AS AMSize, hivetable.ActiveCountry AS ActiveCountry, " +
+          "hivetable.Activecity AS Activecity FROM ( SELECT AMSize,gamePointId, " +
+          "ActiveCountry, Activecity FROM (select * from hivetable) SUB_QRY ) " +
+          "hivetable LEFT JOIN ( SELECT ActiveCountry, Activecity, AMSize FROM " +
+          "(select * from hivetable) SUB_QRY )hivetable1 ON " +
+          "hivetable.AMSize =hivetable1.AMSize WHERE " +
+          "hivetable.AMSize IS NULL GROUP BY hivetable.AMSize, " +
+          "hivetable.ActiveCountry, hivetable.Activecity ," +
+          "hivetable.gamePointId ORDER BY hivetable.AMSize ASC, " +
+          "hivetable.ActiveCountry ASC, hivetable.Activecity ASC"
+      )
     )
   }
   )
@@ -681,6 +866,7 @@ class AllDataTypesTestCase3 extends QueryTest with BeforeAndAfterAll {
       "ORDER BY Carbon_automation_test3.AMSize ASC, Carbon_automation_test3.ActiveCountry ASC, " +
       "Carbon_automation_test3.Activecity ASC", NonRunningTests
   )({
+    pending
     validateResult(sql(
       "SELECT Carbon_automation_test3.gamePointId AS gamePointId,Carbon_automation_test3.AMSize " +
         "AS AMSize, Carbon_automation_test3.ActiveCountry AS ActiveCountry, " +
@@ -727,7 +913,19 @@ class AllDataTypesTestCase3 extends QueryTest with BeforeAndAfterAll {
           "Carbon_automation_test3.gamePointId ORDER BY Carbon_automation_test3.AMSize ASC, " +
           "Carbon_automation_test3.ActiveCountry ASC, Carbon_automation_test3.Activecity ASC"
       ),
-      Seq()
+      sql(
+        "SELECT Carbon_automation_test3.gamePointId AS gamePointId,Carbon_automation_test3.AMSize" +
+          " AS AMSize, Carbon_automation_test3.ActiveCountry AS ActiveCountry, " +
+          "Carbon_automation_test3.Activecity AS Activecity FROM ( SELECT AMSize,gamePointId, " +
+          "ActiveCountry, Activecity FROM (select * from Carbon_automation_test3) SUB_QRY ) " +
+          "Carbon_automation_test3 RIGHT JOIN ( SELECT ActiveCountry, Activecity, AMSize FROM " +
+          "(select * from Carbon_automation_test3) SUB_QRY ) Carbon_automation_test31 ON " +
+          "Carbon_automation_test3.AMSize = Carbon_automation_test31.AMSize WHERE " +
+          "Carbon_automation_test3.AMSize IS NULL GROUP BY Carbon_automation_test3.AMSize, " +
+          "Carbon_automation_test3.ActiveCountry, Carbon_automation_test3.Activecity ," +
+          "Carbon_automation_test3.gamePointId ORDER BY Carbon_automation_test3.AMSize ASC, " +
+          "Carbon_automation_test3.ActiveCountry ASC, Carbon_automation_test3.Activecity ASC"
+      )
     )
   }
   )
@@ -743,24 +941,36 @@ class AllDataTypesTestCase3 extends QueryTest with BeforeAndAfterAll {
       "Carbon_automation_test31.AMSize WHERE Carbon_automation_test3.AMSize IS NULL GROUP BY " +
       "Carbon_automation_test3.AMSize, Carbon_automation_test3.ActiveCountry, " +
       "Carbon_automation_test3.Activecity ,Carbon_automation_test3.gamePointId ORDER BY " +
-      "Carbon_automation_test3.AMSize ASC, Carbon_automation_test3.ActiveCountry ASC, " +
+      "Carbon_automation_test3.AMSize ASC,hivetable.ActiveCountry ASC, " +
       "Carbon_automation_test3.Activecity ASC"
   )({
     checkAnswer(
       sql(
         "SELECT Carbon_automation_test3.gamePointId AS gamePointId,Carbon_automation_test3.AMSize" +
-          " AS AMSize, Carbon_automation_test3.ActiveCountry AS ActiveCountry, " +
+          " AS AMSize,Carbon_automation_test3.ActiveCountry AS ActiveCountry, " +
           "Carbon_automation_test3.Activecity AS Activecity FROM ( SELECT AMSize,gamePointId, " +
           "ActiveCountry, Activecity FROM (select * from Carbon_automation_test3) SUB_QRY ) " +
           "Carbon_automation_test3 FULL OUTER JOIN ( SELECT ActiveCountry, Activecity, AMSize " +
-          "FROM (select * from Carbon_automation_test3) SUB_QRY ) Carbon_automation_test31 ON " +
-          "Carbon_automation_test3.AMSize = Carbon_automation_test31.AMSize WHERE " +
+          "FROM (select * from Carbon_automation_test3) SUB_QRY )Carbon_automation_test31 ON " +
+          "Carbon_automation_test3.AMSize =Carbon_automation_test3.AMSize WHERE " +
           "Carbon_automation_test3.AMSize IS NULL GROUP BY Carbon_automation_test3.AMSize, " +
-          "Carbon_automation_test3.ActiveCountry, Carbon_automation_test3.Activecity ," +
+          "Carbon_automation_test3.ActiveCountry,Carbon_automation_test3.Activecity ," +
           "Carbon_automation_test3.gamePointId ORDER BY Carbon_automation_test3.AMSize ASC, " +
-          "Carbon_automation_test3.ActiveCountry ASC, Carbon_automation_test3.Activecity ASC"
+          "Carbon_automation_test3.ActiveCountry ASC,Carbon_automation_test3.Activecity ASC"
       ),
-      Seq()
+      sql(
+        "SELECT hivetable.gamePointId AS gamePointId,hivetable.AMSize" +
+          " AS AMSize,hivetable.ActiveCountry AS ActiveCountry, " +
+          "hivetable.Activecity AS Activecity FROM ( SELECT AMSize,gamePointId, " +
+          "ActiveCountry, Activecity FROM (select * from hivetable) SUB_QRY ) " +
+          "hivetable FULL OUTER JOIN ( SELECT ActiveCountry, Activecity, AMSize " +
+          "FROM (select * from hivetable) SUB_QRY )hivetable1 ON " +
+          "hivetable.AMSize =hivetable1.AMSize WHERE " +
+          "hivetable.AMSize IS NULL GROUP BY hivetable.AMSize, " +
+          "hivetable.ActiveCountry,hivetable.Activecity ," +
+          "hivetable.gamePointId ORDER BY hivetable.AMSize ASC, " +
+          "hivetable.ActiveCountry ASC,hivetable.Activecity ASC"
+      )
     )
   }
   )
@@ -793,11 +1003,24 @@ class AllDataTypesTestCase3 extends QueryTest with BeforeAndAfterAll {
           "Carbon_automation_test3.Activecity ORDER BY Carbon_automation_test3.AMSize ASC, " +
           "Carbon_automation_test3.ActiveCountry ASC, Carbon_automation_test3.Activecity ASC"
       ),
-      Seq()
+      sql(
+        "SELECT hivetable.AMSize AS AMSize, hivetable.ActiveCountry " +
+          "AS ActiveCountry, hivetable.Activecity AS Activecity, SUM" +
+          "(hivetable.gamePointId) AS Sum_gamePointId FROM ( SELECT AMSize, " +
+          "ActiveCountry, Activecity, gamePointId FROM (select * from hivetable) " +
+          "SUB_QRY ) hivetable INNER JOIN ( SELECT AMSize, ActiveCountry, " +
+          "Activecity, gamePointId FROM (select * from hivetable) SUB_QRY ) " +
+          "hivetable1 ON hivetable.gamePointId = " +
+          "hivetable1.gamePointId WHERE hivetable.AMSize IS NULL " +
+          "GROUP BY hivetable.AMSize, hivetable.ActiveCountry, " +
+          "hivetable.Activecity ORDER BY hivetable.AMSize ASC, " +
+          "hivetable.ActiveCountry ASC, hivetable.Activecity ASC"
+      )
     )
   }
   )
 
+
   //TC_760
   test(
     "SELECT Carbon_automation_test3.AMSize AS AMSize, Carbon_automation_test3.ActiveCountry AS " +
@@ -825,8 +1048,19 @@ class AllDataTypesTestCase3 extends QueryTest with BeforeAndAfterAll {
           "GROUP BY Carbon_automation_test3.AMSize, Carbon_automation_test3.ActiveCountry, " +
           "Carbon_automation_test3.Activecity ORDER BY Carbon_automation_test3.AMSize ASC, " +
           "Carbon_automation_test3.ActiveCountry ASC, Carbon_automation_test3.Activecity ASC"
-      ),
-      Seq()
+      ), sql(
+        "SELECT hivetable.AMSize AS AMSize, hivetable.ActiveCountry " +
+          "AS ActiveCountry, hivetable.Activecity AS Activecity, SUM" +
+          "(hivetable.gamePointId) AS Sum_gamePointId FROM ( SELECT AMSize, " +
+          "ActiveCountry, Activecity, gamePointId FROM (select * from hivetable) " +
+          "SUB_QRY ) hivetable LEFT JOIN ( SELECT AMSize, ActiveCountry, " +
+          "Activecity, gamePointId FROM (select * from hivetable) SUB_QRY ) " +
+          "hivetable1 ON hivetable.gamePointId = " +
+          "hivetable1.gamePointId WHERE hivetable.AMSize IS NULL " +
+          "GROUP BY hivetable.AMSize, hivetable.ActiveCountry, " +
+          "hivetable.Activecity ORDER BY hivetable.AMSize ASC, " +
+          "hivetable.ActiveCountry ASC, hivetable.Activecity ASC"
+      )
     )
   }
   )
@@ -859,26 +1093,43 @@ class AllDataTypesTestCase3 extends QueryTest with BeforeAndAfterAll {
           "Carbon_automation_test3.Activecity ORDER BY Carbon_automation_test3.AMSize ASC, " +
           "Carbon_automation_test3.ActiveCountry ASC, Carbon_automation_test3.Activecity ASC"
       ),
-      Seq()
+      sql(
+        "SELECT hivetable.AMSize AS AMSize, hivetable.ActiveCountry " +
+          "AS ActiveCountry,hivetable.Activecity AS Activecity, SUM" +
+          "(hivetable.gamePointId) AS Sum_gamePointId FROM ( SELECT AMSize, " +
+          "ActiveCountry, Activecity, gamePointId FROM (select * from hivetable) " +
+          "SUB_QRY ) hivetable FULL OUTER JOIN ( SELECT AMSize, ActiveCountry, " +
+          "Activecity, gamePointId FROM (select * from hivetable) SUB_QRY ) " +
+          "hivetable1 ON hivetable.gamePointId = " +
+          "hivetable1.gamePointId WHERE hivetable.AMSize IS NULL " +
+          "GROUP BY hivetable.AMSize, hivetable.ActiveCountry, " +
+          "hivetable.Activecity ORDER BY hivetable.AMSize ASC, " +
+          "hivetable.ActiveCountry ASC, hivetable.Activecity ASC"
+      )
     )
   }
   )
 
   //VMALL_Per_TC_003
   test(
+
     "SELECT product_name, count(distinct imei) DistinctCount_imei FROM (select * from " +
       "myvmallTest) SUB_QRY where product_name='Huawei4009' GROUP BY product_name ORDER BY  " +
       "product_name ASC"
   )({
+
+
     checkAnswer(
       sql(
         "SELECT product_name, count(distinct imei) DistinctCount_imei FROM (select * from " +
           "myvmallTest) SUB_QRY where product_name='Huawei4009' GROUP BY product_name ORDER BY  " +
           "product_name ASC"
-      ),
-      Seq(Row("Huawei4009", 1))
+      ), sql("SELECT product_name, count(distinct imei) DistinctCount_imei FROM (select * from " +
+        "myvmall_hiveTest) SUB_QRY where product_name='Huawei4009' GROUP BY product_name ORDER BY  " +
+        "product_name ASC")
     )
   }
+
   )
 
   //VMALL_Per_TC_010
@@ -891,7 +1142,11 @@ class AllDataTypesTestCase3 extends QueryTest with BeforeAndAfterAll {
         "select (t1.hnor4xi/t2.totalc)*100 from (select count (imei)  as hnor4xi from myvmallTest" +
           " where device_name=\"Honor2\")t1,(select count (imei) as totalc from myvmallTest)t2"
       ),
-      Seq(Row(0.0))
+      sql(
+        "select (t1.hnor4xi/t2.totalc)*100 from (select count (imei)  as hnor4xi from myvmall_hiveTest" +
+          " where device_name=\"Honor2\")t1,(select count (imei) as totalc from myvmall_hiveTest)t2"
+      )
+
     )
   }
   )
@@ -906,7 +1161,10 @@ class AllDataTypesTestCase3 extends QueryTest with BeforeAndAfterAll {
         "select count(imei) from (select DATEDIFF(from_unixtime(unix_timestamp()),packing_date) " +
           "mydates,imei from myvmallTest) sub where mydates<1000"
       ),
-      Seq(Row(1000))
+      sql(
+        "select count(imei) from (select DATEDIFF(from_unixtime(unix_timestamp()),packing_date) " +
+          "mydates,imei from myvmall_hiveTest) sub where mydates<1000"
+      )
     )
   }
   )
@@ -923,8 +1181,12 @@ class AllDataTypesTestCase3 extends QueryTest with BeforeAndAfterAll {
           "(Active_emui_version=\"EmotionUI_2.972\" and Latest_emui_version=\"EmotionUI_3" +
           ".863972\") OR (Active_emui_version=\"EmotionUI_2.843\" and " +
           "Latest_emui_version=\"EmotionUI_3.863843\")"
-      ),
-      Seq(Row(2))
+      ), sql(
+        "select count(imei)  DistinctCount_imei from myvmall_hiveTest where " +
+          "(Active_emui_version=\"EmotionUI_2.972\" and Latest_emui_version=\"EmotionUI_3" +
+          ".863972\") OR (Active_emui_version=\"EmotionUI_2.843\" and " +
+          "Latest_emui_version=\"EmotionUI_3.863843\")"
+      )
     )
   }
   )
@@ -940,8 +1202,11 @@ class AllDataTypesTestCase3 extends QueryTest with BeforeAndAfterAll {
         "select count(imei) as imeicount from myvmallTest where (Active_os_version='Android 4.4" +
           ".3' and Active_emui_version='EmotionUI_2.3')or (Active_os_version='Android 4.4.2' and " +
           "Active_emui_version='EmotionUI_2.2')"
-      ),
-      Seq(Row(2))
+      ), sql(
+        "select count(imei) as imeicount from myvmall_hiveTest where (Active_os_version='Android 4.4" +
+          ".3' and Active_emui_version='EmotionUI_2.3')or (Active_os_version='Android 4.4.2' and " +
+          "Active_emui_version='EmotionUI_2.2')"
+      )
     )
   }
   )
@@ -955,8 +1220,10 @@ class AllDataTypesTestCase3 extends QueryTest with BeforeAndAfterAll {
       sql(
         "SELECT product, count(distinct imei) DistinctCount_imei FROM (select * from myvmallTest)" +
           " SUB_QRY where product='SmartPhone_3998' GROUP BY product ORDER BY product ASC"
-      ),
-      Seq(Row("SmartPhone_3998", 1))
+      ), sql(
+        "SELECT product, count(distinct imei) DistinctCount_imei FROM (select * from myvmall_hiveTest)" +
+          " SUB_QRY where product='SmartPhone_3998' GROUP BY product ORDER BY product ASC"
+      )
     )
   }
   )
@@ -971,7 +1238,10 @@ class AllDataTypesTestCase3 extends QueryTest with BeforeAndAfterAll {
         "SELECT  imei,device_name DistinctCount_imei FROM (select * from    myvmallTest   ) " +
           "SUB_QRY where device_name='Honor63011'  and product_name='Huawei3011'"
       ),
-      Seq(Row("imeiA009863011", "Honor63011"))
+      sql(
+        "SELECT  imei,device_name DistinctCount_imei FROM (select * from    myvmall_hiveTest   ) " +
+          "SUB_QRY where device_name='Honor63011'  and product_name='Huawei3011'"
+      )
     )
   }
   )
@@ -986,8 +1256,10 @@ class AllDataTypesTestCase3 extends QueryTest with BeforeAndAfterAll {
         "SELECT  imei,device_name DistinctCount_imei FROM (select * from    myvmallTest   ) " +
           "SUB_QRY where imei='imeiA009863011' or imei='imeiA009863012'"
       ),
-      Seq(Row("imeiA009863011", "Honor63011"), Row("imeiA009863012", "Honor63012"))
-    )
+      sql(
+        "SELECT  imei,device_name DistinctCount_imei FROM (select * from    myvmall_hiveTest   ) " +
+          "SUB_QRY where imei='imeiA009863011' or imei='imeiA009863012'"
+      ))
   }
   )
 
@@ -1001,7 +1273,10 @@ class AllDataTypesTestCase3 extends QueryTest with BeforeAndAfterAll {
         "select product_name, count(distinct imei)  as imei_number from     myvmallTest    where " +
           "imei='imeiA009863017' group by product_name"
       ),
-      Seq(Row("Huawei3017", 1))
+      sql(
+        "select product_name, count(distinct imei)  as imei_number from     myvmall_hiveTest    where " +
+          "imei='imeiA009863017' group by product_name"
+      )
     )
   }
   )
@@ -1017,8 +1292,11 @@ class AllDataTypesTestCase3 extends QueryTest with BeforeAndAfterAll {
           " deliveryAreaId ='500280121000000_9863017' group by product_name order by imei_number " +
           "desc"
       ),
-      Seq(Row("Huawei3017", 1))
-    )
+      sql(
+        "select product_name, count(distinct imei)  as imei_number from     myvmall_hiveTest     where" +
+          " deliveryAreaId ='500280121000000_9863017' group by product_name order by imei_number " +
+          "desc"
+      ))
   }
   )
 
@@ -1031,8 +1309,10 @@ class AllDataTypesTestCase3 extends QueryTest with BeforeAndAfterAll {
       sql(
         "select deliveryCity, count(distinct imei)  as imei_number from     myvmallTest     where" +
           " deliveryCity='deliveryCity17' group by deliveryCity order by imei_number desc"
-      ),
-      Seq(Row("deliveryCity17", 2))
+      ), sql(
+        "select deliveryCity, count(distinct imei)  as imei_number from     myvmall_hiveTest     where" +
+          " deliveryCity='deliveryCity17' group by deliveryCity order by imei_number desc"
+      )
     )
   }
   )
@@ -1047,7 +1327,10 @@ class AllDataTypesTestCase3 extends QueryTest with BeforeAndAfterAll {
         "select device_color, count(distinct imei)  as imei_number from     myvmallTest     where" +
           " bom='51090576_63017' group by device_color order by imei_number desc"
       ),
-      Seq(Row("black3017", 1))
+      sql(
+        "select device_color, count(distinct imei)  as imei_number from     myvmall_hiveTest     where" +
+          " bom='51090576_63017' group by device_color order by imei_number desc"
+      )
     )
   }
   )
@@ -1062,7 +1345,10 @@ class AllDataTypesTestCase3 extends QueryTest with BeforeAndAfterAll {
         "select product_name, count(distinct imei)  as imei_number from     myvmallTest     where" +
           " product_name='Huawei3017' group by product_name order by imei_number desc"
       ),
-      Seq(Row("Huawei3017", 1))
+      sql(
+        "select product_name, count(distinct imei)  as imei_number from     myvmall_hiveTest     where" +
+          " product_name='Huawei3017' group by product_name order by imei_number desc"
+      )
     )
   }
   )
@@ -1077,8 +1363,10 @@ class AllDataTypesTestCase3 extends QueryTest with BeforeAndAfterAll {
         "select product_name, count(distinct imei)  as imei_number from     myvmallTest     where" +
           " deliveryprovince='Province_17' group by product_name order by imei_number desc"
       ),
-      Seq(Row("Huawei3017", 1), Row("Huawei3517", 1))
-    )
+      sql(
+        "select product_name, count(distinct imei)  as imei_number from     myvmall_hiveTest     where" +
+          " deliveryprovince='Province_17' group by product_name order by imei_number desc"
+      ))
   }
   )
 
@@ -1092,8 +1380,10 @@ class AllDataTypesTestCase3 extends QueryTest with BeforeAndAfterAll {
         "select rom,cpu_clock, count(distinct imei)  as imei_number from     myvmallTest     " +
           "where  deliveryprovince='Province_17' group by rom,cpu_clock order by imei_number desc"
       ),
-      Seq(Row("517_GB", "cpu_clock517", 1), Row("17_GB", "cpu_clock17", 1))
-    )
+      sql(
+        "select rom,cpu_clock, count(distinct imei)  as imei_number from     myvmall_hiveTest     " +
+          "where  deliveryprovince='Province_17' group by rom,cpu_clock order by imei_number desc"
+      ))
   }
   )
 
@@ -1109,8 +1399,11 @@ class AllDataTypesTestCase3 extends QueryTest with BeforeAndAfterAll {
           "imei='imeiA009863017' and deliveryareaid='500280121000000_9863017' group by uuid,mac," +
           "device_color"
       ),
-      Seq(Row("uuidA009863017", "MAC09863017", "black3017", 1))
-    )
+      sql(
+        "select uuid,mac,device_color,count(distinct imei) from    myvmall_hiveTest    where  " +
+          "imei='imeiA009863017' and deliveryareaid='500280121000000_9863017' group by uuid,mac," +
+          "device_color"
+      ))
   }
   )
 
@@ -1127,7 +1420,12 @@ class AllDataTypesTestCase3 extends QueryTest with BeforeAndAfterAll {
           "Active_firmware_version='H60-L01V100R001CHNC00B121SP0_863987' group by device_color " +
           "order by imei_number desc"
       ),
-      Seq(Row("black3987", 1))
+      sql(
+        "select device_color,count(distinct imei)as imei_number  from     myvmall_hiveTest   where " +
+          "product_name='Huawei3987' and " +
+          "Active_firmware_version='H60-L01V100R001CHNC00B121SP0_863987' group by device_color " +
+          "order by imei_number desc"
+      )
     )
   }
   )
@@ -1146,8 +1444,12 @@ class AllDataTypesTestCase3 extends QueryTest with BeforeAndAfterAll {
           "Active_firmware_version='H60-L01V100R001CHNC00B121SP0_863993' group by product_name," +
           "device_color order by imei_number desc"
       ),
-      Seq(Row("Huawei3993", "black3993", 1))
-    )
+      sql(
+        "select product_name,device_color, count(distinct imei) as imei_number from  myvmall_hiveTest " +
+          " where product_name='Huawei3993' and " +
+          "Active_firmware_version='H60-L01V100R001CHNC00B121SP0_863993' group by product_name," +
+          "device_color order by imei_number desc"
+      ))
   }
   )
 
@@ -1163,8 +1465,11 @@ class AllDataTypesTestCase3 extends QueryTest with BeforeAndAfterAll {
           "product_name='Huawei3972' and deliveryprovince='Province_472' group by device_color " +
           "order by imei_number desc"
       ),
-      Seq(Row("black3972", 1))
-    )
+      sql(
+        "select device_color, count(distinct imei) as imei_number from  myvmall_hiveTest  where " +
+          "product_name='Huawei3972' and deliveryprovince='Province_472' group by device_color " +
+          "order by imei_number desc"
+      ))
   }
   )
 
@@ -1180,8 +1485,11 @@ class AllDataTypesTestCase3 extends QueryTest with BeforeAndAfterAll {
           " where product_name='Huawei3972' and deliveryprovince='Province_472' group by " +
           "product_name,device_color order by imei_number desc"
       ),
-      Seq(Row("Huawei3972", "black3972", 1))
-    )
+      sql(
+        "select product_name,device_color, count(distinct imei) as imei_number from  myvmall_hiveTest " +
+          " where product_name='Huawei3972' and deliveryprovince='Province_472' group by " +
+          "product_name,device_color order by imei_number desc"
+      ))
   }
   )
 
@@ -1198,8 +1506,12 @@ class AllDataTypesTestCase3 extends QueryTest with BeforeAndAfterAll {
           "deliverycity='deliveryCity487' group by product_name,device_color order by imei_number" +
           " desc"
       ),
-      Seq(Row("Huawei3987", "black3987", 1))
-    )
+      sql(
+        "select product_name,device_color, count(distinct imei) as imei_number from  myvmall_hiveTest " +
+          " where product_name='Huawei3987' and deliveryprovince='Province_487' and " +
+          "deliverycity='deliveryCity487' group by product_name,device_color order by imei_number" +
+          " desc"
+      ))
   }
   )
 
@@ -1217,8 +1529,12 @@ class AllDataTypesTestCase3 extends QueryTest with BeforeAndAfterAll {
           "deliverycity='deliveryCity487' and device_color='black3987' group by product_name," +
           "device_color order by imei_number desc"
       ),
-      Seq(Row("Huawei3987", "black3987", 1))
-    )
+      sql(
+        "select product_name,device_color, count(distinct imei) as imei_number from  myvmall_hiveTest " +
+          " where product_name='Huawei3987' and deliveryprovince='Province_487' and " +
+          "deliverycity='deliveryCity487' and device_color='black3987' group by product_name," +
+          "device_color order by imei_number desc"
+      ))
   }
   )
 
@@ -1232,8 +1548,10 @@ class AllDataTypesTestCase3 extends QueryTest with BeforeAndAfterAll {
         "SELECT product_name, count(distinct imei) DistinctCount_imei FROM  myvmallTest  SUB_QRY " +
           "where product_name='Huawei3987' GROUP BY product_name ORDER BY product_name ASC"
       ),
-      Seq(Row("Huawei3987", 1))
-    )
+      sql(
+        "SELECT product_name, count(distinct imei) DistinctCount_imei FROM  myvmall_hiveTest  SUB_QRY " +
+          "where product_name='Huawei3987' GROUP BY product_name ORDER BY product_name ASC"
+      ))
   }
   )
 
@@ -1247,23 +1565,28 @@ class AllDataTypesTestCase3 extends QueryTest with BeforeAndAfterAll {
         "SELECT product_name, count(distinct imei) DistinctCount_imei from  myvmallTest  where " +
           "product_name='Huawei3987' GROUP BY product_name ORDER BY product_name ASC"
       ),
-      Seq(Row("Huawei3987", 1))
-    )
+      sql(
+        "SELECT product_name, count(distinct imei) DistinctCount_imei from  myvmall_hiveTest  where " +
+          "product_name='Huawei3987' GROUP BY product_name ORDER BY product_name ASC"
+      ))
   }
   )
 
   //SmartPCC_Perf_TC_001
   test(
-    "select MSISDN,sum(UP_THROUGHPUT)+sum(DOWN_THROUGHPUT) as total from  traffic_2g_3g_4g  where" +
+    "select MSISDN,sum(UP_THROUGHPUT)+sum(DOWN_THROUGHPUT) as total from  Traffic_2G_3G_4G where" +
       " TERMINAL_BRAND='HTC' and APP_CATEGORY_NAME='Web_Browsing' group by MSISDN"
   )({
+
     checkAnswer(
       sql(
-        "select MSISDN,sum(UP_THROUGHPUT)+sum(DOWN_THROUGHPUT) as total from  traffic_2g_3g_4g  " +
+        "select MSISDN,sum(UP_THROUGHPUT)+sum(DOWN_THROUGHPUT) as total from  traffic_2g_3g_4g " +
           "where TERMINAL_BRAND='HTC' and APP_CATEGORY_NAME='Web_Browsing' group by MSISDN"
-      ),
-      Seq(Row("8613649905753", 2381))
-    )
+      ), sql(
+        "select MSISDN,sum(UP_THROUGHPUT)+sum(DOWN_THROUGHPUT) as total from  traffic_2g_3g_4g_hive  " +
+          "where TERMINAL_BRAND='HTC' and APP_CATEGORY_NAME='Web_Browsing' group by MSISDN"
+      ))
+
   }
   )
 
@@ -1277,8 +1600,10 @@ class AllDataTypesTestCase3 extends QueryTest with BeforeAndAfterAll {
         "select MSISDN,sum(UP_THROUGHPUT)+sum(DOWN_THROUGHPUT) as total from  traffic_2g_3g_4g  " +
           "where RAT_NAME='GERAN' group by MSISDN having total > 23865 order by total desc"
       ),
-      Seq(Row("8613893462639", 2874640), Row("8613993676885", 73783))
-    )
+      sql(
+        "select MSISDN,sum(UP_THROUGHPUT)+sum(DOWN_THROUGHPUT) as total from  traffic_2g_3g_4g_hive  " +
+          "where RAT_NAME='GERAN' group by MSISDN having total > 23865 order by total desc"
+      ))
   }
   )
 
@@ -1295,8 +1620,12 @@ class AllDataTypesTestCase3 extends QueryTest with BeforeAndAfterAll {
           "APP_SUB_CATEGORY_NAME='HTTP' and TERMINAL_BRAND='MARCONI' group by " +
           "APP_SUB_CATEGORY_NAME order by msidn_number desc"
       ),
-      Seq(Row("HTTP", 1, 2874640))
-    )
+      sql(
+        "select APP_SUB_CATEGORY_NAME,count(distinct MSISDN) as msidn_number,sum(UP_THROUGHPUT)" +
+          "+sum(DOWN_THROUGHPUT) as total from  traffic_2g_3g_4g_hive  where " +
+          "APP_SUB_CATEGORY_NAME='HTTP' and TERMINAL_BRAND='MARCONI' group by " +
+          "APP_SUB_CATEGORY_NAME order by msidn_number desc"
+      ))
   }
   )
 
@@ -1312,8 +1641,11 @@ class AllDataTypesTestCase3 extends QueryTest with BeforeAndAfterAll {
           "(DOWN_THROUGHPUT) as total from  traffic_2g_3g_4g  where TERMINAL_BRAND='MARCONI' " +
           "group by TERMINAL_BRAND order by msidn_number desc"
       ),
-      Seq(Row("MARCONI", 1, 2874640))
-    )
+      sql(
+        "select TERMINAL_BRAND,count(distinct MSISDN) as msidn_number,sum(UP_THROUGHPUT)+sum" +
+          "(DOWN_THROUGHPUT) as total from  traffic_2g_3g_4g_hive  where TERMINAL_BRAND='MARCONI' " +
+          "group by TERMINAL_BRAND order by msidn_number desc"
+      ))
   }
   )
 
@@ -1328,8 +1660,11 @@ class AllDataTypesTestCase3 extends QueryTest with BeforeAndAfterAll {
           "(DOWN_THROUGHPUT) as total from  traffic_2g_3g_4g  where CGI='460003772902063' group " +
           "by CGI order by total desc"
       ),
-      Seq(Row("460003772902063", 1, 73783))
-    )
+      sql(
+        "select CGI,count(distinct MSISDN) as msidn_number,sum(UP_THROUGHPUT)+sum" +
+          "(DOWN_THROUGHPUT) as total from  traffic_2g_3g_4g_hive  where CGI='460003772902063' group " +
+          "by CGI order by total desc"
+      ))
   }
   )
 
@@ -1347,8 +1682,12 @@ class AllDataTypesTestCase3 extends QueryTest with BeforeAndAfterAll {
           "RAT_NAME='GERAN' and TERMINAL_BRAND='HTC' group by TERMINAL_BRAND," +
           "APP_SUB_CATEGORY_NAME order by total desc"
       ),
-      Seq(Row("HTC", "HTTP_Browsing", 1, 2381), Row("HTC", "DNS", 1, 280))
-    )
+      sql(
+        "select TERMINAL_BRAND,APP_SUB_CATEGORY_NAME,count(distinct MSISDN) as msidn_number,sum" +
+          "(UP_THROUGHPUT)+sum(DOWN_THROUGHPUT) as total from  traffic_2g_3g_4g_hive  where  " +
+          "RAT_NAME='GERAN' and TERMINAL_BRAND='HTC' group by TERMINAL_BRAND," +
+          "APP_SUB_CATEGORY_NAME order by total desc"
+      ))
   }
   )
 
@@ -1366,8 +1705,12 @@ class AllDataTypesTestCase3 extends QueryTest with BeforeAndAfterAll {
           "('460003772902063','460003773401611') group by APP_SUB_CATEGORY_NAME,TERMINAL_TYPE " +
           "order by total desc"
       ),
-      Seq(Row("SMARTPHONE", "HTTPS", 1, 73783), Row("SMARTPHONE", "HTTP_Browsing", 1, 2381))
-    )
+      sql(
+        "select TERMINAL_TYPE,APP_SUB_CATEGORY_NAME,count(distinct MSISDN) as msidn_number,sum" +
+          "(UP_THROUGHPUT)+sum(DOWN_THROUGHPUT) as total from  traffic_2g_3g_4g_hive  where  CGI in" +
+          "('460003772902063','460003773401611') group by APP_SUB_CATEGORY_NAME,TERMINAL_TYPE " +
+          "order by total desc"
+      ))
   }
   )
 
@@ -1383,8 +1726,11 @@ class AllDataTypesTestCase3 extends QueryTest with BeforeAndAfterAll {
           "(DOWN_THROUGHPUT) as total from  traffic_2G_3G_4G where MSISDN='8613993800024' group " +
           "by TERMINAL_TYPE"
       ),
-      Seq(Row("SMARTPHONE", 1, 5044))
-    )
+      sql(
+        "select TERMINAL_TYPE,count(distinct MSISDN) as msidn_number,sum(UP_THROUGHPUT)+ sum" +
+          "(DOWN_THROUGHPUT) as total from  traffic_2G_3G_4G_hive where MSISDN='8613993800024' group " +
+          "by TERMINAL_TYPE"
+      ))
   }
   )
 
@@ -1398,8 +1744,10 @@ class AllDataTypesTestCase3 extends QueryTest with BeforeAndAfterAll {
         "select TERMINAL_TYPE,sum(UP_THROUGHPUT)+ sum(DOWN_THROUGHPUT) as total from  " +
           "traffic_2g_3g_4g where MSISDN='8613519003078' group by TERMINAL_TYPE"
       ),
-      Seq(Row("FEATURE PHONE", 2485))
-    )
+      sql(
+        "select TERMINAL_TYPE,sum(UP_THROUGHPUT)+ sum(DOWN_THROUGHPUT) as total from  " +
+          "traffic_2g_3g_4g_hive where MSISDN='8613519003078' group by TERMINAL_TYPE"
+      ))
   }
   )
 
@@ -1412,8 +1760,9 @@ class AllDataTypesTestCase3 extends QueryTest with BeforeAndAfterAll {
       sql(
         "select TERMINAL_TYPE,UP_THROUGHPUT, DOWN_THROUGHPUT as total from  Traffic_2G_3G_4G where MSISDN='8613993104233'"
       ),
-      Seq(Row("SMARTPHONE", 134, 146))
-    )
+      sql(
+        "select TERMINAL_TYPE,UP_THROUGHPUT, DOWN_THROUGHPUT as total from  Traffic_2G_3G_4G_hive where MSISDN='8613993104233'"
+      ))
   }
   )
 
@@ -1425,8 +1774,9 @@ class AllDataTypesTestCase3 extends QueryTest with BeforeAndAfterAll {
       sql(
         "select SOURCE_INFO,APP_CATEGORY_ID,RAT_NAME,TERMINAL_TYPE,UP_THROUGHPUT, DOWN_THROUGHPUT from  Traffic_2G_3G_4G where MSISDN='8618394185970' and APP_CATEGORY_ID='2'"
       ),
-      Seq(Row("GN", "2", "GERAN", "SMARTPHONE", 13934, 9931))
-    )
+      sql(
+        "select SOURCE_INFO,APP_CATEGORY_ID,RAT_NAME,TERMINAL_TYPE,UP_THROUGHPUT, DOWN_THROUGHPUT from  Traffic_2G_3G_4G_hive where MSISDN='8618394185970' and APP_CATEGORY_ID='2'"
+      ))
   }
   )
 
@@ -1438,8 +1788,9 @@ class AllDataTypesTestCase3 extends QueryTest with BeforeAndAfterAll {
       sql(
         "select SOURCE_INFO,APP_CATEGORY_ID from Traffic_2G_3G_4G where MSISDN='8615120474362' and APP_CATEGORY_ID='-1'"
       ),
-      Seq(Row("GN", "-1"))
-    )
+      sql(
+        "select SOURCE_INFO,APP_CATEGORY_ID from Traffic_2G_3G_4G_hive where MSISDN='8615120474362' and APP_CATEGORY_ID='-1'"
+      ))
   }
   )
 
@@ -1451,8 +1802,9 @@ class AllDataTypesTestCase3 extends QueryTest with BeforeAndAfterAll {
       sql(
         "select SOURCE_INFO,APP_CATEGORY_ID,TERMINAL_BRAND,TERMINAL_MODEL,UP_THROUGHPUT,DOWN_THROUGHPUT from Traffic_2G_3G_4G where MSISDN='8613893600602' and APP_CATEGORY_ID='-1'"
       ),
-      Seq(Row("GN", "-1", "LENOVO", "LENOVO A60", 1662, 684))
-    )
+      sql(
+        "select SOURCE_INFO,APP_CATEGORY_ID,TERMINAL_BRAND,TERMINAL_MODEL,UP_THROUGHPUT,DOWN_THROUGHPUT from Traffic_2G_3G_4G_hive where MSISDN='8613893600602' and APP_CATEGORY_ID='-1'"
+      ))
   }
   )
 
@@ -1464,9 +1816,11 @@ class AllDataTypesTestCase3 extends QueryTest with BeforeAndAfterAll {
       sql(
         "select SOURCE_INFO,APP_CATEGORY_ID,CGI,DAY,HOUR,MIN,UP_THROUGHPUT,DOWN_THROUGHPUT from Traffic_2G_3G_4G where  APP_CATEGORY_ID='16' and MSISDN='8613993899110' and CGI='460003776906411' and DAY='8-1' and HOUR='23'"
       ),
-      Seq(Row("GN", "16", "460003776906411", "8-1", "23", "0", 1647, 2717))
-    )
+      sql(
+        "select SOURCE_INFO,APP_CATEGORY_ID,CGI,DAY,HOUR,MIN,UP_THROUGHPUT,DOWN_THROUGHPUT from Traffic_2G_3G_4G_hive where  APP_CATEGORY_ID='16' and MSISDN='8613993899110' and CGI='460003776906411' and DAY='8-1' and HOUR='23'"
+      ))
   }
   )
 
-}
\ No newline at end of file
+}
+


[2/2] incubator-carbondata git commit: [CARBONDATA-445] improved integration test-case for AllDataTypesTestCase3 This closes #348

Posted by ra...@apache.org.
[CARBONDATA-445] improved integration test-case for AllDataTypesTestCase3 This closes #348


Project: http://git-wip-us.apache.org/repos/asf/incubator-carbondata/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-carbondata/commit/a0714f51
Tree: http://git-wip-us.apache.org/repos/asf/incubator-carbondata/tree/a0714f51
Diff: http://git-wip-us.apache.org/repos/asf/incubator-carbondata/diff/a0714f51

Branch: refs/heads/master
Commit: a0714f51141a883e4c1ea5c145e2141ca9024154
Parents: 26e3e00 bbe43da
Author: ravipesala <ra...@gmail.com>
Authored: Sun Dec 11 09:33:46 2016 +0530
Committer: ravipesala <ra...@gmail.com>
Committed: Sun Dec 11 09:33:46 2016 +0530

----------------------------------------------------------------------
 .../allqueries/AllDataTypesTestCase3.scala      | 776 ++++++++++++++-----
 1 file changed, 565 insertions(+), 211 deletions(-)
----------------------------------------------------------------------