Skip to content

Commit

Permalink
add test
Browse files Browse the repository at this point in the history
  • Loading branch information
askwang committed Oct 11, 2024
1 parent 390c77f commit c138982
Showing 1 changed file with 16 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down

0 comments on commit c138982

Please sign in to comment.