QiangCai commented on a change in pull request #3950:
URL: https://github.com/apache/carbondata/pull/3950#discussion_r504467243
##########
File path:
integration/spark/src/test/scala/org/apache/carbondata/integration/spark/testsuite/emptyrow/TestSkipEmptyLines.scala
##########
@@ -33,50 +33,65 @@ class TestSkipEmptyLines extends QueryTest with
BeforeAndAfterAll {
test("test load options with true") {
sql("drop table if exists skipEmptyRowCarbonTable")
sql("CREATE TABLE skipEmptyRowCarbonTable (name string, age int) STORED AS
carbondata")
- sql(s"LOAD DATA LOCAL INPATH '$resourcesPath/emptylines.csv' into table
skipEmptyRowCarbonTable " +
- s"OPTIONS('skip_empty_line'='true')")
- checkAnswer(sql("select * from skipEmptyRowCarbonTable"),
Seq(Row("a",25),Row("b",22),Row("c",23)))
+ sql(s"LOAD DATA LOCAL INPATH '$resourcesPath/emptylines.csv' " +
+ "into table skipEmptyRowCarbonTable OPTIONS('skip_empty_line'='true')")
+ checkAnswer(sql("select * from skipEmptyRowCarbonTable"),
+ Seq(Row("a", 25), Row("b", 22), Row("c", 23)))
}
test("test load options with false") {
sql("drop table if exists skipEmptyRowCarbonTable")
sql("CREATE TABLE skipEmptyRowCarbonTable (name string, age int) STORED AS
carbondata")
- sql(s"LOAD DATA LOCAL INPATH '$resourcesPath/emptylines.csv' into table
skipEmptyRowCarbonTable " +
- s"OPTIONS('skip_empty_line'='false')")
+ sql(s"LOAD DATA LOCAL INPATH '$resourcesPath/emptylines.csv' " +
+ "into table skipEmptyRowCarbonTable
OPTIONS('skip_empty_line'='false')")
checkAnswer(sql("select * from skipEmptyRowCarbonTable"),
-
Seq(Row("a",25),Row("b",22),Row("c",23),Row(null,null),Row(null,null),Row(null,null)))
+ Seq(Row("a", 25),
+ Row("b", 22),
+ Row("c", 23),
+ Row(null, null),
+ Row(null, null),
+ Row(null, null)))
}
test("test carbonproperties with true") {
CarbonProperties.getInstance().addProperty(CarbonCommonConstants.CARBON_SKIP_EMPTY_LINE,
"true")
sql("drop table if exists skipEmptyRowCarbonTable")
sql("CREATE TABLE skipEmptyRowCarbonTable (name string, age int) STORED AS
carbondata")
- sql(s"LOAD DATA LOCAL INPATH '$resourcesPath/emptylines.csv' into table
skipEmptyRowCarbonTable")
+ sql(s"LOAD DATA LOCAL INPATH '$resourcesPath/emptylines.csv' " +
+ "into table skipEmptyRowCarbonTable")
checkAnswer(sql("select * from skipEmptyRowCarbonTable"),
- Seq(Row("a",25),Row("b",22),Row("c",23)))
+ Seq(Row("a", 25), Row("b", 22), Row("c", 23)))
CarbonProperties.getInstance().addProperty(CarbonCommonConstants.CARBON_SKIP_EMPTY_LINE,
CarbonCommonConstants.CARBON_SKIP_EMPTY_LINE_DEFAULT)
}
test("test carbonproperties with false") {
-
CarbonProperties.getInstance().addProperty(CarbonCommonConstants.CARBON_SKIP_EMPTY_LINE,
"false")
+ CarbonProperties.getInstance()
+ .addProperty(CarbonCommonConstants.CARBON_SKIP_EMPTY_LINE, "false")
sql("drop table if exists skipEmptyRowCarbonTable")
sql("CREATE TABLE skipEmptyRowCarbonTable (name string, age int) STORED AS
carbondata")
- sql(s"LOAD DATA LOCAL INPATH '$resourcesPath/emptylines.csv' into table
skipEmptyRowCarbonTable")
+ sql(s"LOAD DATA LOCAL INPATH '$resourcesPath/emptylines.csv' " +
+ "into table skipEmptyRowCarbonTable")
checkAnswer(sql("select * from skipEmptyRowCarbonTable"),
-
Seq(Row("a",25),Row("b",22),Row("c",23),Row(null,null),Row(null,null),Row(null,null)))
+ Seq(Row("a", 25),
Review comment:
changed for all places
##########
File path:
integration/spark/src/test/scala/org/apache/carbondata/spark/testsuite/aggquery/AllDataTypesTestCaseAggregate.scala
##########
@@ -46,21 +47,23 @@ class AllDataTypesTestCaseAggregate extends QueryTest with
BeforeAndAfterAll {
"Timestamp, workgroupcategory int, workgroupcategoryname String, deptno
int, deptname " +
"String, projectcode int, projectjoindate Timestamp, projectenddate
Timestamp,attendance " +
"int,utilization int,salary int)row format delimited fields terminated
by ','")
- sql(
- s"LOAD DATA LOCAL INPATH '$resourcesPath/datawithoutheader.csv' INTO
TABLE alldatatypesAGG_hive")
+ sql(s"LOAD DATA LOCAL INPATH '$resourcesPath/datawithoutheader.csv' " +
+ "INTO TABLE alldatatypesAGG_hive")
}
test(
"select empno,empname,utilization,count(salary),sum(empno) from
alldatatypestableAGG where " +
"empname in ('arvind','ayushi') group by empno,empname,utilization")
{
checkAnswer(
- sql(
- "select empno,empname,utilization,count(salary),sum(empno) from
alldatatypestableAGG where" +
- " empname in ('arvind','ayushi') group by empno,empname,utilization"),
- sql(
- "select empno,empname,utilization,count(salary),sum(empno) from
alldatatypesAGG_hive where" +
- " empname in ('arvind','ayushi') group by empno,empname,utilization"))
+ sql("select empno,empname,utilization,count(salary),sum(empno) " +
Review comment:
changed for all places
##########
File path:
integration/spark/src/test/scala/org/apache/carbondata/spark/testsuite/aggquery/AllDataTypesTestCaseAggregate.scala
##########
@@ -46,21 +47,23 @@ class AllDataTypesTestCaseAggregate extends QueryTest with
BeforeAndAfterAll {
"Timestamp, workgroupcategory int, workgroupcategoryname String, deptno
int, deptname " +
"String, projectcode int, projectjoindate Timestamp, projectenddate
Timestamp,attendance " +
"int,utilization int,salary int)row format delimited fields terminated
by ','")
- sql(
- s"LOAD DATA LOCAL INPATH '$resourcesPath/datawithoutheader.csv' INTO
TABLE alldatatypesAGG_hive")
+ sql(s"LOAD DATA LOCAL INPATH '$resourcesPath/datawithoutheader.csv' " +
+ "INTO TABLE alldatatypesAGG_hive")
}
test(
"select empno,empname,utilization,count(salary),sum(empno) from
alldatatypestableAGG where " +
"empname in ('arvind','ayushi') group by empno,empname,utilization")
{
checkAnswer(
- sql(
- "select empno,empname,utilization,count(salary),sum(empno) from
alldatatypestableAGG where" +
- " empname in ('arvind','ayushi') group by empno,empname,utilization"),
- sql(
- "select empno,empname,utilization,count(salary),sum(empno) from
alldatatypesAGG_hive where" +
- " empname in ('arvind','ayushi') group by empno,empname,utilization"))
+ sql("select empno,empname,utilization,count(salary),sum(empno) " +
Review comment:
done, changed for all places
##########
File path:
integration/spark/src/test/scala/org/apache/spark/carbondata/TestStreamingTableWithLongString.scala
##########
@@ -108,7 +109,16 @@ class TestStreamingTableWithLongString extends QueryTest
with BeforeAndAfterAll
)
val row = sql("select * from streaming_longstr.stream_table_longstr_file
order by id").head()
- val exceptedRow = Row(10, "name_10", "city_10", 100000.0,
BigDecimal.valueOf(0.01), 80.01, Date.valueOf("1990-01-01"),
Timestamp.valueOf("2010-01-01 10:01:01.0"), Timestamp.valueOf("2010-01-01
10:01:01.0"), "10" + longStrValue)
+ val exceptedRow = Row(10,
Review comment:
done
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]