Skip to content

[FEATURE] Support creating typed arrays & structs with Calcite #3751

@yuancu

Description

@yuancu

Is your feature request related to a problem?

Currently all arrays are created with type array<any>.

Reason: in OpenSearchTypeFactory.java#L176:

public static RelDataType convertExprTypeToRelDataType(ExprType fieldType, boolean nullable) 
...
        case ARRAY:
          return TYPE_FACTORY.createArrayType(
              TYPE_FACTORY.createSqlType(SqlTypeName.ANY, nullable), -1);

This raises a number of problem since we can not infer element types. E.g. when expanding an array, we can't know the element type until runtime.

What solution would you like?
Support creating array types with known element types.

What alternatives have you considered?
Not yet

Do you have any additional context?

Metadata

Metadata

Assignees

No one assigned

    Labels

    PPLPiped processing languagecalcitecalcite migration releatedenhancementNew feature or request

    Type

    No type

    Projects

    Status

    Not Started

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions