Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Docs and Examples and helper methods to PhysicalSortExpr #12589

Merged
merged 1 commit into from
Sep 23, 2024

Conversation

alamb
Copy link
Contributor

@alamb alamb commented Sep 23, 2024

Which issue does this PR close?

Part of #12446

Closes #.

Rationale for this change

Basically while working on #12562 I got annoyed at the lack of documentation and display implementations as well as how award it was to create PhysicalSortExprs.

What changes are included in this PR?

  1. Added a bunch of docs and display impls and examples

Are these changes tested?

Yes, by CI and doc tests

Are there any user-facing changes?

Better docs, easier to use APIs.

No API changes

@alamb alamb added the documentation Improvements or additions to documentation label Sep 23, 2024
@github-actions github-actions bot added physical-expr Physical Expressions core Core DataFusion crate and removed documentation Improvements or additions to documentation labels Sep 23, 2024
nulls_first: true,
},
},
PhysicalSortExpr::new_default(physical_col("string_col", &schema).unwrap())
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This shows what I would like to be able to do

@@ -30,6 +30,51 @@ use datafusion_common::Result;
use datafusion_expr_common::columnar_value::ColumnarValue;

/// Represents Sort operation for a column in a RecordBatch
///
/// Example:
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This looks like a massive example but it renders neatly I think:

Screenshot 2024-09-23 at 8 56 58 AM

Copy link
Contributor

@comphead comphead left a comment

Choose a reason for hiding this comment

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

lgtm thanks @alamb

@alamb
Copy link
Contributor Author

alamb commented Sep 23, 2024

Thanks for the quick review @comphead

@alamb alamb merged commit 04895c4 into apache:main Sep 23, 2024
26 checks passed
bgjackma pushed a commit to bgjackma/datafusion that referenced this pull request Sep 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Core DataFusion crate physical-expr Physical Expressions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants