Github user gatorsmile commented on a diff in the pull request:

    https://github.com/apache/spark/pull/16626#discussion_r106097304
  
    --- Diff: 
sql/core/src/test/scala/org/apache/spark/sql/execution/command/DDLSuite.scala 
---
    @@ -166,6 +166,42 @@ class InMemoryCatalogedDDLSuite extends DDLSuite with 
SharedSQLContext with Befo
         }
       }
     
    +  Seq("parquet", "json", "csv").foreach { provider =>
    +    test(s"Alter table add columns -- ${provider} format") {
    +      assume(spark.sparkContext.conf.get(CATALOG_IMPLEMENTATION) == 
"in-memory")
    +      withTable("t") {
    +        sql(s"create table t (c1 int) using ${provider}")
    +        sql("insert into table t values (1)")
    +        sql("alter table t add columns (c2 int)")
    +        checkAnswer(sql("select * from t"), Seq(Row(1, null)))
    +        sql("insert into table t values (2, 2)")
    +        checkAnswer(sql("select * from t where c2 is not null"), 
Seq(Row(2, 2)))
    +        checkAnswer(
    +          sql("select * from t"),
    +          Seq(Row(1, null), Row(2, 2))
    +        )
    +      }
    +    }
    +  }
    +
    +  Seq("parquet", "json", "csv").foreach { provider =>
    +    test(s"Alter table add columns with partitions -- ${provider} format") 
{
    +      assume(spark.sparkContext.conf.get(CATALOG_IMPLEMENTATION) == 
"in-memory")
    +      withTable("t") {
    +        sql(s"create table t (c1 int, c2 int) using ${provider} 
partitioned by (c2)")
    +        sql("insert into table t values (1, 1)")
    +        sql("alter table t add columns (c3 int)")
    +        checkAnswer(sql("select * from t"), Seq(Row(1, null, 1)))
    +        sql("insert into table t values (2, 2, 3)")
    +        checkAnswer(sql("select * from t where c3 is not null"), 
Seq(Row(2, 2, 3)))
    +        checkAnswer(sql("select * from t where c2 = 3"), Seq(Row(2, 2, 3)))
    +        checkAnswer(
    +          sql("select * from t"),
    +          Seq(Row(1, null, 1), Row(2, 2, 3))
    +        )
    +      }
    +    }
    +  }
    --- End diff --
    
    Why we need these two test cases? We already have them in `DDLSuite`, which 
is extended by `InMemoryCatalogedDDLSuite`.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to