implydata / plywood

A toolkit for querying and interacting with Big Data

Home Page:https://plywood.imply.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Passing DATASET to .in

lastlegion opened this issue · comments

Is it possible to pass DATASET type to .in() operator?
I'm trying to filter on an attribute and then pass the output of that into another filter.

UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Type Error: in expression has a bad type combination STRING IN DATASET

@lastlegion Could you give an example?

@lastlegion You can always collect a particular attribute from the dataset, and filter by that.

For instance:

dataset1.filter($("field1").in(dataset2.collect($("field2")))

This will return the dataset1 filtered by field1 values which are in dataset2's field2 values

You can then filter that again via something like

dataset1.filter($("field1").in(dataset2.collect($("field2"))).filter($("field3").is(3))

Thanks! This would be perfect, but I'm having issues running .collect(). #171

Thanks for your help @robertervin with issue #171. This works!