Skip to content

feat: add strictly_order_preserving for more expr - #23922

Open
rluvaton wants to merge 2 commits into
apache:mainfrom
rluvaton:add-preserve-ordering
Open

feat: add strictly_order_preserving for more expr#23922
rluvaton wants to merge 2 commits into
apache:mainfrom
rluvaton:add-preserve-ordering

Conversation

@rluvaton

Copy link
Copy Markdown
Member

Which issue does this PR close?

Rationale for this change

just more uses of the new property

What changes are included in this PR?

marked if something is order preserving or not

Are these changes tested?

no

Are there any user-facing changes?

not api ones

@github-actions github-actions Bot added the functions Changes to functions implementation label Jul 27, 2026
@codecov-commenter

codecov-commenter commented Jul 27, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 80.69%. Comparing base (1c3232c) to head (70ea66a).
⚠️ Report is 9 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #23922      +/-   ##
==========================================
+ Coverage   80.67%   80.69%   +0.02%     
==========================================
  Files        1095     1095              
  Lines      372376   372641     +265     
  Branches   372376   372641     +265     
==========================================
+ Hits       300397   300695     +298     
+ Misses      54052    53992      -60     
- Partials    17927    17954      +27     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Comment on lines +126 to +128
// There is one-to-one mapping between input and output and nulls maps to nulls
// and because overflow will be resulted in an error and not wrapping or saturating we are ok
Ok(true)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this is right: factorial(0) == factorial(1) == 1.

}

fn strictly_order_preserving(&self, _inputs: &[ExprProperties]) -> Result<bool> {
// floor allow distinct inputs to collapse into equal outputs

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"allows"

Comment on lines +166 to +167
// repeat does not strictly preserve ordering since for the following 2 rows:
// "bc" and "bca" and repeat(2) the result will be "bcbc" and "bcabca" which now the order is different

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// repeat does not strictly preserve ordering since for the following 2 rows:
// "bc" and "bca" and repeat(2) the result will be "bcbc" and "bcabca" which now the order is different
// repeat('bc', 2) = 'bcbc' > repeat('bca', 2) = 'bcabca', so ordering is not preserved

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

functions Changes to functions implementation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Pass over udfs/physical expr that strictly_order_preserving and mark them as such

3 participants