Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
-
None
-
None
Description
The RelBuilder.project method should combine expressions if underlying node is a Project.
For example, if r is a RelBuilder and its stack initially contains
Project(Scan(T), a, b, a + b as c)
and we call (in pseudo-code)
r.project(a + c as d)
then the result should be
Project(Scan(T), a + (a + b) as d)
Today the result is
Project(Project(Scan(T), a, a + b as c), a + c as d)
In some circumstances the result will be larger (i.e. contain more RexNode instances) but much more frequently the result will be smaller and simpler.