class SourceSchemas {

  boolean matchesNonValueField(final Optional<SourceName> source, final ColumnName column) {
    if (!source.isPresent()) {
      return sourceSchemas.values().stream()
          .anyMatch(schema -> SystemColumns.isPseudoColumn(column) || schema.isKeyColumn(column));
    }

    final SourceName sourceName = source.get();
    final LogicalSchema sourceSchema = sourceSchemas.get(sourceName);
    if (sourceSchema == null) {
      throw new IllegalArgumentException("Unknown source: " + sourceName);
    }

    return sourceSchema.isKeyColumn(column) || SystemColumns.isPseudoColumn(column);
  }

    SourceSchemas(final Map<SourceName, LogicalSchema> sourceSchemas);

}