You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "gaoxinge (via GitHub)" <gi...@apache.org> on 2023/02/03 08:04:13 UTC

[GitHub] [arrow-datafusion] gaoxinge opened a new pull request, #5170: [FIX] rename cast expression column name

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

   # 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.
   -->
   
   None.
   
   # 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.  
   -->
   
   This problem origin from https://github.com/dask-contrib/dask-sql/issues/948, which can be minimally reproduced by 
   
   ```sql
   SELECT 10, cast(10 as tinyint)
   ```
   
   . And this is because 
   
   - cast use the expr as column name:
   
   https://github.com/apache/arrow-datafusion/blob/224c682101949da57aebc36e92e5a881ef3040d4/datafusion/expr/src/expr.rs#L1203-L1210
   
   - same column name is not validate:
   
   https://github.com/apache/arrow-datafusion/blob/224c682101949da57aebc36e92e5a881ef3040d4/datafusion/expr/src/logical_plan/builder.rs#L925-L948
   
   So I change the column name for cast expression for pass these cases, by using `CAST(Int64(10) AS Int8)` instead of `Int64(10)`. 
   
   # 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.
   -->
   
   As above.
   
   # 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.
   -->
   
   Yes. Because column name chage for cast expression.


-- 
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] gaoxinge commented on pull request #5170: [FIX] rename cast expression column name

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

   https://github.com/apache/arrow-datafusion/issues/5174


-- 
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] gaoxinge closed pull request #5170: [FIX] rename cast expression column name

Posted by "gaoxinge (via GitHub)" <gi...@apache.org>.
gaoxinge closed pull request #5170: [FIX] rename cast expression column name
URL: https://github.com/apache/arrow-datafusion/pull/5170


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