Skip to content

Move optimize_subquery_sort into optimizer as a new rule EliminateSort #15435

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

Open
jayzhan211 opened this issue Mar 26, 2025 · 4 comments · May be fixed by #15441
Open

Move optimize_subquery_sort into optimizer as a new rule EliminateSort #15435

jayzhan211 opened this issue Mar 26, 2025 · 4 comments · May be fixed by #15441
Assignees

Comments

@jayzhan211
Copy link
Contributor

          I have no idea why we have optimize plan rule `optimize_subquery_sort` in `create_relation`, I think we should move such rule to optimizer 🤔

Originally posted by @jayzhan211 in #15300 (comment)

@jayzhan211 jayzhan211 changed the title Move optimize_subquery_sort into optimizer EliminateSort Move optimize_subquery_sort into optimizer as a new rule EliminateSort Mar 26, 2025
@acking-you
Copy link
Contributor

take

@irenjj
Copy link
Contributor

irenjj commented Mar 26, 2025

Using datafusion-optimizer in datafusion-sql can lead to dependency issue:

thread 'main' panicked at src/main.rs:84:9:
circular dependency detected from datafusion-optimizer to self via one of {"datafusion-functions-window", "datafusion-functions-window-common", "datafusion-expr-common", "datafusion-expr", "datafusion-physical-expr", "datafusion-doc", "datafusion-functions-aggregate-common", "datafusion-sql", "datafusion-execution", "datafusion-macros", "datafusion-physical-expr-common", "datafusion-functions-nested", "datafusion-functions", "datafusion-common", "datafusion-functions-aggregate"}

@jayzhan211
Copy link
Contributor Author

Using datafusion-optimizer in datafusion-sql can lead to dependency issue:

thread 'main' panicked at src/main.rs:84:9:
circular dependency detected from datafusion-optimizer to self via one of {"datafusion-functions-window", "datafusion-functions-window-common", "datafusion-expr-common", "datafusion-expr", "datafusion-physical-expr", "datafusion-doc", "datafusion-functions-aggregate-common", "datafusion-sql", "datafusion-execution", "datafusion-macros", "datafusion-physical-expr-common", "datafusion-functions-nested", "datafusion-functions", "datafusion-common", "datafusion-functions-aggregate"}

You shouldn't call the optimizer in sql, after the plan is built, we will call optimizer to rewrite the plan.

@irenjj
Copy link
Contributor

irenjj commented Mar 27, 2025

Using datafusion-optimizer in datafusion-sql can lead to dependency issue:

thread 'main' panicked at src/main.rs:84:9:
circular dependency detected from datafusion-optimizer to self via one of {"datafusion-functions-window", "datafusion-functions-window-common", "datafusion-expr-common", "datafusion-expr", "datafusion-physical-expr", "datafusion-doc", "datafusion-functions-aggregate-common", "datafusion-sql", "datafusion-execution", "datafusion-macros", "datafusion-physical-expr-common", "datafusion-functions-nested", "datafusion-functions", "datafusion-common", "datafusion-functions-aggregate"}

You shouldn't call the optimizer in sql, after the plan is built, we will call optimizer to rewrite the plan.

got it

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

Successfully merging a pull request may close this issue.

3 participants