You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "haohuaijin (via GitHub)" <gi...@apache.org> on 2024/03/21 07:55:15 UTC
[PR] perf: improve to_field performance [arrow-datafusion]
haohuaijin opened a new pull request, #9722:
URL: https://github.com/apache/arrow-datafusion/pull/9722
## Which issue does this PR close?
<!--
We generally require a GitHub issue to be filed for all bug fixes and enhancements and this helps us generate change logs for our releases. You can link an issue to this PR using the GitHub syntax. For example `Closes #123` indicates that this PR will close issue #123.
-->
Closes #9721
## Rationale for this change
<!--
Why are you proposing this change? If this is already explained clearly in the issue then this section is not needed.
Explaining clearly why changes are proposed helps reviewers understand your changes and offer better suggestions for fixes.
-->
## What changes are included in this PR?
<!--
There is no need to duplicate the description in the issue here but it is sometimes worth providing a summary of the individual changes in this PR.
-->
## Are these changes tested?
<!--
We typically require tests for all PRs in order to:
1. Prevent the code from being accidentally broken by subsequent changes
2. Serve as another way to document the expected behavior of the code
If tests are not included in your PR, please explain why (for example, are they covered by existing tests)?
-->
## Are there any user-facing changes?
<!--
If there are user-facing changes then we may require documentation to be updated before approving the PR.
-->
<!--
If there are any breaking changes to public APIs, please add the `api change` label.
-->
--
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: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] perf: improve to_field performance [arrow-datafusion]
Posted by "jayzhan211 (via GitHub)" <gi...@apache.org>.
jayzhan211 merged PR #9722:
URL: https://github.com/apache/arrow-datafusion/pull/9722
--
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: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] perf: improve to_field performance [arrow-datafusion]
Posted by "haohuaijin (via GitHub)" <gi...@apache.org>.
haohuaijin commented on code in PR #9722:
URL: https://github.com/apache/arrow-datafusion/pull/9722#discussion_r1534064495
##########
datafusion/expr/src/expr_schema.rs:
##########
@@ -50,6 +50,10 @@ pub trait ExprSchemable {
/// cast to a type with respect to a schema
fn cast_to(self, cast_to_type: &DataType, schema: &dyn ExprSchema) -> Result<Expr>;
+
+ /// given a schema, return the type and nullability of the expr
+ fn data_type_and_nullable(&self, schema: &dyn ExprSchema)
+ -> Result<(DataType, bool)>;
Review Comment:
I made it consistent with `get_type()` and `nullable()`
https://github.com/apache/arrow-datafusion/blob/dc373a3550610ce041fd73a1eabe08b096d6ed27/datafusion/expr/src/expr_schema.rs#L39-L43
we use this to create DFField, which it use `DataType`
https://github.com/apache/arrow-datafusion/blob/dc373a3550610ce041fd73a1eabe08b096d6ed27/datafusion/expr/src/expr_schema.rs#L379-L384
--
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: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] perf: improve to_field performance [arrow-datafusion]
Posted by "alamb (via GitHub)" <gi...@apache.org>.
alamb commented on code in PR #9722:
URL: https://github.com/apache/arrow-datafusion/pull/9722#discussion_r1534002193
##########
datafusion/expr/src/expr_schema.rs:
##########
@@ -50,6 +50,10 @@ pub trait ExprSchemable {
/// cast to a type with respect to a schema
fn cast_to(self, cast_to_type: &DataType, schema: &dyn ExprSchema) -> Result<Expr>;
+
+ /// given a schema, return the type and nullability of the expr
+ fn data_type_and_nullable(&self, schema: &dyn ExprSchema)
+ -> Result<(DataType, bool)>;
Review Comment:
is there a reason this can't also return a reference like
```suggestion
-> Result<(&DataType, bool)>;
```
?
--
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: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] perf: improve to_field performance [arrow-datafusion]
Posted by "haohuaijin (via GitHub)" <gi...@apache.org>.
haohuaijin commented on PR #9722:
URL: https://github.com/apache/arrow-datafusion/pull/9722#issuecomment-2011447267
here is a benchmark result, seem like it have some improve

--
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: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] perf: improve to_field performance [arrow-datafusion]
Posted by "alamb (via GitHub)" <gi...@apache.org>.
alamb commented on PR #9722:
URL: https://github.com/apache/arrow-datafusion/pull/9722#issuecomment-2014835490
🚀
--
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: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] perf: improve to_field performance [arrow-datafusion]
Posted by "alamb (via GitHub)" <gi...@apache.org>.
alamb commented on PR #9722:
URL: https://github.com/apache/arrow-datafusion/pull/9722#issuecomment-2013370639
I merged up from main to prepare this PR to merge
--
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: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] perf: improve to_field performance [arrow-datafusion]
Posted by "jayzhan211 (via GitHub)" <gi...@apache.org>.
jayzhan211 commented on PR #9722:
URL: https://github.com/apache/arrow-datafusion/pull/9722#issuecomment-2014227800
Thanks @haohuaijin and @alamb
--
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: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org