You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@arrow.apache.org by "Joris Van den Bossche (Jira)" <ji...@apache.org> on 2021/05/03 11:53:00 UTC
[jira] [Commented] (ARROW-12606) [C++] Quantile function failing on
list scalars.
[ https://issues.apache.org/jira/browse/ARROW-12606?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17338330#comment-17338330 ]
Joris Van den Bossche commented on ARROW-12606:
-----------------------------------------------
I think the underlying reason is that {{quantile}} doesn't correct handle arrays with an offset, as this simpler example also fails:
{code}
In [10]: arr = pa.array([1, 2])
In [11]: pc.quantile(arr)
Out[11]:
<pyarrow.lib.DoubleArray object at 0x7fdd8410e940>
[
1.5
]
In [12]: pc.quantile(arr[1:])
Out[12]:
<pyarrow.lib.DoubleArray object at 0x7fdd7f7a1280>
[
1.44115e+17
]
{code}
and the list scalar's {{values}} is a offsetted view of the parent ListArray.values
> [C++] Quantile function failing on list scalars.
> ------------------------------------------------
>
> Key: ARROW-12606
> URL: https://issues.apache.org/jira/browse/ARROW-12606
> Project: Apache Arrow
> Issue Type: Bug
> Components: C++, Python
> Affects Versions: 4.0.0
> Environment: macOS, ubuntu
> Reporter: A. Coady
> Assignee: Yibo Cai
> Priority: Major
>
> Sounds unrelated, but it's the simplest example I've gotten to reproduce.
>
> {code:java}
> import pyarrow as pa, pyarrow.compute as pc
> array = pa.array([[0], [1]])
> first, second = [pc.quantile(scalar.values) for scalar in array]
> assert first.to_pylist() == [0]
> assert (second.to_pylist() == [1]), second # 7.20576e+16{code}
--
This message was sent by Atlassian Jira
(v8.3.4#803005)