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

Expression.some does not work

adrianmroz opened this issue · comments

Expression.some does not work properly.

Examples:

const e1 = Expression.parse("$main.countDistinct($user)");
const e2 = Expression.parse("$main.countDistinct($user) * 100");

Check:

e1.some(e => e instanceof CountDistinctExpression); // returns true
e2.some(e => e instanceof CountDistinctExpression); // returns false

That's because here:

return (v == null) ? null : !v;

we always return some boolean, and inside:

if (pass != null) {

we early return if we get non-null value. So everyHelper doesn't recurse and can't find correct expression nested.