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 datafusion example of expression apis #3741

Merged
merged 1 commit into from
Oct 12, 2022

Conversation

alamb
Copy link
Contributor

@alamb alamb commented Oct 6, 2022

Draft as it builds on:

Which issue does this PR close?

re #3719
re #3708
re #3740

Rationale for this change

Documenting the APIs will make the more discoverable and improve the user experience

What changes are included in this PR?

Add a new expr_api example

Are there any user-facing changes?

Better docs

Copy link
Member

@andygrove andygrove left a comment

Choose a reason for hiding this comment

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

This is great. Thanks @alamb

@alamb alamb force-pushed the alamb/document_expr_api_more branch from d98b766 to 3eae3ff Compare October 7, 2022 18:01
@github-actions github-actions bot added core Core DataFusion crate optimizer Optimizer rules labels Oct 7, 2022
@alamb alamb force-pushed the alamb/document_expr_api_more branch 3 times, most recently from b8550a6 to a40b889 Compare October 7, 2022 19:11
@github-actions github-actions bot added the logical-expr Logical plan and expressions label Oct 7, 2022
// specific language governing permissions and limitations
// under the License.

//! This program demonstrates the DataFusion expression simplification API.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

These were inlined into expr_api.rs examples

/// to qualified or unqualified fields by name.
/// * `props` - The Arrow schema for the input, used for determining expression data types
/// when performing type coercion.
pub fn simplify_expr(
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 was added in fef45e7 by @ygf11 but when I was trying to write examples using it, it ended up being quite akward

@alamb
Copy link
Contributor Author

alamb commented Oct 7, 2022

I moved my proposed API changes into #3758

@alamb alamb force-pushed the alamb/document_expr_api_more branch from a40b889 to 27dcf9e Compare October 12, 2022 15:08
@alamb alamb marked this pull request as ready for review October 12, 2022 15:09
col("i") + lit(3)
);

// TODO uncomment when https://github.com/apache/arrow-datafusion/issues/1160 is done
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I will do a partial fix for this in a follow on PR

@@ -34,7 +34,7 @@ pub use crate::execution::options::{
pub use datafusion_common::Column;
pub use datafusion_expr::{
expr_fn::*,
lit,
lit, lit_timestamp_nano,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

driveby fix

@github-actions github-actions bot removed the logical-expr Logical plan and expressions label Oct 12, 2022
@alamb alamb merged commit c27b56f into apache:master Oct 12, 2022
@ursabot
Copy link

ursabot commented Oct 12, 2022

Benchmark runs are scheduled for baseline = 3af09fb and contender = c27b56f. c27b56f is a master commit associated with this PR. Results will be available as each benchmark for each run completes.
Conbench compare runs links:
[Skipped ⚠️ Benchmarking of arrow-datafusion-commits is not supported on ec2-t3-xlarge-us-east-2] ec2-t3-xlarge-us-east-2
[Skipped ⚠️ Benchmarking of arrow-datafusion-commits is not supported on test-mac-arm] test-mac-arm
[Skipped ⚠️ Benchmarking of arrow-datafusion-commits is not supported on ursa-i9-9960x] ursa-i9-9960x
[Skipped ⚠️ Benchmarking of arrow-datafusion-commits is not supported on ursa-thinkcentre-m75q] ursa-thinkcentre-m75q
Buildkite builds:
Supported benchmarks:
ec2-t3-xlarge-us-east-2: Supported benchmark langs: Python, R. Runs only benchmarks with cloud = True
test-mac-arm: Supported benchmark langs: C++, Python, R
ursa-i9-9960x: Supported benchmark langs: Python, R, JavaScript
ursa-thinkcentre-m75q: Supported benchmark langs: C++, Java

@alamb alamb deleted the alamb/document_expr_api_more branch October 12, 2022 18:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Core DataFusion crate optimizer Optimizer rules
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants