xiedeyantu commented on code in PR #21362:
URL: https://github.com/apache/datafusion/pull/21362#discussion_r3067906920


##########
datafusion/sqllogictest/test_files/order.slt:
##########
@@ -1521,7 +1579,7 @@ query TT
 EXPLAIN SELECT c1, c2 FROM table_with_ordered_pk ORDER BY c1, c2;
 ----
 logical_plan
-01)Sort: table_with_ordered_pk.c1 ASC NULLS LAST, table_with_ordered_pk.c2 ASC 
NULLS LAST
+01)Sort: table_with_ordered_pk.c1 ASC NULLS LAST

Review Comment:
   @alamb I fully agree with Neil's explanation: functional dependency serves 
precisely to guarantee this property—for instance, an injective function 
inherently exhibits the characteristics of functional dependency. In the 
context of `ORDER BY`, an additional aspect of ordering comes into play, 
requiring evaluation based on the sequence of the original fields (as explained 
in the accompanying code); this ensures that the semantics remain correct after 
the `ORDER BY` fields have been eliminated.



-- 
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]

Reply via email to