Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Question]: If it's possible to design a new dsl for optimizer rules, so that we can add new optimizer by just add new rule files #1286

Open
xiaoma20082008 opened this issue Jun 3, 2024 · 1 comment
Labels
question Further information is requested

Comments

@xiaoma20082008
Copy link

Describe your problem

As we know that almost all optimizers are based on rules, just like too functions: match and replace, means that if we match the expression, then we can replace the old expression to a new expression.

so can we

  1. design a new dsl only for optimizer rule
  2. write a tiny compiler and transform the dsl to rule(eg: c++ code)
  3. then we don't need write new optimizer rules, just write the dsl code

here is an example:
if we has a Match And Replace function for Filter:

Match(Filter(AND, lhs = $1, rhs = true))  

Replace(Filter(AND, lhs = $1, rhs = true)) => $1

Then the sql expression

a = 'tom' AND b = true

can rewrite to the following directly:

a = 'tom'
@xiaoma20082008 xiaoma20082008 added the question Further information is requested label Jun 3, 2024
@JinHai-CN
Copy link
Contributor

Using a DSL to define RBO rules is a very cool approach. But, considering the road map of Infinity, we won't start the development of this feature, recently.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants