presto-elasticsearch/src/main/java/io/prestosql/elasticsearch/client/ElasticsearchClient.java/ElasticsearchClient/parseType
class ElasticsearchClient:    private IndexMetadata.ObjectType parseType(JsonNode properties)
    {
        Iterator<Map.Entry<String, JsonNode>> entries = properties.fields();

        ImmutableList.Builder<IndexMetadata.Field> result = ImmutableList.builder();
        while (entries.hasNext()) {
            Map.Entry<String, JsonNode> field = entries.next();

            String name = field.getKey();
            JsonNode value = field.getValue();
            if (value.has("type")) {
                String type = value.get("type").asText();

                if (type.equals("date")) {
                    List<String> formats = ImmutableList.of();
                    if (value.has("format")) {
                        formats = Arrays.asList(value.get("format").asText().split("\\|\\|"));
                    }
                    result.add(new IndexMetadata.Field(name, new IndexMetadata.DateTimeType(formats)));
                }
                else {
                    result.add(new IndexMetadata.Field(name, new IndexMetadata.PrimitiveType(type)));
                }
            }
            else if (value.has("properties")) {
                result.add(new IndexMetadata.Field(name, parseType(value.get("properties"))));
            }
        }

        return new IndexMetadata.ObjectType(result.build());
    }