You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "tustvold (via GitHub)" <gi...@apache.org> on 2023/09/09 11:51:17 UTC

[GitHub] [arrow-datafusion] tustvold opened a new pull request, #7514: Remove implicit interval type coercion from ScalarValue comparison

tustvold opened a new pull request, #7514:
URL: https://github.com/apache/arrow-datafusion/pull/7514

   ## 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.
   -->
   
   Part of #7353 
   
   ## 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.  
   -->
   
   We have explicit type coercion machinery during plan construction that handles this, doing this implicitly within ScalarValue introduces inconsistency and is unnecessary
   
   ## 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


[GitHub] [arrow-datafusion] berkaysynnada commented on pull request #7514: Remove implicit interval type coercion from ScalarValue comparison

Posted by "berkaysynnada (via GitHub)" <gi...@apache.org>.
berkaysynnada commented on PR #7514:
URL: https://github.com/apache/arrow-datafusion/pull/7514#issuecomment-1712587312

   > Thank you -- this makes a lot of sense to me. I think some of this was left over from when the arrow cast kernels didn't support all the different types of coercion
   > 
   > cc @berkaysynnada
   
   Yes, you are right. We did this before arrow kernels, when I didn't fully know the purpose of Interval type. I can now say that they were erroneous and they are unnecessary at the moment.


-- 
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] tustvold commented on a diff in pull request #7514: Remove implicit interval type coercion from ScalarValue comparison

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


##########
datafusion/common/src/scalar.rs:
##########
@@ -431,122 +387,6 @@ impl PartialOrd for ScalarValue {
     }
 }
 
-/// This function computes the duration (in milliseconds) of the given

Review Comment:
   These functions are somewhat misleading as it is not clearly conveyed that they are a gross approximation, assuming certain numbers of days in months, etc... Given these don't appear to be used elsewhere, I think the best option is to remove them



-- 
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] tustvold commented on a diff in pull request #7514: Remove implicit interval type coercion from ScalarValue comparison

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


##########
datafusion/common/src/scalar.rs:
##########
@@ -377,28 +351,10 @@ impl PartialOrd for ScalarValue {
             }
             (TimestampNanosecond(_, _), _) => None,
             (IntervalYearMonth(v1), IntervalYearMonth(v2)) => v1.partial_cmp(v2),
-            (IntervalYearMonth(v1), IntervalDayTime(v2)) => {
-                ym_to_milli(v1).partial_cmp(&dt_to_milli(v2))

Review Comment:
   This is simply wrong as it makes gross assumptions about the number of days in months, etc... 



-- 
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] tustvold merged pull request #7514: Remove implicit interval type coercion from ScalarValue comparison

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


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