From c138982cb083612ebad6ddb83e41dc4188dd76ed Mon Sep 17 00:00:00 2001 From: Askwang <135721692+Askwang@users.noreply.github.com> Date: Fri, 11 Oct 2024 14:21:36 +0800 Subject: [PATCH] add test --- .../spark/sql/AskwangPaimonSparkTest.scala | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/paimon-spark/paimon-spark-common/src/test/scala/org/apache/paimon/spark/sql/AskwangPaimonSparkTest.scala b/paimon-spark/paimon-spark-common/src/test/scala/org/apache/paimon/spark/sql/AskwangPaimonSparkTest.scala index f1b58ebf6838..ae757b8a4694 100644 --- a/paimon-spark/paimon-spark-common/src/test/scala/org/apache/paimon/spark/sql/AskwangPaimonSparkTest.scala +++ b/paimon-spark/paimon-spark-common/src/test/scala/org/apache/paimon/spark/sql/AskwangPaimonSparkTest.scala @@ -153,6 +153,22 @@ class AskwangPaimonSparkTest extends PaimonSparkTestBase { Row("[2024-10-10, 01]", 0) :: Row("[2024-10-10, 01]", 1) :: Row("[2024-10-10, 01]", 2) :: Nil) } + test("PaimonPartitionManagement show partitions") { + spark.sql(s""" + |CREATE TABLE T (a INT, b STRING,dt STRING,hh STRING) + |PARTITIONED BY (dt, hh) + |TBLPROPERTIES ('primary-key'='a,dt,hh', 'bucket' = '3') + |""".stripMargin) + + spark.sql("INSERT INTO T VALUES(1, 'a', '2024-10-10', '01')") + spark.sql("INSERT INTO T VALUES(3, 'c', '2024-10-10', '23')") + spark.sql("INSERT INTO T VALUES(2, 'b', '2024-10-10', '12')") + spark.sql("INSERT INTO T VALUES(5, 'f', '2024-10-09', '02')") + spark.sql("INSERT INTO T VALUES(4, 'd', '2024-10-09', '01')") + + spark.sql("show partitions T").show(false) + } + test("tmp: xxx") { println("version: " + sparkVersion) }