class GeoShapeType extends DataType<Map<String, Object>> implements Streamer<Map<String, Object>> {

    public static final int ID = 14;
    public static final GeoShapeType INSTANCE = new GeoShapeType();
    private static final StorageSupport<Map<String, Object>> STORAGE = new StorageSupport<>(false, false, null) {

        @Override
        public ValueIndexer<Map<String, Object>> valueIndexer(RelationName table,
                                                              Reference ref,
                                                              Function<String, FieldType> getFieldType,
                                                              Function<ColumnIdent, Reference> getRef) {
            return new GeoShapeIndexer(ref, getFieldType.apply(ref.storageIdent()));
        }
    };

    private GeoShapeType() {
    }

    @Override
    public int id() {
        return ID;
    }

    @Override
    public Precedence precedence() {
        return Precedence.GEO_SHAPE;
    }

    @Override
    public String getName() {
        return "geo_shape";
    }

    @Override
    public Streamer<Map<String, Object>> streamer() {
        return this;
    }

    @Override
    @SuppressWarnings("unchecked")
    public Map<String, Object> implicitCast(Object value) throws IllegalArgumentException, ClassCastException {
        if (value == null) {
            return null;
        } else if (value instanceof String) {
            return GeoJSONUtils.wkt2Map(BytesRefs.toString(value));
        } else if (value instanceof Point point) {
            return GeoJSONUtils.shape2Map(SpatialContext.GEO.getShapeFactory().pointXY(point.getX(), point.getY()));
        } else if (value instanceof Shape shape) {
            return GeoJSONUtils.shape2Map(shape);
        } else if (value instanceof Map<?, ?> map) {
            GeoJSONUtils.validateGeoJson(map);
            return (Map<String, Object>) value;
        } else {
            throw new ClassCastException("Can't cast '" + value + "' to " + getName());
        }
    }

    @Override
    @SuppressWarnings("unchecked")
    public Map<String, Object> sanitizeValue(Object value) {
        if (value == null) {
            return null;
        } else if (value instanceof Map<?, ?> map) {
            GeoJSONUtils.validateGeoJson(map);
            return (Map<String, Object>) value;
        } else {
            return GeoJSONUtils.shape2Map((Shape) value);
        }
    }

    @Override
    public int compare(Map<String, Object> val1, Map<String, Object> val2) {<FILL_FUNCTION_BODY>}

    @Override
    public Map<String, Object> readValueFrom(StreamInput in) throws IOException {
        return in.readMap();
    }

    @Override
    public void writeValueTo(StreamOutput out, Map<String, Object> v) throws IOException {
        out.writeMap(v);
    }

    @Override
    public StorageSupport<Map<String, Object>> storageSupport() {
        return STORAGE;
    }

    @Override
    public long valueBytes(Map<String, Object> value) {
        if (value == null) {
            return RamUsageEstimator.NUM_BYTES_OBJECT_HEADER;
        }
        return RamUsageEstimator.sizeOfMap(value);
    }
}

        // TODO: compare without converting to shape
        Shape shape1 = GeoJSONUtils.map2Shape(val1);
        Shape shape2 = GeoJSONUtils.map2Shape(val2);
        return switch (shape1.relate(shape2)) {
            case WITHIN -> -1;
            case CONTAINS -> 1;
            default -> Double.compare(shape1.getArea(JtsSpatialContext.GEO), shape2.getArea(JtsSpatialContext.GEO));
        };
    
<methods>public non-sealed void <init>() ,public void addMappingOptions(Map<java.lang.String,java.lang.Object>) ,public java.lang.Integer characterMaximumLength() ,public ColumnStatsSupport<Map<java.lang.String,java.lang.Object>> columnStatsSupport() ,public int compareTo(DataType<?>) ,public boolean equals(java.lang.Object) ,public Map<java.lang.String,java.lang.Object> explicitCast(java.lang.Object, io.crate.metadata.settings.SessionSettings) throws java.lang.IllegalArgumentException, java.lang.ClassCastException,public abstract java.lang.String getName() ,public List<DataType<?>> getTypeParameters() ,public io.crate.types.TypeSignature getTypeSignature() ,public int hashCode() ,public abstract int id() ,public Map<java.lang.String,java.lang.Object> implicitCast(java.lang.Object) throws java.lang.IllegalArgumentException, java.lang.ClassCastException,public boolean isConvertableTo(DataType<?>, boolean) ,public java.lang.Integer numericPrecision() ,public abstract io.crate.types.DataType.Precedence precedence() ,public boolean precedes(DataType<?>) ,public long ramBytesUsed() ,public abstract Map<java.lang.String,java.lang.Object> sanitizeValue(java.lang.Object) ,public StorageSupport<? super Map<java.lang.String,java.lang.Object>> storageSupport() ,public final StorageSupport<? super Map<java.lang.String,java.lang.Object>> storageSupportSafe() ,public abstract Streamer<Map<java.lang.String,java.lang.Object>> streamer() ,public ColumnType<io.crate.sql.tree.Expression> toColumnType(io.crate.sql.tree.ColumnPolicy, Supplier<List<ColumnDefinition<io.crate.sql.tree.Expression>>>) ,public java.lang.String toString() ,public abstract long valueBytes(Map<java.lang.String,java.lang.Object>) ,public Map<java.lang.String,java.lang.Object> valueForInsert(Map<java.lang.String,java.lang.Object>) ,public final ValueIndexer<? super Map<java.lang.String,java.lang.Object>> valueIndexer(io.crate.metadata.RelationName, io.crate.metadata.Reference, Function<java.lang.String,FieldType>, Function<io.crate.metadata.ColumnIdent,io.crate.metadata.Reference>) ,public void writeTo(org.elasticsearch.common.io.stream.StreamOutput) throws java.io.IOException<variables>