You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "jayzhan211 (via GitHub)" <gi...@apache.org> on 2023/10/31 00:00:17 UTC
[PR] Convert default null to int32::None [arrow-datafusion]
jayzhan211 opened a new pull request, #7995:
URL: https://github.com/apache/arrow-datafusion/pull/7995
## 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 #.
## 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] Convert Null to Int32(None) for MakeArray at type coercion step [arrow-datafusion]
Posted by "jayzhan211 (via GitHub)" <gi...@apache.org>.
jayzhan211 commented on code in PR #7995:
URL: https://github.com/apache/arrow-datafusion/pull/7995#discussion_r1390053054
##########
datafusion/optimizer/src/analyzer/type_coercion.rs:
##########
@@ -579,26 +580,51 @@ fn coerce_arguments_for_fun(
.collect::<Result<Vec<_>>>()?;
}
+ // Converting `Null` to Int32(None) to avoid handling `Null` in array functions
Review Comment:
Actually converting null is not only a special case for MakeArray. I think we need to extend this to other Array function too.
For example, array_append(make_array(1,null,3), null);
We not only need conversion in make_array but also conversion in array_append.
--
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] Convert Null to Int32(None) for MakeArray at type coercion step [arrow-datafusion]
Posted by "alamb (via GitHub)" <gi...@apache.org>.
alamb commented on code in PR #7995:
URL: https://github.com/apache/arrow-datafusion/pull/7995#discussion_r1380730813
##########
datafusion/optimizer/src/analyzer/type_coercion.rs:
##########
@@ -579,26 +580,51 @@ fn coerce_arguments_for_fun(
.collect::<Result<Vec<_>>>()?;
}
+ // Converting `Null` to Int32(None) to avoid handling `Null` in array functions
Review Comment:
It seems very strange to me that there are three special cases for `if *fun == BuiltinScalarFunction::MakeArray {` that all do similar things 🤔
##########
datafusion/optimizer/src/analyzer/type_coercion.rs:
##########
@@ -579,26 +580,51 @@ fn coerce_arguments_for_fun(
.collect::<Result<Vec<_>>>()?;
}
+ // Converting `Null` to Int32(None) to avoid handling `Null` in array functions
Review Comment:
I feel like the fact this is special casing NULLs when nothing else in DataFusion needs to do the same, is an indication something is not quite right with this architecture. Is there any way we can remove these special cases?
##########
datafusion/optimizer/src/analyzer/type_coercion.rs:
##########
@@ -579,26 +580,51 @@ fn coerce_arguments_for_fun(
.collect::<Result<Vec<_>>>()?;
}
+ // Converting `Null` to Int32(None) to avoid handling `Null` in array functions
Review Comment:
It seems very strange to me that there are three special cases for `if *fun == BuiltinScalarFunction::MakeArray {` that all do similar things 🤔
--
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] Convert Null to Int32(None) for MakeArray at type coercion step [arrow-datafusion]
Posted by "jayzhan211 (via GitHub)" <gi...@apache.org>.
jayzhan211 commented on code in PR #7995:
URL: https://github.com/apache/arrow-datafusion/pull/7995#discussion_r1390053054
##########
datafusion/optimizer/src/analyzer/type_coercion.rs:
##########
@@ -579,26 +580,51 @@ fn coerce_arguments_for_fun(
.collect::<Result<Vec<_>>>()?;
}
+ // Converting `Null` to Int32(None) to avoid handling `Null` in array functions
Review Comment:
Actually converting null is not only a special cases for MakeArray. I think we need to extend this to other Arrayfunction too.
##########
datafusion/optimizer/src/analyzer/type_coercion.rs:
##########
@@ -579,26 +580,51 @@ fn coerce_arguments_for_fun(
.collect::<Result<Vec<_>>>()?;
}
+ // Converting `Null` to Int32(None) to avoid handling `Null` in array functions
Review Comment:
Actually converting null is not only a special case for MakeArray. I think we need to extend this to other Arrayfunction too.
--
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] Convert Null to Int32(None) for MakeArray at type coercion step [arrow-datafusion]
Posted by "alamb (via GitHub)" <gi...@apache.org>.
alamb closed pull request #7995: Convert Null to Int32(None) for MakeArray at type coercion step
URL: https://github.com/apache/arrow-datafusion/pull/7995
--
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