presto-elasticsearch/src/main/java/io/prestosql/elasticsearch/ElasticsearchPageSource.java/ElasticsearchPageSource/createDecoder
class ElasticsearchPageSource:    private Decoder createDecoder(ConnectorSession session, String path, Type type)
    {
        if (type.equals(VARCHAR)) {
            return new VarcharDecoder();
        }
        else if (type.equals(VARBINARY)) {
            return new VarbinaryDecoder();
        }
        else if (type.equals(TIMESTAMP)) {
            return new TimestampDecoder(session, path);
        }
        else if (type.equals(BOOLEAN)) {
            return new BooleanDecoder();
        }
        else if (type.equals(DOUBLE)) {
            return new DoubleDecoder();
        }
        else if (type.equals(REAL)) {
            return new RealDecoder();
        }
        else if (type.equals(TINYINT)) {
            return new TinyintDecoder();
        }
        else if (type.equals(SMALLINT)) {
            return new SmallintDecoder();
        }
        else if (type.equals(INTEGER)) {
            return new IntegerDecoder();
        }
        else if (type.equals(BIGINT)) {
            return new BigintDecoder();
        }
        else if (type instanceof RowType) {
            RowType rowType = (RowType) type;

            List<Decoder> decoders = rowType.getFields().stream()
                    .map(field -> createDecoder(session, appendPath(path, field.getName().get()), field.getType()))
                    .collect(toImmutableList());

            List<String> fieldNames = rowType.getFields().stream()
                    .map(RowType.Field::getName)
                    .map(Optional::get)
                    .collect(toImmutableList());

            return new RowDecoder(fieldNames, decoders);
        }

        throw new UnsupportedOperationException("Type not supported: " + type);
    }