From 46d7f0acad4eb0cc9c03e8e05c239c6991d016ea Mon Sep 17 00:00:00 2001 From: Rafael Biehler Date: Sat, 7 Dec 2024 16:52:58 +0100 Subject: [PATCH] Add canAssign from CHAR and VARCHAR to PolyGeometry Makes the validation pass, which results in a better error message later. --- core/src/main/java/org/polypheny/db/type/PolyTypeUtil.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/core/src/main/java/org/polypheny/db/type/PolyTypeUtil.java b/core/src/main/java/org/polypheny/db/type/PolyTypeUtil.java index 538921a6f8..5843e01071 100644 --- a/core/src/main/java/org/polypheny/db/type/PolyTypeUtil.java +++ b/core/src/main/java/org/polypheny/db/type/PolyTypeUtil.java @@ -519,6 +519,12 @@ public static boolean canAssignFrom( AlgDataType toType, AlgDataType fromType ) return false; } + if ( toType.getPolyType().getFamily() == PolyTypeFamily.GEO ) { + if ( fromType.getPolyType() == PolyType.CHAR || fromType.getPolyType() == PolyType.VARCHAR ) { + return true; + } + } + return toType.getFamily() == fromType.getFamily(); }