Skip to content
This repository has been archived by the owner on Aug 2, 2022. It is now read-only.

Optimize Project Operator in Logical Plan #934

Open
penghuo opened this issue Dec 15, 2020 · 0 comments
Open

Optimize Project Operator in Logical Plan #934

penghuo opened this issue Dec 15, 2020 · 0 comments

Comments

@penghuo
Copy link
Contributor

penghuo commented Dec 15, 2020

Because the top projection should always refer the attributes refer in the bottom projection, the adjacent Projection operator could be merged into one Projection.

  • Project — Project ----> Project

e.g. Project(a, b) — Project(a, b, c) — AnyOtherOperator ----> Project(a, b) — AnyOtherOperator
When considering the complex cases Project(A/B as C, A*B as D) — Project(a as A, a/b as B), there are two approach to think the problems,

  1. Merge to the single one, Project(a/(a/b) as C, a * (a/b) as D).
  2. Keep the original Project, only push down the attribute select which related to original doc. The result should be Project(A/B as C, A*B as D) — Project(a as A, a/b as B) — Project(a, b) — AnyOtherOperator

Note: with our current solution, we can not differencated which the ReferenceExpression refer the attribute of the original doc or refer the attribute of the intermediate doc.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant