Skip to content

Commit

Permalink
fix typo
Browse files Browse the repository at this point in the history
  • Loading branch information
yuzelin committed Dec 5, 2023
1 parent 245cb22 commit 236f242
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,15 @@
* Remove orphan files procedure. Usage:
*
* <pre><code>
* CALL sys.remove_orphan_files(table => 'tableId', [older_then => '2023-10-31 12:00:00'])
* CALL sys.remove_orphan_files(table => 'tableId', [older_than => '2023-10-31 12:00:00'])
* </code></pre>
*/
public class RemoveOrphanFilesProcedure extends BaseProcedure {

private static final ProcedureParameter[] PARAMETERS =
new ProcedureParameter[] {
ProcedureParameter.required("table", StringType),
ProcedureParameter.optional("older_then", StringType)
ProcedureParameter.optional("older_than", StringType)
};

private static final StructType OUTPUT_TYPE =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,22 +51,22 @@ class RemoveOrphanFilesProcedureTest extends PaimonSparkTestBase {
checkAnswer(spark.sql(s"CALL sys.remove_orphan_files(table => 'T')"), Row("Deleted=0") :: Nil)

val orphanFile2ModTime = fileIO.getFileStatus(orphanFile2).getModificationTime
val older_then1 = DateTimeUtils.formatLocalDateTime(
val older_than1 = DateTimeUtils.formatLocalDateTime(
DateTimeUtils.toLocalDateTime(
orphanFile2ModTime -
TimeUnit.SECONDS.toMillis(1)),
3)

checkAnswer(
spark.sql(s"CALL sys.remove_orphan_files(table => 'T', older_then => '$older_then1')"),
spark.sql(s"CALL sys.remove_orphan_files(table => 'T', older_than => '$older_than1')"),
Row("Deleted=1") :: Nil)

val older_then2 = DateTimeUtils.formatLocalDateTime(
val older_than2 = DateTimeUtils.formatLocalDateTime(
DateTimeUtils.toLocalDateTime(System.currentTimeMillis()),
3)

checkAnswer(
spark.sql(s"CALL sys.remove_orphan_files(table => 'T', older_then => '$older_then2')"),
spark.sql(s"CALL sys.remove_orphan_files(table => 'T', older_than => '$older_than2')"),
Row("Deleted=1") :: Nil)
}
}

0 comments on commit 236f242

Please sign in to comment.