Details
-
Bug
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
1.28.0
Description
Attempting to follow on the suggestions from Julian in this thread, found a potential improvement.
Given a table schema containing a repeated array of structs and a query projecting fields of that struct via UNNEST, the present implementation of getFieldOrigins in SqlValidatorImpl will return a list representation suggesting that the subfield is actually a member of the top level table row type.
For example, when using the DEPT_NESTED table from the MockCatalogReaderSimple within tests with the following query:
select e.empno from dept_nested, unnest(employees) as e
The return value currently is:
{CATALOG.SALES.DEPT_NESTED.EMPNO}
Rather than:
{CATALOG.SALES.DEPT_NESTED.EMPLOYEES.EMPNO}
No such column EMPNO exists in the root schema of the DEPT_NESTED table. The javadoc for the method however suggests that the return from this method should always be four entries long, although it would seem this doesn't account for nesting. Is this intended behavior, or should column entry of this list be of variable length?
Attachments
Issue Links
- links to