List<NodeRelation> nodeRelations, Expr filter, ExprList allFilters) {
List<NodeRelation> result = new ArrayList<NodeRelation>();
boolean convertable = true;
for (NodeRelation nodeRelation: nodeRelations) {
// TODO: The transformation from Expr to Expression should happen in NodeRelation.select()
Expression expression = TransformExprToSQLApplyer.convert(filter, nodeRelation);
if (expression == null) {
// the expression cannot be transformed to SQL
convertable = false;
} else if (expression.isTrue()) {
// keep as is
} else if (expression.isFalse()) {
continue; // skip
} else {
nodeRelation = nodeRelation.select(expression);
if (nodeRelation.baseRelation().condition().isFalse()) continue;
}