Hello everyone,

I've got issue while converting query with struct column. Struct's fields
are flattened while conversion to rel is performed.
But later they aren't collected back so query plan may produce incorrect
result.

For example [1], consider table *str_table* with just one column *str* of
type STRUCT<name VARCHAR(10), age INTEGER>,
then query SELECT *str* FROM *str_table* produces plan

LogicalProject(STR=[$0])
   LogicalProject(STR=[$0.name], STR1=[$0.age])
      LogicalTableScan(table=[[CATALOG, STRUCT, STR_TABLE]])

where top level project returns nested field `name` as `str` instead of
original struct column. My question is, what is the correct
way to collect back the flattened fields and produce correct result for the
query ?

[1] -
https://github.com/ihuzenko/calcite/commit/e24eaa22fbb5c950a0bd5290cc09ca56ea7f1e44

Thank you in advance,
Igor Guzenko

Reply via email to