presto-elasticsearch/src/main/java/io/prestosql/elasticsearch/decoders/BooleanDecoder.java/BooleanDecoder/decode
class BooleanDecoder:    @Override
    public void decode(SearchHit hit, Supplier<Object> getter, BlockBuilder output)
    {
        Object value = getter.get();
        if (value == null) {
            output.appendNull();
        }
        else if (value instanceof Boolean) {
            BOOLEAN.writeBoolean(output, (Boolean) value);
        }
        else {
            throw new PrestoException(TYPE_MISMATCH, "Expected a boolean value for BOOLEAN field");
        }
    }