Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
None
-
None
-
None
Description
Currently, Drill could not nest a function whose output is a complex JSON object into another function directly. For instance,
select foo.mycol.x from (
select convert_from('
', 'JSON') as mycol
from cp.`tpch/nation.parquet`) as foo(mycol);
select convert_to(foo.mycol.x, 'JSON') from (
select convert_from('
', 'JSON') as mycol
from cp.`tpch/nation.parquet`) as foo(mycol);
Optiq will merge the project in the out subquery with the project in the inner subquery into one project expression. This cause issues in Drill side.
In stead, we should add or modify Optiq rule so that the two projects will stay where they are, and evaluate the convert_from () first and produce a record batch. The second project will read from the record batch, and produce its output.
Doing that will enable Drill to use out / inner subquery to refer the complex JSON object .