use of org.apache.beam.sdk.transforms.display.DisplayData in project beam by apache.
the class BigQueryIOTest method testTableSourcePrimitiveDisplayData.
@Test
public void testTableSourcePrimitiveDisplayData() throws IOException, InterruptedException {
DisplayDataEvaluator evaluator = DisplayDataEvaluator.create();
BigQueryIO.Read read = BigQueryIO.read().from("project:dataset.tableId").withTestServices(new FakeBigQueryServices().withDatasetService(new FakeDatasetService()).withJobService(new FakeJobService())).withoutValidation();
Set<DisplayData> displayData = evaluator.displayDataForPrimitiveSourceTransforms(read);
assertThat("BigQueryIO.Read should include the table spec in its primitive display data", displayData, hasItem(hasDisplayItem("table")));
}
use of org.apache.beam.sdk.transforms.display.DisplayData in project beam by apache.
the class BigQueryIOTest method testBuildSourceDisplayDataTable.
@Test
public void testBuildSourceDisplayDataTable() {
String tableSpec = "project:dataset.tableid";
BigQueryIO.Read read = BigQueryIO.read().from(tableSpec).withoutResultFlattening().usingStandardSql().withoutValidation();
DisplayData displayData = DisplayData.from(read);
assertThat(displayData, hasDisplayItem("table", tableSpec));
assertThat(displayData, hasDisplayItem("flattenResults", false));
assertThat(displayData, hasDisplayItem("useLegacySql", false));
assertThat(displayData, hasDisplayItem("validation", false));
}
use of org.apache.beam.sdk.transforms.display.DisplayData in project beam by apache.
the class BigQueryIOTest method testBuildSourceDisplayDataQuery.
@Test
public void testBuildSourceDisplayDataQuery() {
BigQueryIO.Read read = BigQueryIO.read().fromQuery("myQuery").withoutResultFlattening().usingStandardSql().withoutValidation();
DisplayData displayData = DisplayData.from(read);
assertThat(displayData, hasDisplayItem("query", "myQuery"));
assertThat(displayData, hasDisplayItem("flattenResults", false));
assertThat(displayData, hasDisplayItem("useLegacySql", false));
assertThat(displayData, hasDisplayItem("validation", false));
}
use of org.apache.beam.sdk.transforms.display.DisplayData in project beam by apache.
the class TextIOTest method testWriteDisplayDataValidateThenHeader.
@Test
public void testWriteDisplayDataValidateThenHeader() {
TextIO.Write write = TextIO.write().to("foo").withHeader("myHeader");
DisplayData displayData = DisplayData.from(write);
assertThat(displayData, hasDisplayItem("fileHeader", "myHeader"));
}
use of org.apache.beam.sdk.transforms.display.DisplayData in project beam by apache.
the class TextIOTest method testPrimitiveReadDisplayData.
@Test
@Category(ValidatesRunner.class)
public void testPrimitiveReadDisplayData() {
DisplayDataEvaluator evaluator = DisplayDataEvaluator.create();
TextIO.Read read = TextIO.read().from("foobar");
Set<DisplayData> displayData = evaluator.displayDataForPrimitiveSourceTransforms(read);
assertThat("TextIO.Read should include the file prefix in its primitive display data", displayData, hasItem(hasDisplayItem(hasValue(startsWith("foobar")))));
}
Aggregations