1
0

[HUDI-2339] Create Table If Not Exists Failed After Alter Table (#3510)

This commit is contained in:
pengzhiwei
2021-08-20 14:21:10 +08:00
committed by GitHub
parent c350d05dd3
commit 49829f8822
3 changed files with 30 additions and 3 deletions

View File

@@ -505,4 +505,29 @@ class TestCreateTable extends TestHoodieSqlBase {
}
}
test("Test Create Table Exists In Catalog") {
val tableName = generateTableName
spark.sql(
s"""
|create table $tableName (
| id int,
| name string,
| price double
|) using hudi
|""".stripMargin
)
spark.sql(s"alter table $tableName add columns(ts bigint)")
// Check "create table if not exist" works after schema evolution.
spark.sql(
s"""
|create table if not exists $tableName (
| id int,
| name string,
| price double
|) using hudi
|""".stripMargin
)
}
}