class VersionCollectorExpression extends LuceneCollectorExpression<Long> {

    private NumericDocValues versions = null;
    private int docId;

    @Override
    public void setNextReader(ReaderContext context) throws IOException {
        try {
            versions = context.reader().getNumericDocValues(DocSysColumns.VERSION.name());
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
    }

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

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

        try {
            if (versions != null && versions.advanceExact(docId)) {
                return versions.longValue();
            }
        } catch (IOException e) {
            throw new UncheckedIOException(e);
        }
        return null;
    
<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>