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 2020/10/14 19:56:57 UTC

[GitHub] [arrow] nevi-me commented on a change in pull request #8460: ARROW-10236: [Rust] Add can_cast_types to arrow cast kernel, use in DataFusion

nevi-me commented on a change in pull request #8460:
URL: https://github.com/apache/arrow/pull/8460#discussion_r504935919



##########
File path: rust/datafusion/src/physical_plan/expressions.rs
##########
@@ -1985,9 +1982,10 @@ mod tests {
 
     #[test]
     fn invalid_cast() -> Result<()> {
-        let schema = Schema::new(vec![Field::new("a", DataType::Utf8, false)]);
-        let result = cast(col("a"), &schema, DataType::Int32);
-        result.expect_err("Invalid CAST from Utf8 to Int32");
+        // Ensure a useful error happens at plan time if invalid casts are used

Review comment:
       yup, unifying the cast logic was good for this. I've wanted to add cast options, such as disallowing lossy casts.
   If/when we get to that point, we'll have to think about what behaviour we want DataFusion to use.




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

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