Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,11 @@ public static ExprType convertSqlTypeNameToExprType(SqlTypeName sqlTypeName) {
INTERVAL;
case ARRAY -> ARRAY;
case MAP -> STRUCT;
// Calcite spells a struct as ROW. convertExprTypeToRelDataType builds STRUCT as
// MAP<VARCHAR, ANY> since the v2 path only passes _source JSON through, so a genuine ROW —
// from an engine that builds a struct out of typed columns — matched nothing and fell
// through to UNKNOWN.
case ROW -> STRUCT;
case GEOMETRY -> GEO_POINT;
case NULL, ANY, OTHER -> UNDEFINED;
default -> UNKNOWN;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,12 @@ public void testConvertExprTypeBinaryToNullableVarbinary() {
assertTrue(result.isNullable());
}

@Test
public void testConvertRowReturnsStructExprType() {
assertEquals(
ExprCoreType.STRUCT, OpenSearchTypeFactory.convertSqlTypeNameToExprType(SqlTypeName.ROW));
}

// ---------- convertAnalyticsEngineRelDataTypeToExprType ----------
// UDT-aware variant for the response-schema path. Must agree with the
// planner-internal convertRelDataTypeToExprType on every non-UDT input.
Expand Down
Loading