The struct type has to be fully qualified up front so recursive definitions
are not possible.

Node {
  Node left;
  Node right;
};

It may still be able to define tree-like structures similar to the second
example

Node {
  Object left; // it can be Node or other type
  Object right;
};

but it wouldn't be possible to write SQL queries exploiting them using the
DOT syntax.

I don't know what the standard says but from a quick test on Postgres
defining such structures is not possible either.



2018-08-11 15:15 GMT+03:00 Vladimir Sitnikov <sitnikov.vladi...@gmail.com>:

> Stamatis>They're already supported by the SQL parser and the relational
> algebra and
> Stamatis>soon (<https://issues.apache.org/jira/browse/CALCITE-2404>) they
> will be
> Stamatis>supported also by the execution engine in the enumerable
> convention.
>
> Does it require struct type to be fully qualified upfront?
>
> For instance, can it support tree-like structures like the following?
>
> Node {
>   Node left;
>   Node right;
> };
>
> or something like
>
> Node {
>   Object left; // it can be Node or other type
>   Object right;
> };
>
> Vladimir
>

Reply via email to