in src/main/java/com/google/cloud/solutions/autotokenize/common/TokenizeColumnNameUpdater.java [98:123]
public String encryptedColumnName(String tokenizeFlatKey) {
String[] flatKeyParts = Splitter.on(".").splitToList(tokenizeFlatKey).toArray(new String[0]);
String[] schemaKeyParts =
Splitter.on(".")
.splitToList(flatKeySchemaKey.get(tokenizeFlatKey))
.toArray(new String[0]);
String encryptFieldName = schemaKeyParts[schemaKeyParts.length - 1];
// check for field name with array operator
var fieldNameRegex = "^" + encryptFieldName + "(?:\\[\\d+\\])?$";
int fieldNameOffset = flatKeyParts[flatKeyParts.length - 1].matches(fieldNameRegex) ? 1 : 2;
int flatKeyFieldNamePartIndex = flatKeyParts.length - fieldNameOffset;
// check for type conversion for union
if (fieldNameOffset == 2) {
flatKeyParts[flatKeyParts.length - 1] = "string";
}
flatKeyParts[flatKeyFieldNamePartIndex] =
DeIdentifiedRecordSchemaConverter.DEIDENTIFIED_FIELD_NAME_PREFIX
+ flatKeyParts[flatKeyFieldNamePartIndex];
return Joiner.on(".").join(flatKeyParts);
}