Search in sources :

Example 6 with PreOrPostOrderNavigator

use of org.teiid.query.sql.navigator.PreOrPostOrderNavigator in project teiid by teiid.

the class GroupCollectorVisitor method getGroupsIgnoreInlineViewsAndEvaluatableSubqueries.

/**
 * Helper to quickly get the groups from obj in the groups collection
 * @param obj Language object
 * @param elements Collection to collect groups in
 */
public static void getGroupsIgnoreInlineViewsAndEvaluatableSubqueries(LanguageObject obj, Collection<GroupSymbol> groups) {
    GroupCollectorVisitor visitor = new GroupCollectorVisitor(groups);
    visitor.setIgnoreInlineViewGroups(true);
    PreOrPostOrderNavigator nav = new PreOrPostOrderNavigator(visitor, PreOrPostOrderNavigator.PRE_ORDER, true);
    nav.setSkipEvaluatable(true);
    obj.acceptVisitor(nav);
    if (visitor.getInlineViewGroups() != null) {
        groups.removeAll(visitor.getInlineViewGroups());
    }
}
Also used : PreOrPostOrderNavigator(org.teiid.query.sql.navigator.PreOrPostOrderNavigator)

Aggregations

PreOrPostOrderNavigator (org.teiid.query.sql.navigator.PreOrPostOrderNavigator)6 HashSet (java.util.HashSet)2 LanguageObject (org.teiid.query.sql.LanguageObject)2 ArrayList (java.util.ArrayList)1 HashMap (java.util.HashMap)1 List (java.util.List)1 Map (java.util.Map)1 QueryMetadataException (org.teiid.api.exception.query.QueryMetadataException)1 TeiidComponentException (org.teiid.core.TeiidComponentException)1 Determinism (org.teiid.metadata.FunctionMethod.Determinism)1 SourceCapabilities (org.teiid.query.optimizer.capabilities.SourceCapabilities)1 LanguageVisitor (org.teiid.query.sql.LanguageVisitor)1 Command (org.teiid.query.sql.lang.Command)1 Query (org.teiid.query.sql.lang.Query)1 ExceptionExpression (org.teiid.query.sql.proc.ExceptionExpression)1 GroupSymbol (org.teiid.query.sql.symbol.GroupSymbol)1 EvaluatableVisitor (org.teiid.query.sql.visitor.EvaluatableVisitor)1