private ColumnSchemaFlatKeys processRecord()

in src/main/java/com/google/cloud/solutions/autotokenize/common/AvroSchemaToCatalogSchema.java [171:187]


    private ColumnSchemaFlatKeys processRecord() {
      var fieldSchemaAndKeys = extractRecordFields();

      var flatKeys =
          fieldSchemaAndKeys.stream()
              .flatMap(ColumnSchemaFlatKeys::flatKeyEntriesStream)
              .distinct()
              .collect(toImmutableMap(Map.Entry::getKey, Map.Entry::getValue));

      var colSchemas =
          fieldSchemaAndKeys.stream()
              .map(ColumnSchemaFlatKeys::columnSchema)
              .collect(toImmutableList());

      var recordSchema = schemaBuilder().addAllSubcolumns(colSchemas).build();
      return ColumnSchemaFlatKeys.of(recordSchema, flatKeys);
    }