You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@arrow.apache.org by "SHIMA Tatsuya (Jira)" <ji...@apache.org> on 2022/03/03 16:04:00 UTC

[jira] [Commented] (ARROW-15828) [R] ChunkedArray$cast() combine multiple arrays into one

    [ https://issues.apache.org/jira/browse/ARROW-15828?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17500850#comment-17500850 ] 

SHIMA Tatsuya commented on ARROW-15828:
---------------------------------------

I noticed that this is reproduced in Python as well.
Is this the intended behavior?

{code:python}
>>> import pyarrow as pa
>>> pa.chunked_array([pa.array([1,2]),pa.array([3,4])]).cast(pa.float64())
<pyarrow.lib.ChunkedArray object at 0x7f16c0de06d0>
[
  [
    1,
    2,
    3,
    4
  ]
]
>>> pa.chunked_array([pa.array([1,2]),pa.array([3,4])]).cast(pa.utf8())
<pyarrow.lib.ChunkedArray object at 0x7f16c102b290>
[
  [
    "1",
    "2"
  ],
  [
    "3",
    "4"
  ]
{code}
 
 
 

 

> [R] ChunkedArray$cast() combine multiple arrays into one
> --------------------------------------------------------
>
>                 Key: ARROW-15828
>                 URL: https://issues.apache.org/jira/browse/ARROW-15828
>             Project: Apache Arrow
>          Issue Type: Bug
>          Components: R
>    Affects Versions: 7.0.0
>            Reporter: SHIMA Tatsuya
>            Priority: Major
>
> It appears that if I try to cast to int or float, the array will be one.
> {code:r}
> library(arrow, warn.conflicts = FALSE)
> #> See arrow_info() for available features
> chunked_array(1:2, 3:4, 5:6)$cast(string())
> #> ChunkedArray
> #> [
> #>   [
> #>     "1",
> #>     "2"
> #>   ],
> #>   [
> #>     "3",
> #>     "4"
> #>   ],
> #>   [
> #>     "5",
> #>     "6"
> #>   ]
> #> ]
> chunked_array(1:2, 3:4, 5:6)$cast(float64())
> #> ChunkedArray
> #> [
> #>   [
> #>     1,
> #>     2,
> #>     3,
> #>     4,
> #>     5,
> #>     6
> #>   ]
> #> ]
> chunked_array(1:2, 3:4, 5:6)$cast(int64())
> #> ChunkedArray
> #> [
> #>   [
> #>     1,
> #>     2,
> #>     3,
> #>     4,
> #>     5,
> #>     6
> #>   ]
> #> ]
> chunked_array(1:2, 3:4, 5:6)$cast(date32())
> #> ChunkedArray
> #> [
> #>   [
> #>     1970-01-02,
> #>     1970-01-03
> #>   ],
> #>   [
> #>     1970-01-04,
> #>     1970-01-05
> #>   ],
> #>   [
> #>     1970-01-06,
> #>     1970-01-07
> #>   ]
> #> ]
> {code}



--
This message was sent by Atlassian Jira
(v8.20.1#820001)