diff --git a/plugins/postgres-adapter/src/main/java/org/polypheny/db/adapter/postgres/store/PostgresqlStore.java b/plugins/postgres-adapter/src/main/java/org/polypheny/db/adapter/postgres/store/PostgresqlStore.java index 8e95fbb1a4..e3d8d6382c 100644 --- a/plugins/postgres-adapter/src/main/java/org/polypheny/db/adapter/postgres/store/PostgresqlStore.java +++ b/plugins/postgres-adapter/src/main/java/org/polypheny/db/adapter/postgres/store/PostgresqlStore.java @@ -372,6 +372,7 @@ protected String getTypeString( PolyType type ) { return "DECIMAL"; case VARCHAR: return "VARCHAR"; + case GEOMETRY: case JSON: return "TEXT"; case DATE: diff --git a/plugins/sql-language/src/main/java/org/polypheny/db/sql/language/SqlDialect.java b/plugins/sql-language/src/main/java/org/polypheny/db/sql/language/SqlDialect.java index fa7fc6bbf6..ba9f001d9d 100644 --- a/plugins/sql-language/src/main/java/org/polypheny/db/sql/language/SqlDialect.java +++ b/plugins/sql-language/src/main/java/org/polypheny/db/sql/language/SqlDialect.java @@ -19,6 +19,7 @@ import com.google.common.base.Preconditions; import com.google.common.base.Suppliers; +import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableSet; import java.sql.ResultSet; import java.sql.Timestamp; @@ -572,11 +573,7 @@ public CalendarPolicy getCalendarPolicy() { public SqlNode getCastSpec( AlgDataType type ) { if ( type instanceof BasicPolyType ) { int precision = type.getPrecision(); - if ( type.getPolyType() == PolyType.JSON ) { - precision = 2024; - type = new PolyTypeFactoryImpl( AlgDataTypeSystem.DEFAULT ).createPolyType( PolyType.VARCHAR, precision ); - } - if ( type.getPolyType() == PolyType.NODE ) { + if ( List.of( PolyType.JSON, PolyType.NODE, PolyType.GEOMETRY ).contains( type.getPolyType() ) ) { precision = 2024; type = new PolyTypeFactoryImpl( AlgDataTypeSystem.DEFAULT ).createPolyType( PolyType.VARCHAR, precision ); } diff --git a/plugins/sql-language/src/main/java/org/polypheny/db/sql/language/dialect/HsqldbSqlDialect.java b/plugins/sql-language/src/main/java/org/polypheny/db/sql/language/dialect/HsqldbSqlDialect.java index c373b1b79b..7af6ea62c2 100644 --- a/plugins/sql-language/src/main/java/org/polypheny/db/sql/language/dialect/HsqldbSqlDialect.java +++ b/plugins/sql-language/src/main/java/org/polypheny/db/sql/language/dialect/HsqldbSqlDialect.java @@ -81,14 +81,14 @@ public SqlNode getCastSpec( AlgDataType type ) { String castSpec; switch ( type.getPolyType() ) { case ARRAY: - // We need to flag the type with a underscore to flag the type (the underscore is removed in the unparse method) + // We need to flag the type with an underscore to flag the type (the underscore is removed in the unparse method) castSpec = "_LONGVARCHAR"; break; case FILE: case IMAGE: case VIDEO: case AUDIO: - // We need to flag the type with a underscore to flag the type (the underscore is removed in the unparse method) + // We need to flag the type with an underscore to flag the type (the underscore is removed in the unparse method) castSpec = "_BLOB"; break; case INTERVAL_YEAR_MONTH: diff --git a/plugins/sql-language/src/main/java/org/polypheny/db/sql/language/dialect/MonetdbSqlDialect.java b/plugins/sql-language/src/main/java/org/polypheny/db/sql/language/dialect/MonetdbSqlDialect.java index 62ca556fc1..6169a80c2d 100644 --- a/plugins/sql-language/src/main/java/org/polypheny/db/sql/language/dialect/MonetdbSqlDialect.java +++ b/plugins/sql-language/src/main/java/org/polypheny/db/sql/language/dialect/MonetdbSqlDialect.java @@ -76,14 +76,14 @@ public SqlNode getCastSpec( AlgDataType type ) { String castSpec; switch ( type.getPolyType() ) { case ARRAY: - // We need to flag the type with a underscore to flag the type (the underscore is removed in the unparse method) + // We need to flag the type with an underscore to flag the type (the underscore is removed in the unparse method) castSpec = "_TEXT"; break; case FILE: case IMAGE: case VIDEO: case AUDIO: - // We need to flag the type with a underscore to flag the type (the underscore is removed in the unparse method) + // We need to flag the type with an underscore to flag the type (the underscore is removed in the unparse method) castSpec = "_BLOB"; break; default: