presto-elasticsearch/src/main/java/io/prestosql/elasticsearch/ElasticsearchMetadata.java/ElasticsearchMetadata/toColumnMetadata
class ElasticsearchMetadata:    private List<ColumnMetadata> toColumnMetadata(IndexMetadata metadata)
    {
        ImmutableList.Builder<ColumnMetadata> result = ImmutableList.builder();

        result.add(BuiltinColumns.ID.getMetadata());
        result.add(BuiltinColumns.SOURCE.getMetadata());
        result.add(BuiltinColumns.SCORE.getMetadata());

        for (IndexMetadata.Field field : metadata.getSchema().getFields()) {
            Type type = toPrestoType(field.getType());
            if (type == null) {
                continue;
            }

            result.add(makeColumnMetadata(field.getName(), type));
        }

        return result.build();
    }