zhuqi-lucas opened a new pull request, #24063:
URL: https://github.com/apache/datafusion/pull/24063

   ## Rationale for this change
   
   `EquivalenceProperties::project` is a central, widely-called method, but its 
doc comment was a single line ("Projects the equivalences within according to 
`mapping` and `output_schema`"). That does not convey that it carries 
orderings, the equivalence group, and constraints through the mapping, nor the 
key subtlety that an ordering is preserved only through an order-preserving 
expression (`SortProperties`). This tripped me up while reasoning about why an 
ordering survived a projection containing computed expressions, so I expanded 
the docs.
   
   ## What changes are included in this PR?
   
   Documentation only. Expands the rustdoc on `EquivalenceProperties::project` 
to describe:
   - it carries orderings, the equivalence group, and constraints through the 
mapping (not just a column-index remap);
   - orderings survive only through order-preserving expressions, determined 
from each expression's `SortProperties` (e.g. preserved through `c + 1`, 
dropped through `abs(c)`; compound orderings like `a + b` map to `a_new + 
b_new`);
   - expressions/orderings not representable in `output_schema` are dropped.
   
   ## Are these changes tested?
   
   No code change. `cargo doc -p datafusion-physical-expr --no-deps` builds 
cleanly with `RUSTDOCFLAGS="-D warnings"`.
   
   ## Are there any user-facing changes?
   
   Documentation only.
   


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