Skip to content

SQL planner doesn't resolve dotted field access on lambda parameters #27088

Open

Description

@LiaCastaneda

Describe the bug

e.field doesn't resolve when e is a lambda parameter of struct type. The same access on an ordinary struct column works, and get_field(e, 'field') works on the lambda parameter.

To Reproduce

-- works
SELECT array_transform(
  make_array(named_struct('rule_number', 1, 'rule_action', 'allow')),
  e -> get_field(e, 'rule_action')
);

-- fails with: Schema error: No field named e.rule_action.
SELECT array_transform(
  make_array(named_struct('rule_number', 1, 'rule_action', 'allow')),
  e -> e.rule_action
);

Expected behavior

e.rule_action resolves to the rule_action field of the lambda parameter, like get_field(e, 'rule_action').

Additional context

Split out of #25017, which now only covers the Substrait round trip.

Activity

  1. Hrushikesh-ramilla commented on Nov 8, 2026

    @Hrushikesh-ramilla

    I'd like to work on this. I'll update sql_compound_identifier_to_expr in datafusion/sql to check planner_context.lambda_parameters() and resolve dotted field accesses on lambda variables via try_plan_field_access, with test coverage in array.slt.

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions