You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "yyy1000 (via GitHub)" <gi...@apache.org> on 2024/03/11 02:22:58 UTC
[PR] Port Struct to datafusion-functions [arrow-datafusion]
yyy1000 opened a new pull request, #9546:
URL: https://github.com/apache/arrow-datafusion/pull/9546
## Which issue does this PR close?
Related #9285 .
## 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] Port Struct to datafusion-functions [arrow-datafusion]
Posted by "alamb (via GitHub)" <gi...@apache.org>.
alamb commented on PR #9546:
URL: https://github.com/apache/arrow-datafusion/pull/9546#issuecomment-1988193259
Thank you @yyy1000 for helping along the 🚂 of function extraction
--
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] Port Struct to datafusion-functions [arrow-datafusion]
Posted by "alamb (via GitHub)" <gi...@apache.org>.
alamb commented on code in PR #9546:
URL: https://github.com/apache/arrow-datafusion/pull/9546#discussion_r1519548725
##########
datafusion/sql/src/expr/mod.rs:
##########
@@ -583,8 +586,10 @@ impl<'a, S: ContextProvider> SqlToRel<'a, S> {
self.sql_expr_to_logical_expr(value, input_schema, planner_context)
})
.collect::<Result<Vec<_>>>()?;
- Ok(Expr::ScalarFunction(ScalarFunction::new(
- BuiltinScalarFunction::Struct,
+ Ok(Expr::ScalarFunction(ScalarFunction::new_udf(
+ Arc::new(ScalarUDF::new_from_impl(
+ datafusion_functions::core::r#struct::StructFunc::new(),
+ )),
Review Comment:
One of the goals of pulling datafusion functions out of the core is so that the built in functions aren't treated specially. Thus having the sql planner directly instantiate the function goes against that goal.
Can you please change this to call the `struct()` function by name (`get_function_meta`) instead of adding a dependency
For example
https://github.com/apache/arrow-datafusion/blob/4cd3c433004a7a6825643d6b3911db720efe5f76/datafusion/sql/src/expr/mod.rs#L173-L180
--
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] Port Struct to datafusion-functions [arrow-datafusion]
Posted by "yyy1000 (via GitHub)" <gi...@apache.org>.
yyy1000 commented on code in PR #9546:
URL: https://github.com/apache/arrow-datafusion/pull/9546#discussion_r1519072896
##########
datafusion/sql/src/expr/mod.rs:
##########
@@ -583,8 +586,10 @@ impl<'a, S: ContextProvider> SqlToRel<'a, S> {
self.sql_expr_to_logical_expr(value, input_schema, planner_context)
})
.collect::<Result<Vec<_>>>()?;
- Ok(Expr::ScalarFunction(ScalarFunction::new(
- BuiltinScalarFunction::Struct,
+ Ok(Expr::ScalarFunction(ScalarFunction::new_udf(
+ Arc::new(ScalarUDF::new_from_impl(
+ datafusion_functions::core::r#struct::StructFunc::new(),
+ )),
Review Comment:
Here it will use StructFunc so I add datafusion-functions as the dependency.
--
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] Port `struct` to datafusion-functions [arrow-datafusion]
Posted by "alamb (via GitHub)" <gi...@apache.org>.
alamb merged PR #9546:
URL: https://github.com/apache/arrow-datafusion/pull/9546
--
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] Port Struct to datafusion-functions [arrow-datafusion]
Posted by "yyy1000 (via GitHub)" <gi...@apache.org>.
yyy1000 commented on code in PR #9546:
URL: https://github.com/apache/arrow-datafusion/pull/9546#discussion_r1519962834
##########
datafusion/sql/src/expr/mod.rs:
##########
@@ -583,8 +586,10 @@ impl<'a, S: ContextProvider> SqlToRel<'a, S> {
self.sql_expr_to_logical_expr(value, input_schema, planner_context)
})
.collect::<Result<Vec<_>>>()?;
- Ok(Expr::ScalarFunction(ScalarFunction::new(
- BuiltinScalarFunction::Struct,
+ Ok(Expr::ScalarFunction(ScalarFunction::new_udf(
+ Arc::new(ScalarUDF::new_from_impl(
+ datafusion_functions::core::r#struct::StructFunc::new(),
+ )),
Review Comment:
Fixed
learn something from it :)
--
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