diff --git a/paimon-spark/paimon-spark-common/src/main/java/org/apache/paimon/spark/procedure/PurgeFilesProcedure.java b/paimon-spark/paimon-spark-common/src/main/java/org/apache/paimon/spark/procedure/PurgeFilesProcedure.java index 8a7aec6e1410..9db724294ae8 100644 --- a/paimon-spark/paimon-spark-common/src/main/java/org/apache/paimon/spark/procedure/PurgeFilesProcedure.java +++ b/paimon-spark/paimon-spark-common/src/main/java/org/apache/paimon/spark/procedure/PurgeFilesProcedure.java @@ -82,6 +82,7 @@ public InternalRow[] call(InternalRow args) { throw new RuntimeException(e); } }); + spark().catalog().refreshTable(table.fullName()); } catch (IOException e) { throw new RuntimeException(e); } diff --git a/paimon-spark/paimon-spark-ut/src/test/scala/org/apache/paimon/spark/procedure/PurgeFilesProcedureTest.scala b/paimon-spark/paimon-spark-ut/src/test/scala/org/apache/paimon/spark/procedure/PurgeFilesProcedureTest.scala index 27eafe1c3d03..b8911ada2f5c 100644 --- a/paimon-spark/paimon-spark-ut/src/test/scala/org/apache/paimon/spark/procedure/PurgeFilesProcedureTest.scala +++ b/paimon-spark/paimon-spark-ut/src/test/scala/org/apache/paimon/spark/procedure/PurgeFilesProcedureTest.scala @@ -36,7 +36,6 @@ class PurgeFilesProcedureTest extends PaimonSparkTestBase { spark.sql("CALL paimon.sys.purge_files(table => 'test.T')") checkAnswer(spark.sql("select * from test.T"), Nil) - spark.sql("refresh table test.T"); spark.sql("insert into T select '2', 'aa'"); checkAnswer(spark.sql("select * from test.T"), Row("2", "aa") :: Nil) }