Search in sources :

Example 1 with GroupByOnArrayUnsupportedException

use of io.crate.exceptions.GroupByOnArrayUnsupportedException in project crate by crate.

the class GeoPointColumnReference method setNextDocId.

@Override
public void setNextDocId(int docId) {
    super.setNextDocId(docId);
    values.setDocument(docId);
    switch(values.count()) {
        case 0:
            value = null;
            break;
        case 1:
            GeoPoint gp = values.valueAt(0);
            value = new Double[] { gp.lon(), gp.lat() };
            break;
        default:
            throw new GroupByOnArrayUnsupportedException(columnName);
    }
}
Also used : GeoPoint(org.elasticsearch.common.geo.GeoPoint) GroupByOnArrayUnsupportedException(io.crate.exceptions.GroupByOnArrayUnsupportedException)

Example 2 with GroupByOnArrayUnsupportedException

use of io.crate.exceptions.GroupByOnArrayUnsupportedException in project crate by crate.

the class IpColumnReference method setNextDocId.

@Override
public void setNextDocId(int docId) {
    super.setNextDocId(docId);
    values.setDocument(docId);
    switch(values.count()) {
        case 0:
            value = null;
            break;
        case 1:
            value = new BytesRef(IpFieldMapper.longToIp(values.valueAt(0)));
            break;
        default:
            throw new GroupByOnArrayUnsupportedException(columnName);
    }
}
Also used : GroupByOnArrayUnsupportedException(io.crate.exceptions.GroupByOnArrayUnsupportedException) BytesRef(org.apache.lucene.util.BytesRef)

Aggregations

GroupByOnArrayUnsupportedException (io.crate.exceptions.GroupByOnArrayUnsupportedException)2 BytesRef (org.apache.lucene.util.BytesRef)1 GeoPoint (org.elasticsearch.common.geo.GeoPoint)1