class IntegerColumnReference extends LuceneCollectorExpression<Integer> {

    private final String columnName;
    private SortedNumericDocValues values;
    private int docId;

    public IntegerColumnReference(String columnName) {
        this.columnName = columnName;
    }

    @Override
    public Integer value() {<FILL_FUNCTION_BODY>}

    @Override
    public void setNextDocId(int docId) {
        this.docId = docId;
    }

    @Override
    public void setNextReader(ReaderContext context) throws IOException {
        super.setNextReader(context);
        values = DocValues.getSortedNumeric(context.reader(), columnName);
    }

    @Override
    public boolean equals(Object obj) {
        if (obj == null)
            return false;
        if (obj == this)
            return true;
        if (!(obj instanceof IntegerColumnReference))
            return false;
        return columnName.equals(((IntegerColumnReference) obj).columnName);
    }

    @Override
    public int hashCode() {
        return columnName.hashCode();
    }
}

        try {
            if (values.advanceExact(docId)) {
                switch (values.docValueCount()) {
                    case 1:
                        return (int) values.nextValue();

                    default:
                        throw new ArrayViaDocValuesUnsupportedException(columnName);
                }
            } else {
                return null;
            }
        } catch (IOException e) {
            throw new UncheckedIOException(e);
        }
    
<methods>public void setNextDocId(int) ,public void setNextReader(io.crate.execution.engine.fetch.ReaderContext) throws java.io.IOException,public void setScorer(Scorable) ,public void startCollect(io.crate.expression.reference.doc.lucene.CollectorContext) <variables>