@Override
  protected List<String> getArgs() {
    TableMetadata tableMetadata = getMetadata();
    RetentionConfig config = tablesClient.getTableRetention(tableMetadata).get();
    String columnName = config.getColumnName();
    List<String> jobArgs =
        Stream.of(
                "--tableName",
                tableMetadata.fqtn(),
                "--columnName",
                columnName,
                "--granularity",
                config.getGranularity().getValue(),
                "--count",
                Integer.toString(config.getCount()))
            .collect(Collectors.toList());

    if (!StringUtils.isBlank(config.getColumnPattern())) {
      jobArgs.add("--columnPattern");
      jobArgs.add(config.getColumnPattern());
    }
    return jobArgs;
  }
@Test
  void testRetentionJobArgsForTableWithPattern() {
    TableRetentionTask tableRetentionTask =
        new TableRetentionTask(jobsClient, tablesClient, tableMetadata);
    String columnPattern = "yyyy-MM-DD";
    String columnName = "testColumnName";
    int count = 1;
    Retention.GranularityEnum retentionGranularity = Retention.GranularityEnum.DAY;
    RetentionConfig retentionConfigMock = Mockito.mock(RetentionConfig.class);
    Mockito.when(retentionConfigMock.getColumnPattern()).thenReturn(columnPattern);
    Mockito.when(retentionConfigMock.getColumnName()).thenReturn(columnName);
    Mockito.when(retentionConfigMock.getGranularity()).thenReturn(retentionGranularity);
    Mockito.when(retentionConfigMock.getCount()).thenReturn(count);
    Mockito.when(tablesClient.getTableRetention(tableMetadata))
        .thenReturn(Optional.of(retentionConfigMock));
    List<String> expectedArgs =
        Stream.of(
                "--tableName",
                tableMetadata.fqtn(),
                "--columnName",
                columnName,
                "--granularity",
                retentionGranularity.getValue(),
                "--count",
                String.valueOf(count),
                "--columnPattern",
                columnPattern)
            .collect(Collectors.toList());
    Assertions.assertEquals(expectedArgs, tableRetentionTask.getArgs());
  }