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 2021/05/20 18:48:47 UTC

[GitHub] [arrow-rs] ritchie46 opened a new issue #334: Cast of utf8 types and list container types don't respect offset

ritchie46 opened a new issue #334:
URL: https://github.com/apache/arrow-rs/issues/334


   **Describe the bug**
   Casting between:
   
   * list <-> large-list
   * utf8 <-> large-utf8
   
   does not respect offset (and list cast even panics). 
   
   **To Reproduce**
   
   ```rust
       #[test]
       fn test_utf8_cast_offsets() {
           // test if offset of the array is taken into account during cast
           let str_array = StringArray::from(vec!["a", "b", "c"]);
           let str_array = str_array.slice(1, 2);
   
           let out = cast(&str_array, &DataType::LargeUtf8).unwrap();
   
           let large_str_array = out.as_any().downcast_ref::<LargeStringArray>().unwrap();
           let strs = large_str_array.into_iter().flatten().collect::<Vec<_>>();
           assert_eq!(strs, &["b", "c"])
       }
   
       #[test]
       fn test_list_cast_offsets() {
           // test if offset of the array is taken into account during cast
           let array1 = make_list_array().slice(1, 2);
           let array2 = Arc::new(make_list_array()) as ArrayRef;
   
           let dt = DataType::LargeList(Box::new(Field::new("item", DataType::Int32, true)));
           let out1 = cast(&array1, &dt).unwrap();
           let out2 = cast(&array2, &dt).unwrap();
   
           assert_eq!(&out1, &out2.slice(1, 2))
       }
   
   ```
   
   **Expected behavior**
   Casting with correct offset.
   
   
   


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



[GitHub] [arrow-rs] ritchie46 commented on issue #334: Cast of utf8 types and list container types don't respect offset

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


   This can be closed. Or do we leave this open for the active-release branches?


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



[GitHub] [arrow-rs] nevi-me closed issue #334: Cast of utf8 types and list container types don't respect offset

Posted by GitBox <gi...@apache.org>.
nevi-me closed issue #334:
URL: https://github.com/apache/arrow-rs/issues/334


   


-- 
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] nevi-me commented on issue #334: Cast of utf8 types and list container types don't respect offset

Posted by GitBox <gi...@apache.org>.
nevi-me commented on issue #334:
URL: https://github.com/apache/arrow-rs/issues/334#issuecomment-877794567


   Can be closed


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