Skip to content

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

Open

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?

Activity

  1. added
    enhancement
    on Jun 10, 2025
  2. added
    PPL
    calcite
    and removed on Jun 10, 2025
  3. changed the title [-][FEATURE] Support creating typed arrays with Calcite[/-] [+][FEATURE] Support creating typed arrays & structs with Calcite[/+] on Jun 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    PPLcalciteenhancement

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions