Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Aitozi committed Apr 18, 2024
1 parent e710b5c commit 5af360a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ public ExpireSnapshots newExpireSnapshots(CoreOptions options) {
options.changelogNumRetainMax(),
options.changelogNumRetainMin(),
options.changelogTimeRetain().toMillis(),
options.snapshotExpireLimit()) {};
options.snapshotExpireLimit());
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,9 @@
package org.apache.paimon.spark.procedure

import org.apache.paimon.spark.PaimonSparkTestBase

import org.apache.spark.sql.{Dataset, Row}
import org.apache.spark.sql.execution.streaming.MemoryStream
import org.apache.spark.sql.streaming.StreamTest
import org.apache.spark.sql.{Dataset, Row}

class ExpireSnapshotsProcedureTest extends PaimonSparkTestBase with StreamTest {

Expand All @@ -33,10 +32,11 @@ class ExpireSnapshotsProcedureTest extends PaimonSparkTestBase with StreamTest {
withTempDir {
checkpointDir =>
// define a change-log table and test `forEachBatch` api
spark.sql(s"""
|CREATE TABLE T (a INT, b STRING)
|TBLPROPERTIES ('primary-key'='a', 'bucket'='3')
|""".stripMargin)
spark.sql(
s"""
|CREATE TABLE T (a INT, b STRING)
|TBLPROPERTIES ('primary-key'='a', 'bucket'='3')
|""".stripMargin)
val location = loadTable("T").location().toString

val inputData = MemoryStream[(Int, String)]
Expand Down Expand Up @@ -71,7 +71,7 @@ class ExpireSnapshotsProcedureTest extends PaimonSparkTestBase with StreamTest {

// expire
checkAnswer(
spark.sql("CALL paimon.sys.expire_snapshots(table => 'test.T', retain_max => 2)"),
spark.sql("CALL paimon.sys.expire_snapshots(table => 'test.T', retain_max => 2, retain_min => 1)"),
Row(1) :: Nil)

checkAnswer(
Expand All @@ -89,10 +89,11 @@ class ExpireSnapshotsProcedureTest extends PaimonSparkTestBase with StreamTest {
withTempDir {
checkpointDir =>
// define a change-log table and test `forEachBatch` api
spark.sql(s"""
|CREATE TABLE T (a INT, b STRING)
|TBLPROPERTIES ('primary-key'='a', 'bucket'='3')
|""".stripMargin)
spark.sql(
s"""
|CREATE TABLE T (a INT, b STRING)
|TBLPROPERTIES ('primary-key'='a', 'bucket'='3')
|""".stripMargin)
val location = loadTable("T").location().toString

val inputData = MemoryStream[(Int, String)]
Expand Down

0 comments on commit 5af360a

Please sign in to comment.