Where can Table Function be used?
I'm trying to understand how to use Table Function in Substrait. I looked at the docs at https://substrait.io/expressions/table_functions/ , but there are no explanation of how to use these. Is there some other place I can check?
I'd like to find out whether I could use Table Function to implement Presto's UNNEST: https://prestodb.io/docs/current/sql/select.html#unnest
Thanks.
Support for table functions is still something that needs to be hammered out. There's the beginnings of a conversation in https://github.com/substrait-io/substrait/issues/753.
In the meanwhile, something that I have seen done to model Unnest is the introduction of a custom Rel like
message UnnestRel {
repeated uint32 col_refs = 1;
}
in your system for use in an ExtensionSingleRel.
@vbarua Got it. Thank you for clarifying.
I have opened up a draft PR here to explore implementing table functions which do not take in any relations as inputs. Please let me know what you think!
sources:
-
calcite
- represents Table Functions as a distinct relation
- does offer the facility to accept relational-inputs, but my PR ignores that use case for now so that it can be explored later.