/*
* Merging atomicExpr and orExpressions corresponding to this component
*/
private Expression createWhereForComponent(Component component) {
Expression expr = _compNamesAndExprs.get(component.getName());
for (final Map.Entry<Set<String>, Expression> orEntry : _compNamesOrExprs.entrySet()) {
final Set<String> orCompNames = orEntry.getKey();
// TODO-PRIO: the full solution would be that OrExpressions are
// split into subexpressions
// which might be executed on their LCM
// Not implemented because it's quite rare - only TPCH7
// Even in TPCH7 there is no need for multiple LCM.
// TODO-PRIO: selectivityEstimation for pushing OR need to be
// improved
final Expression orExpr = orEntry.getValue();
if (HierarchyExtractor.isLCM(component, orCompNames))
expr = appendAnd(expr, orExpr);
else if (component instanceof DataSourceComponent) {
final DataSourceComponent source = (DataSourceComponent) component;
final Expression addedExpr = getMineSubset(source, orExpr);
expr = appendAnd(expr, addedExpr);
}
}
return expr;
}