use of org.apache.drill.exec.store.ischema.InfoSchemaFilter.ConstantExprNode in project drill by apache.
the class MetadataProvider method createInFunctionExprNode.
/**
* Helper method to create {@link FunctionExprNode} from {@code List<String>}.
* @param fieldName Name of the filed on which the like expression is applied.
* @param valuesFilter a list of values
* @return {@link FunctionExprNode} for given arguments. Null if the <code>valuesFilter</code> is null.
*/
private static FunctionExprNode createInFunctionExprNode(String fieldName, List<String> valuesFilter) {
if (valuesFilter == null) {
return null;
}
ImmutableList.Builder<ExprNode> nodes = ImmutableList.builder();
nodes.add(new FieldExprNode(fieldName));
for (String type : valuesFilter) {
nodes.add(new ConstantExprNode(type));
}
return new FunctionExprNode(IN_FUNCTION, nodes.build());
}
Aggregations