You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "Weijun-H (via GitHub)" <gi...@apache.org> on 2023/03/22 21:52:53 UTC

[GitHub] [arrow-datafusion] Weijun-H opened a new pull request, #5696: Return plan error when adding utf8 and timestamp

Weijun-H opened a new pull request, #5696:
URL: https://github.com/apache/arrow-datafusion/pull/5696

   # 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 #5650
   
   # 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?
   Return plan error when performing binary operations between timestamp and utf8
   <!--
   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


[GitHub] [arrow-datafusion] alamb commented on a diff in pull request #5696: Return plan error when adding utf8 and timestamp

Posted by "alamb (via GitHub)" <gi...@apache.org>.
alamb commented on code in PR #5696:
URL: https://github.com/apache/arrow-datafusion/pull/5696#discussion_r1145974783


##########
datafusion/physical-expr/src/expressions/binary.rs:
##########
@@ -1213,6 +1214,13 @@ pub fn binary(
 ) -> Result<Arc<dyn PhysicalExpr>> {
     let lhs_type = &lhs.data_type(input_schema)?;
     let rhs_type = &rhs.data_type(input_schema)?;
+    if (is_utf8_or_large_utf8(lhs_type) && is_timestamp(rhs_type))

Review Comment:
   Thanks @Weijun-H  -- this does indeed fix the bug as stated. 
   
    I was trying to figure out how this code even executes (and was not caught earlier)
   
   It seems like maybe this could be related to
   
   https://github.com/apache/arrow-datafusion/blob/d8925bebc1f5382b044ce80f78bc465a9145e425/datafusion/expr/src/type_coercion/binary.rs#L80-L85
   
   🤔 
   
   Maybe it is time to figure out a better coercion story



-- 
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


[GitHub] [arrow-datafusion] comphead commented on a diff in pull request #5696: Return plan error when adding utf8 and timestamp

Posted by "comphead (via GitHub)" <gi...@apache.org>.
comphead commented on code in PR #5696:
URL: https://github.com/apache/arrow-datafusion/pull/5696#discussion_r1146577285


##########
datafusion/physical-expr/src/expressions/binary.rs:
##########
@@ -1213,6 +1214,13 @@ pub fn binary(
 ) -> Result<Arc<dyn PhysicalExpr>> {
     let lhs_type = &lhs.data_type(input_schema)?;
     let rhs_type = &rhs.data_type(input_schema)?;
+    if (is_utf8_or_large_utf8(lhs_type) && is_timestamp(rhs_type))

Review Comment:
   +1 sometime ago we agreed to that logical planner will be a better place for coercions and coercion checks



-- 
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


[GitHub] [arrow-datafusion] alamb merged pull request #5696: Return plan error when adding utf8 and timestamp

Posted by "alamb (via GitHub)" <gi...@apache.org>.
alamb merged PR #5696:
URL: https://github.com/apache/arrow-datafusion/pull/5696


-- 
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