You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "brayanjuls (via GitHub)" <gi...@apache.org> on 2024/02/15 06:03:01 UTC
[PR] DRAFT: arrow_cast function as UDF [arrow-datafusion]
brayanjuls opened a new pull request, #9235:
URL: https://github.com/apache/arrow-datafusion/pull/9235
## 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 #9143.
## 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.
-->
Migration of core functions to UDF.
## 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.
-->
arrow_cast function migration.
## 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)?
-->
Yes.
## 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.
-->
No.
--
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] DRAFT: arrow_cast function as UDF [arrow-datafusion]
Posted by "alamb (via GitHub)" <gi...@apache.org>.
alamb commented on PR #9235:
URL: https://github.com/apache/arrow-datafusion/pull/9235#issuecomment-1946499950
Now that https://github.com/apache/arrow-datafusion/pull/8985 is merged, I think this PR can proceed.
--
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] DRAFT: arrow_cast function as UDF [arrow-datafusion]
Posted by "brayanjuls (via GitHub)" <gi...@apache.org>.
brayanjuls commented on PR #9235:
URL: https://github.com/apache/arrow-datafusion/pull/9235#issuecomment-1951609312
I messed the merge of the latest changes and somehow now they all appear in this PR. I will try to fix it, otherwise I will open a new PR.
--
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] DRAFT: arrow_cast function as UDF [arrow-datafusion]
Posted by "alamb (via GitHub)" <gi...@apache.org>.
alamb commented on code in PR #9235:
URL: https://github.com/apache/arrow-datafusion/pull/9235#discussion_r1490911443
##########
datafusion/functions/src/core/arrow_cast.rs:
##########
@@ -19,16 +19,50 @@
//! casting to arbitrary arrow types (rather than SQL types)
use std::{fmt::Display, iter::Peekable, str::Chars, sync::Arc};
+use std::any::Any;
+use arrow::compute::cast;
use arrow_schema::{DataType, Field, IntervalUnit, TimeUnit};
-use datafusion_common::{
- plan_datafusion_err, DFSchema, DataFusionError, Result, ScalarValue,
-};
+use datafusion_common::{plan_datafusion_err, DataFusionError, Result, ScalarValue, internal_err};
-use datafusion_common::plan_err;
-use datafusion_expr::{Expr, ExprSchemable};
+use datafusion_expr::{ColumnarValue, ScalarUDFImpl, Signature, Volatility};
-pub const ARROW_CAST_NAME: &str = "arrow_cast";
+#[derive(Debug)]
Review Comment:
this looks just about perfect. Thank you @brayanjuls
I plan to get https://github.com/apache/arrow-datafusion/pull/8985 merged shortly and then this PR should be possible.
🙏
--
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] DRAFT: arrow_cast function as UDF [arrow-datafusion]
Posted by "brayanjuls (via GitHub)" <gi...@apache.org>.
brayanjuls commented on PR #9235:
URL: https://github.com/apache/arrow-datafusion/pull/9235#issuecomment-1955870996
@alamb I am closing this PR as I opened #9298 to fix the merging issues I have here.
--
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] DRAFT: arrow_cast function as UDF [arrow-datafusion]
Posted by "brayanjuls (via GitHub)" <gi...@apache.org>.
brayanjuls closed pull request #9235: DRAFT: arrow_cast function as UDF
URL: https://github.com/apache/arrow-datafusion/pull/9235
--
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] DRAFT: arrow_cast function as UDF [arrow-datafusion]
Posted by "alamb (via GitHub)" <gi...@apache.org>.
alamb commented on PR #9235:
URL: https://github.com/apache/arrow-datafusion/pull/9235#issuecomment-1953661779
Thanks @brayanjuls -- I also filed https://github.com/apache/arrow-datafusion/issues/9287 to track this issue. I thought of a potential issue we may hit as well which I will link to https://github.com/apache/arrow-datafusion/issues/9287 as well
--
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