liujiayi771 commented on code in PR #6359:
URL: https://github.com/apache/paimon/pull/6359#discussion_r2422359799
##########
paimon-spark/paimon-spark-ut/src/test/scala/org/apache/paimon/spark/sql/DescribeTableTestBase.scala:
##########
@@ -156,4 +157,71 @@ abstract class DescribeTableTestBase extends
PaimonSparkTestBase {
// check comment in schema
Assertions.assertTrue(Objects.equals(comment,
loadTable(tableName).schema().comment()))
}
+
+ protected def describeTablePartitionCreateTable(): Unit = {
+ spark.sql("""
+ |CREATE TABLE T (
+ | id INT NOT NULL,
+ | name STRING DEFAULT 'Bob',
+ | age INT COMMENT 'Age')
+ | PARTITIONED BY (year INT COMMENT 'Year', month INT, day INT)
+ |""".stripMargin)
+ }
+
+ protected def describeTablePartitionCheckDefaultValue(res: DataFrame): Unit
= {
+ checkAnswer(
+ res
+ .filter("col_name = 'name' AND comment != ''")
+ .select("col_name", "data_type", "comment"),
+ Row("name", "string", "'Bob'") :: Nil
+ )
+ }
+
+ test("Paimon describe: describe table partition") {
+ describeTablePartitionCreateTable()
Review Comment:
spark 3.2/3 not support default keyword, so they override this methods and
create table without default keyword.
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]