You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2022/06/22 19:57:14 UTC

[GitHub] [arrow-rs] viirya opened a new issue, #1923: Disallow cast from other datatypes to NullType

viirya opened a new issue, #1923:
URL: https://github.com/apache/arrow-rs/issues/1923

   **Describe the bug**
   
   We allow casting from other datatypes to NullType (see `can_cast_types`). I suspect that this is a mistake.
   
   For example, Spark doesn't allow casting from any datatypes to NullType.
   
   I also checked C++ Cast kernels. Mostly the datatypes cannot cast to NullType (e.g. https://github.com/apache/arrow/blob/53752adc6b81166cd4ee7db5a819494042f29197/cpp/src/arrow/compute/kernels/scalar_cast_test.cc#L187-L211). I said "mostly" because I don't see explicit tests for other cases like Decimal, but I suspect that it is not allowed but just lack of test coverage.
   
   I don't see there is cast kernel in C++ for casting to NullType except for a special case (`dict<null> -> null`): https://github.com/apache/arrow/blob/53752adc6b81166cd4ee7db5a819494042f29197/cpp/src/arrow/compute/kernels/scalar_cast_numeric.cc#L748-L751. Even for that, there is a comment questioning about it.
   
   
   
   **To Reproduce**
   Steps to reproduce the behavior:
   
   **Expected behavior**
   
   Cast kernel should not allow casting from any datatypes to NullType.
   
   
   **Additional context**
   Add any other context about the problem here.
   


-- 
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.apache.org

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


[GitHub] [arrow-rs] liukun4515 commented on issue #1923: Disallow cast from other datatypes to NullType

Posted by GitBox <gi...@apache.org>.
liukun4515 commented on issue #1923:
URL: https://github.com/apache/arrow-rs/issues/1923#issuecomment-1165079647

   The result of discussion: https://github.com/apache/arrow-rs/pull/1922#discussion_r905436410


-- 
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-rs] liukun4515 closed issue #1923: Disallow cast from other datatypes to NullType

Posted by GitBox <gi...@apache.org>.
liukun4515 closed issue #1923: Disallow cast from other datatypes to NullType
URL: https://github.com/apache/arrow-rs/issues/1923


-- 
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-rs] liukun4515 commented on issue #1923: Disallow cast from other datatypes to NullType

Posted by GitBox <gi...@apache.org>.
liukun4515 commented on issue #1923:
URL: https://github.com/apache/arrow-rs/issues/1923#issuecomment-1165273471

   I will give a follow-up pr to remove casting other data type to Null Data type.


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