You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@arrow.apache.org by Rares Vernica <rv...@gmail.com> on 2018/08/03 05:10:25 UTC

RecordBatch with different-length Arrays

Hi,

The docs suggest that a RecordBatch is a collection of equal-length array
instances. It appears that this is not enforced and one could build a
RecordBatch from arrays of different length. Is this intentional?

Here is an example:

>>> b = pyarrow.RecordBatch.from_arrays(
   [pyarrow.array([1, 2, 3]),
    pyarrow.array([1, 2]),
    pyarrow.array([1])],
   ['a', 'b'.'c'])

>>>[len(b[i]) for i in range(3)]
[3, 2, 1]

Cheers,
Rares

Re: RecordBatch with different-length Arrays

Posted by Wes McKinney <we...@gmail.com>.
This was fixed in 0.10.0

On Fri, Aug 3, 2018, 2:28 AM Antoine Pitrou <so...@pitrou.net> wrote:

> On Thu, 2 Aug 2018 22:10:25 -0700
> Rares Vernica <rv...@gmail.com> wrote:
> > Hi,
> >
> > The docs suggest that a RecordBatch is a collection of equal-length array
> > instances. It appears that this is not enforced and one could build a
> > RecordBatch from arrays of different length. Is this intentional?
>
> Not really, could you open an issue for that?
>
> Regards
>
> Antoine.
>

Re: RecordBatch with different-length Arrays

Posted by Antoine Pitrou <so...@pitrou.net>.
On Thu, 2 Aug 2018 22:10:25 -0700
Rares Vernica <rv...@gmail.com> wrote:
> Hi,
> 
> The docs suggest that a RecordBatch is a collection of equal-length array
> instances. It appears that this is not enforced and one could build a
> RecordBatch from arrays of different length. Is this intentional?

Not really, could you open an issue for that?

Regards

Antoine.