presto-elasticsearch/src/main/java/io/prestosql/elasticsearch/ElasticsearchMetadata.java/ElasticsearchMetadata/toPrestoType
class ElasticsearchMetadata:    private Type toPrestoType(IndexMetadata.Type type)
    {
        if (type instanceof PrimitiveType) {
            switch (((PrimitiveType) type).getName()) {
                case "float":
                    return REAL;
                case "double":
                    return DOUBLE;
                case "byte":
                    return TINYINT;
                case "short":
                    return SMALLINT;
                case "integer":
                    return INTEGER;
                case "long":
                    return BIGINT;
                case "string":
                case "text":
                case "keyword":
                    return VARCHAR;
                case "boolean":
                    return BOOLEAN;
                case "binary":
                    return VARBINARY;
            }
        }
        else if (type instanceof DateTimeType) {
            if (((DateTimeType) type).getFormats().isEmpty()) {
                return TIMESTAMP;
            }
            // otherwise, skip -- we don't support custom formats, yet
        }
        else if (type instanceof ObjectType) {
            ObjectType objectType = (ObjectType) type;

            List<RowType.Field> fields = objectType.getFields().stream()
                    .map(field -> RowType.field(field.getName(), toPrestoType(field.getType())))
                    .collect(toImmutableList());

            return RowType.from(fields);
        }

        return null;
    }