Skip to content

Substrait: FieldReference not created correctly; missing a RootType #13645

@mbwhite

Description

@mbwhite

Describe the bug

The FieldReference in Substrait is defined with root_type being oneof

  message FieldReference {

    // Whether this reference has an origin of a root struct or is based on the
    // ouput of an expression. When this is a RootReference and direct_reference
    // above is used, the direct_reference must be of a type StructField.
    oneof root_type {
      Expression expression = 3;
      RootReference root_reference = 4;
      OuterReference outer_reference = 5;
    }

A RootReference message is defined, that is empty but is used in most cases I've seen.

The code [here] (

) sets this to None.

When this is serialized to a protobuf and read by other engines (Substrait=Java in my case) this fails. with a
Unhandled type: ROOTTYPE_NOT_SET

To Reproduce

Create a DataFusion plan, and then try and consume it within say SubstraitJava

Expected behavior

The protobuf should be valid and parse correctly

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions