in src/main/java/com/google/cloud/solutions/autotokenize/datacatalog/MakeDataCatalogItems.java [83:110]
public void processColumns(
@Element InspectionReport inspectionReport,
OutputReceiver<UpdatableDataCatalogItems> outputReceiver) {
var catalogSchemaAndFlatKeys =
convertToCatalogSchemaMapping(inspectionReport.getAvroSchema());
var entry =
new EntryCreator(inspectionReport, catalogSchemaAndFlatKeys.getCatalogSchema())
.buildEntry();
var tags =
new SensitiveTagsCreator(
inspectionReport, catalogSchemaAndFlatKeys.getFlatSchemaKeyMappingMap())
.buildTags();
if (entry.isPresent() || (tags.isPresent() && !tags.get().isEmpty())) {
var updatableItemsBuilder =
UpdatableDataCatalogItems.newBuilder()
.setSourceType(inspectionReport.getSourceType())
.setInputPattern(inspectionReport.getInputPattern());
entry.ifPresent(updatableItemsBuilder::setEntry);
tags.ifPresent(updatableItemsBuilder::addAllTags);
outputReceiver.output(updatableItemsBuilder.build());
}
}