Skip to content
Merged
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 @@ -64,7 +64,20 @@ public enum FieldType {
* placeholder; {@link #fromMappingType} keeps working unchanged because no source
* advertises that mapping string.
*/
ARRAY("array");
ARRAY("array"),

/**
* Map-typed expression result. First in-tree producer is PPL `spath`'s auto-extract mode
* (`JSON_EXTRACT_ALL` returns {@code MAP<VARCHAR, VARCHAR>}). Mapping string is {@code
* "map"} as a placeholder — no OpenSearch storage format declares this mapping today, so
* {@link #fromMappingType} never resolves to it through the mapping path; columns reach
* MAP only through {@link #fromSqlTypeName}. Capability registrations for filter / project
* operators on MAP columns are intentionally minimal: callers (e.g. PPL `where doc.user.name`)
* always wrap the MAP column in an ITEM lookup whose result type is the map's value type,
* so the EQUALS / sort / aggregate operators see the value-level type by the time the
* runtime executes them.
*/
MAP("map");

private final String mappingType;

Expand Down Expand Up @@ -127,6 +140,7 @@ public static FieldType fromSqlTypeName(SqlTypeName sqlTypeName) {
case BOOLEAN -> FieldType.BOOLEAN;
case BINARY, VARBINARY -> FieldType.BINARY;
case ARRAY -> FieldType.ARRAY;
case MAP -> FieldType.MAP;
default -> null;
};
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,7 @@ public enum ScalarFunction {
JSON_DELETE(Category.SCALAR, SqlKind.OTHER_FUNCTION),
JSON_EXTEND(Category.SCALAR, SqlKind.OTHER_FUNCTION),
JSON_EXTRACT(Category.SCALAR, SqlKind.OTHER_FUNCTION),
JSON_EXTRACT_ALL(Category.SCALAR, SqlKind.OTHER_FUNCTION),
JSON_KEYS(Category.SCALAR, SqlKind.OTHER_FUNCTION),
JSON_SET(Category.SCALAR, SqlKind.OTHER_FUNCTION),

Expand Down
Loading
Loading