Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support nested expressions #258

Open
EpsilonPrime opened this issue Aug 8, 2024 · 0 comments
Open

Support nested expressions #258

EpsilonPrime opened this issue Aug 8, 2024 · 0 comments

Comments

@EpsilonPrime
Copy link
Member

EpsilonPrime commented Aug 8, 2024

Nested expressions were added to Substrait in substrait-io/substrait#351 (part of release 0.36.0). When given a plan with a nested expression, the validator complains that nested is not one of the valid expression types (which is expected because the validator currently only supports release 0.20.0).

Fatal error:
  Failed to parse relations field: Failed to parse input field: Failed to parse expressions field: Message type "substrait.Expression" has no field named "nested" at "Plan.relations[0].root.input.project.expressions[0]".
   Available Fields(except extensions): "['literal', 'selection', 'scalarFunction', 'windowFunction', 'ifThen', 'switchExpression', 'singularOrList', 'multiOrList', 'cast', 'subquery', 'enum']"...
{
  "relations": [
    {
      "root": {
        "input": {
          "project": {
            "input": {
              "read": {
                "baseSchema": {
                  "names": [
                    "s_suppkey",
                    "s_name",
                    "s_address",
                    "s_nationkey",
                    "s_phone",
                    "s_acctbal",
                    "s_comment"
                  ],
                  "struct": {
                    "types": [
                      {
                        "i64": {
                          "nullability": "NULLABILITY_REQUIRED"
                        }
                      },
                      {
                        "string": {
                          "nullability": "NULLABILITY_REQUIRED"
                        }
                      },
                      {
                        "string": {
                          "nullability": "NULLABILITY_REQUIRED"
                        }
                      },
                      {
                        "i32": {
                          "nullability": "NULLABILITY_REQUIRED"
                        }
                      },
                      {
                        "string": {
                          "nullability": "NULLABILITY_REQUIRED"
                        }
                      },
                      {
                        "decimal": {
                          "scale": 2,
                          "precision": 15,
                          "nullability": "NULLABILITY_REQUIRED"
                        }
                      },
                      {
                        "string": {
                          "nullability": "NULLABILITY_REQUIRED"
                        }
                      }
                    ],
                    "nullability": "NULLABILITY_REQUIRED"
                  }
                },
                "projection": {
                  "select": {
                    "structItems": [
                      {
                        "field": 1
                      },
                      {
                        "field": 5
                      }
                    ]
                  },
                  "maintainSingularStruct": true
                },
                "namedTable": {
                  "names": [
                    "supplier"
                  ]
                }
              }
            },
            "expressions": [
              {
                "nested": {
                  "nullable": true,
                  "struct": {
                    "fields": [
                      {
                        "selection": {
                          "directReference": {
                            "structField": {}
                          },
                          "rootReference": {}
                        }
                      },
                      {
                        "selection": {
                          "directReference": {
                            "structField": {
                              "field": 1
                            }
                          },
                          "rootReference": {}
                        }
                      }
                    ]
                  }
                }
              }
            ]
          }
        },
        "names": [
          "supplier",
          "name",
          "acctbal"
        ]
      }
    }
  ],
  "version": {
    "minorNumber": 48,
    "producer": "hand-generated"
  }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant