xiedeyantu commented on code in PR #4606:
URL: https://github.com/apache/calcite/pull/4606#discussion_r2483900679
##########
core/src/main/java/org/apache/calcite/sql2rel/SqlToRelConverter.java:
##########
@@ -6534,6 +6538,17 @@ public interface Config {
* method, and use the default value of {@link #isExpand()}, false. */
Config withExpand(boolean expand);
+ /** Returns the {@code optimizeOrderBy} option. Controls whether to
optimize
+ * ORDER BY clauses using functional dependencies. If true (default is
false),
+ * redundant ORDER BY items that are determined by earlier items will be
+ * removed based on metadata about functional dependencies. */
+ @Value.Default default boolean isOptimizeOrderBy() {
Review Comment:
I agree with your point. Based on the current architecture of Calcite, if we
want to eliminate redundant items in ORDER BY, this is the most appropriate
modification method I can think of. As explained in CALCITE-7234, it is
difficult to handle this issue using rules. Since you mentioned it, there must
be shortcomings in my approach, even though I haven’t come up with a better
solution yet. As asolimando also pointed out in CALCITE-7234, the modification
isn’t ideal (and I share the same view—otherwise, I wouldn’t have submitted
this PR). Therefore, I think this PR should be temporarily closed until a
better implementation approach is found.
--
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]