Hi Dominik,

That is my understanding - if it exists, the length of the validity must
equal the length of each field. Otherwise, it would be difficult to iterate
over the fields and validity together, since we would not have enough rows
in the fields for the validity.

I think that this is broader - when a validity is present, its length must
be equal to the number of slots of the array.

AFAI understand, the invariants of a StructArray are:

* its fields must have the same length
* if a validity is present, its length must equal the length of each field

Best,
Jorge



On Fri, Feb 18, 2022 at 6:53 PM Dominik Moritz <domor...@apache.org> wrote:

>  Can someone clarify whether the spec is clear about the behavior?
>
> On Feb 18, 2022 at 07:23:19, Alfie Mountfield <a...@hash.ai> wrote:
>
> > Hello all,
> > I've raised a JIRA ticket (
> > https://issues.apache.org/jira/browse/ARROW-15705)
> > for this, but I'm still uncertain on my reading of the spec so I thought
> > I'd ask here to confirm I've understood it correctly.
> >
> > I believe that child arrays should always be the same length as the
> struct
> > array? It seems that in the JS implementation of Arrow though, if you
> add a
> > null value to a StructBuilder, it only modifies the null-bitmap and
> doesn't
> > actually try to append the null-value to the children arrays. I'm
> guessing
> > this is a bug.
> >
> > If so, is there anything I need to do to get the PR I've opened (
> > https://github.com/apache/arrow/pull/12451) in?
> >
> > Cheers,
> > Alfie
> >
> > --
> >
> >
> >
> > <https://facebook.com/hashintel>   <https://twitter.com/hashintel>
> > <https://www.linkedin.com/company/hashintel>  * <http://hash.ai/>*
> >
> >
> > *HASH,
> > Inc. *is a Delaware-registered corporation. *HASH, Ltd.* is a UK
> (England)
> > registered company (No. 13003048). This message contains information
> which
> > may be confidential and privileged. Unless you are the intended recipient
> > (or authorized to receive this message for the intended recipient), you
> > may
> > not use, copy, disseminate or disclose to anyone the message or any
> > information contained in the message. If you have received the message in
> > error, please advise the sender by reply e-mail, and delete the message.
> >
> >
> >
> >
>

Reply via email to