Xuanwo commented on code in PR #23738:
URL: https://github.com/apache/datafusion/pull/23738#discussion_r3635581352


##########
datafusion/sql/src/unparser/plan.rs:
##########
@@ -115,6 +115,7 @@ impl Unparser<'_> {
             | LogicalPlan::Aggregate(_)
             | LogicalPlan::Sort(_)
             | LogicalPlan::Join(_)
+            | LogicalPlan::AsOfJoin(_)

Review Comment:
   Yes, the execution algorithm should remain a physical decision. 
   
   The separate logical node represents different relational semantics: for 
left `ts = 10` and right `ts = {1, 5}`, a regular `>=` join returns both rows, 
while ASOF returns only 5. Replacing a regular Join’s physical algorithm with 
`AsOfJoinExec` would therefore change results.
   
   The current implementation also needs ASOF-specific cardinality, type 
coercion, projection/filter pushdown, and must not participate in ordinary join 
reordering or input swapping. The logical node can still map to different 
physical implementations—ordered merge now, indexed probe later.
   
   We could instead add an explicit match mode to Join, but then every generic 
join rule would need to account for it. I currently prefer a separate node for 
isolation, but I’m open to a generalized representation if that is preferred.



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