alamb commented on PR #15110:
URL: https://github.com/apache/datafusion/pull/15110#issuecomment-2714474220

   > @findepi so the test cases in `unwrap_cast` are not correct, and they're 
showing that I'm over-unwrapping. Am I understanding this correctly?
   
   I think @findepi  is saying that the mapping proposed in the PR is more 
subtle
   
   casting an integer `123` to a string will result in `'123'`.
   
   It would not match the string `'0123'`
   
   However, as written this PR will also match `'0123'` as we will cast `0123` 
to an integer which results in `123`
   
   So in other words, we should not do the conversion from `'0123'` (string) to 
`123` (int)
   
   Maybe we can add a check that the string would be the same when we round 
tripped it
   
   As in  only do the rewrite if the sequence
   * cast to int
   * cast (back) to string
   
   results in the exact same string as went int
   


-- 
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-unsubscr...@datafusion.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org
For additional commands, e-mail: github-h...@datafusion.apache.org

Reply via email to