Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
askwang committed Sep 20, 2024
1 parent 19f4895 commit 559f322
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion docs/content/flink/procedures.md
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ All available procedures are listed below.
<tr>
<td>expire_tags</td>
<td>
CALL [catalog.]sys.expire_tags('identifier', 'expiration_time')
CALL [catalog.]sys.expire_tags('identifier', 'older_than')
</td>
<td>
To expire tags by time. Arguments:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,18 +50,18 @@ public void testExpireTagsByTagCreateTimeAndTagTimeRetained() throws Exception {
}
checkSnapshots(snapshotManager, 1, 5);

sql("CALL sys.create_tag(`table` => 'default.T', tag => 'tag-1', snapshot => 1)");
sql("CALL sys.create_tag(`table` => 'default.T', tag => 'tag-1', snapshot_id => 1)");
sql(
"CALL sys.create_tag(`table` => 'default.T', tag => 'tag-2', snapshot => 2, time_retained => '1h')");
"CALL sys.create_tag(`table` => 'default.T', tag => 'tag-2', snapshot_id => 2, time_retained => '1h')");

// no tags expired
assertThat(sql("CALL sys.expire_tags(`table` => 'default.T')"))
.containsExactly(Row.of("No expired tags."));

sql(
"CALL sys.create_tag(`table` => 'default.T', tag => 'tag-3', snapshot => 3, time_retained => '1s')");
"CALL sys.create_tag(`table` => 'default.T', tag => 'tag-3', snapshot_id => 3, time_retained => '1s')");
sql(
"CALL sys.create_tag(`table` => 'default.T', tag => 'tag-4', snapshot => 4, time_retained => '1s')");
"CALL sys.create_tag(`table` => 'default.T', tag => 'tag-4', snapshot_id => 4, time_retained => '1s')");

Thread.sleep(2000);
// tag-3,tag-4 expired
Expand All @@ -86,13 +86,13 @@ public void testExpireTagsByOlderThanTime() throws Exception {
checkSnapshots(snapshotManager, 1, 5);

sql(
"CALL sys.create_tag(`table` => 'default.T', tag => 'tag-1', snapshot => 1, time_retained => '1d')");
"CALL sys.create_tag(`table` => 'default.T', tag => 'tag-1', snapshot_id => 1, time_retained => '1d')");
sql(
"CALL sys.create_tag(`table` => 'default.T', tag => 'tag-2', snapshot => 2, time_retained => '1d')");
"CALL sys.create_tag(`table` => 'default.T', tag => 'tag-2', snapshot_id => 2, time_retained => '1d')");
sql(
"CALL sys.create_tag(`table` => 'default.T', tag => 'tag-3', snapshot => 3, time_retained => '1d')");
"CALL sys.create_tag(`table` => 'default.T', tag => 'tag-3', snapshot_id => 3, time_retained => '1d')");
sql(
"CALL sys.create_tag(`table` => 'default.T', tag => 'tag-4', snapshot => 4, time_retained => '1d')");
"CALL sys.create_tag(`table` => 'default.T', tag => 'tag-4', snapshot_id => 4, time_retained => '1d')");

// tag-4 as the base older_than time
LocalDateTime olderThanTime = table.tagManager().tag("tag-4").getTagCreateTime();
Expand Down

0 comments on commit 559f322

Please sign in to comment.