use of com.google.cloud.teleport.v2.utils.DataplexBigQueryToGcsFilter in project DataflowTemplates by GoogleCloudPlatform.
the class DataplexBigQueryToGcsFilterTest method test_whenBeforeDateIs1DayDuration_dateParsedCorrectly.
@Test
public void test_whenBeforeDateIs1DayDuration_dateParsedCorrectly() {
// current time in the DEFAULT time zone minus one day:
long micros = Instant.now().minus(Duration.standardDays(1)).getMillis() * 1000L;
BigQueryTable.Builder olderTable = table().setLastModificationTime(micros - 100000L);
BigQueryTable.Builder newerTable = table().setLastModificationTime(micros + 100000L);
options.setTables(null);
options.setExportDataModifiedBeforeDateTime("-P1D");
Filter f = new DataplexBigQueryToGcsFilter(options, new ArrayList<String>());
assertThat(f.shouldSkipUnpartitionedTable(newerTable)).isTrue();
assertThat(f.shouldSkipUnpartitionedTable(olderTable)).isFalse();
}
Aggregations