in src/main/java/com/google/cloud/solutions/autotokenize/common/InspectionReportToTableRow.java [35:73]
public TableRow apply(InspectionReport report) {
var tableRow =
new TableRow()
.set("timestamp", Timestamps.toString(report.getTimestamp()))
.set("source_type", report.getSourceType().name())
.set("input_pattern", report.getInputPattern())
.set("avro_schema", report.getAvroSchema());
if (report.hasJdbcConfiguration()) {
tableRow.set(
"jdbc_configuration",
new TableRow()
.set("connection_url", report.getJdbcConfiguration().getConnectionUrl())
.set("driver_class_name", report.getJdbcConfiguration().getDriverClassName()));
}
if (report.getColumnReportCount() > 0) {
tableRow.set(
"column_report",
report.getColumnReportList().stream()
.map(
columnInformation ->
new TableRow()
.set("column_name", columnInformation.getColumnName())
.set(
"info_types",
columnInformation.getInfoTypesList().stream()
.map(
infoType ->
new TableRow()
.set("info_type", infoType.getInfoType())
.set("count", infoType.getCount()))
.collect(toImmutableList())))
.collect(toImmutableList()));
}
return tableRow;
}