kosiew commented on code in PR #15993:
URL: https://github.com/apache/datafusion/pull/15993#discussion_r2080888952
##########
datafusion/sql/src/relation/mod.rs:
##########
@@ -241,7 +246,7 @@ fn optimize_subquery_sort(plan: LogicalPlan) ->
Result<Transformed<LogicalPlan>>
}
match c {
LogicalPlan::Sort(s) => {
- if !has_limit {
+ if !has_limit && enalbe_eliminate {
Review Comment:
enable_eliminate
##########
datafusion/sql/tests/sql_integration.rs:
##########
@@ -3385,6 +3387,7 @@ fn
ident_normalization_parser_options_ident_normalization() -> ParserOptions {
map_varchar_to_utf8view: false,
enable_options_value_normalization: false,
collect_spans: false,
+ enable_eliminate_subquery_sort: true,
}
}
Review Comment:
Would it be a good idea to add tests for
`enable_eliminate_subquery_sort: false`
too?
##########
datafusion/sql/src/relation/mod.rs:
##########
@@ -226,7 +228,10 @@ impl<S: ContextProvider> SqlToRel<'_, S> {
}
}
-fn optimize_subquery_sort(plan: LogicalPlan) ->
Result<Transformed<LogicalPlan>> {
+fn optimize_subquery_sort(
+ plan: LogicalPlan,
+ enalbe_eliminate: bool,
Review Comment:
This should be
```rust
enable_eliminate: bool
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]