Use FilterArray in operator


#1

Hello,

I want to use the FilterArray provided in the filter operator in my own UDO, however I didn’t take any expressions as parameter, I do some processing job on the input array then generate a set of criteria to filter the input array in my UDO, I want to know how I can pass this UDO-generated expression (in string form) to FilterArray.
I tried to pass an Expression object after calling compile method but it didn’t work…
like this:

string criteria = "j>1 and j<10" // just an example.
vector<string> names;
names.push_back("j");
vector<TypeId> types;
types.push_back(TID_INT64);
Expression e;
e.compile(critera, names, types);
return boost::shared_ptr<Array>(new FilterArray(_schema, inputArrays[0], boost::make_shared<Expression>(e), query, _tileMode));

#2

There are some examples of creating standalone expressions in ExpressionUnitTests.h - take a look. Looks like you’re close but missing a step or two.