Skip to content

Commit

Permalink
Merge 9f752b7 into 8c49e5b
Browse files Browse the repository at this point in the history
  • Loading branch information
anubhav100 committed Oct 22, 2018
2 parents 8c49e5b + 9f752b7 commit 613cdc0
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
Expand Up @@ -296,6 +296,21 @@ class StandardPartitionTableOverwriteTestCase extends QueryTest with BeforeAndAf
assert(sql("select * from partitionLoadTable").collect().length == 2)
}

test("Test overwrite static partition when partition column is in capital letters ") {
sql(
"""
| CREATE TABLE weather8 (type String)
| PARTITIONED BY (year int, month int, day int)
| STORED BY 'org.apache.carbondata.format'
""".stripMargin)

sql("insert into weather8 partition(year=2014, month=05, day=25) select 'rainy'")
sql("insert into weather8 partition(year=2014, month=04, day=23) select 'cloudy'")
sql("insert overwrite table weather8 partition(YEAR=2014, MONTH=5, DAY=25) select 'sunny'")
checkExistence(sql("select * from weather8"), true, "sunny")
checkAnswer(sql("select count(*) from weather8"), Seq(Row(3)))
}

override def afterAll = {
dropTable
}
Expand All @@ -309,6 +324,7 @@ class StandardPartitionTableOverwriteTestCase extends QueryTest with BeforeAndAf
sql("drop table if exists partitionallcompaction")
sql("drop table if exists weather6")
sql("drop table if exists weather7")
sql("drop table if exists weather8")
sql("drop table if exists uniqdata_hive_static")
sql("drop table if exists uniqdata_hive_dynamic")
sql("drop table if exists uniqdata_string_static")
Expand Down
Expand Up @@ -94,7 +94,10 @@ class DDLStrategy(sparkSession: SparkSession) extends SparkStrategy {
identifier.table.toLowerCase)) :: Nil
case InsertIntoCarbonTable(relation: CarbonDatasourceHadoopRelation,
partition, child: LogicalPlan, overwrite, _) =>
ExecutedCommandExec(CarbonInsertIntoCommand(relation, child, overwrite, partition)) :: Nil
ExecutedCommandExec(CarbonInsertIntoCommand(relation, child, overwrite,
partition.map {
case (key, value) =>
(key.toLowerCase, value) })) :: Nil
case createDb@CreateDatabaseCommand(dbName, ifNotExists, _, _, _) =>
val dbLocation = try {
CarbonEnv.getDatabaseLocation(dbName, sparkSession)
Expand Down

0 comments on commit 613cdc0

Please sign in to comment.