Skip to content

[JS] Implement list contains predicate #23976

@asfimport

Description

@asfimport

As far as I can see there is no way to check if a list contains a specific element.

My code is as follows:

 

var listChild = new arrow.Field('list[Utf8]', new arrow.Utf8())

var all = arrow.Table.new([
 arrow.DateVector.from(dates),
 arrow.Int32Vector.from(flumeseqs),
 arrow.Utf8Vector.from(keys),
 arrow.Vector.from({ values: authors, type: new arrow.Dictionary(new arrow.Utf8(), new arrow.Int32()) }),
 arrow.Int32Vector.from(sequences),
 arrow.Vector.from({ values: types, type: new arrow.Dictionary(new arrow.Utf8(), new arrow.Int32()) }),
 arrow.Vector.from({ values: links, type: new arrow.List(listChild) }),
 ], ["date", "flumeseq", "key", "author", "sequence", "type", "links"])

And I want to get all the items that has a specific element in the links section.

So something like:

 

var q2 = Array.from(
all.filter(
 arrow.predicate.col('links').contains('%GcvjVk+NLsjOB5Vd+vceGXEOeYmHoRA6lgXVJzPuMxw=.sha256')))

 

 

Reporter: Anders Rune Jensen

Note: This issue was originally created as ARROW-7738. Please see the migration documentation for further details.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions