|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.teiid.query.rewriter.QueryRewriter
public class QueryRewriter
Rewrites commands and command fragments to a form that is better for planning and execution. There is a current limitation that command objects themselves cannot change type, since the same object is always used.
Field Summary | |
---|---|
static CompareCriteria |
FALSE_CRITERIA
|
static CompareCriteria |
TRUE_CRITERIA
|
static CompareCriteria |
UNKNOWN_CRITERIA
|
Method Summary | |
---|---|
static Query |
createInlineViewQuery(GroupSymbol group,
Command nested,
QueryMetadataInterface metadata,
java.util.List<SingleElementSymbol> actualSymbols)
|
static Command |
evaluateAndRewrite(Command command,
Evaluator eval,
CommandContext context,
QueryMetadataInterface metadata)
|
static boolean |
isDistinctWithGroupBy(Query query)
|
static boolean |
isNull(Expression expr)
|
static void |
makeSelectUnique(Select select,
boolean expressionSymbolsOnly)
|
static Criteria |
optimizeCriteria(CompoundCriteria criteria,
QueryMetadataInterface metadata)
Performs simple expression flattening |
static Command |
rewrite(Command command,
CreateUpdateProcedureCommand procCommand,
QueryMetadataInterface metadata,
CommandContext context,
java.util.Map variableValues,
int commandType)
|
static Command |
rewrite(Command command,
QueryMetadataInterface metadata,
CommandContext context)
|
static Criteria |
rewriteCriteria(Criteria criteria,
CreateUpdateProcedureCommand procCommand,
CommandContext context,
QueryMetadataInterface metadata)
Rewrite the criteria by evaluating some trivial cases. |
static Expression |
rewriteExpression(Expression expression,
CreateUpdateProcedureCommand procCommand,
CommandContext context,
QueryMetadataInterface metadata)
|
QueryCommand |
rewriteOrderBy(QueryCommand queryCommand)
Rewrite the order by clause. |
static boolean |
rewriteOrderBy(QueryCommand queryCommand,
OrderBy orderBy,
java.util.List projectedSymbols,
java.util.LinkedList<OrderByItem> unrelatedItems)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final CompareCriteria TRUE_CRITERIA
public static final CompareCriteria FALSE_CRITERIA
public static final CompareCriteria UNKNOWN_CRITERIA
Method Detail |
---|
public static Command evaluateAndRewrite(Command command, Evaluator eval, CommandContext context, QueryMetadataInterface metadata) throws TeiidProcessingException, TeiidComponentException
TeiidProcessingException
TeiidComponentException
public static Command rewrite(Command command, CreateUpdateProcedureCommand procCommand, QueryMetadataInterface metadata, CommandContext context, java.util.Map variableValues, int commandType) throws TeiidComponentException, TeiidProcessingException
TeiidComponentException
TeiidProcessingException
public static Command rewrite(Command command, QueryMetadataInterface metadata, CommandContext context) throws TeiidComponentException, TeiidProcessingException
TeiidComponentException
TeiidProcessingException
public static boolean isDistinctWithGroupBy(Query query)
public QueryCommand rewriteOrderBy(QueryCommand queryCommand) throws TeiidComponentException
query
-
TeiidComponentException,
- MetaMatrixProcessingException
TeiidComponentException
public static boolean rewriteOrderBy(QueryCommand queryCommand, OrderBy orderBy, java.util.List projectedSymbols, java.util.LinkedList<OrderByItem> unrelatedItems)
public static Criteria rewriteCriteria(Criteria criteria, CreateUpdateProcedureCommand procCommand, CommandContext context, QueryMetadataInterface metadata) throws TeiidComponentException, TeiidProcessingException
criteria
- The criteria to rewritemetadata
- userCriteria
- The criteria on user's command, used in rewriting HasCriteria
in the procedural language.
TeiidComponentException
TeiidProcessingException
public static Criteria optimizeCriteria(CompoundCriteria criteria, QueryMetadataInterface metadata)
criteria
-
public static boolean isNull(Expression expr)
public static Expression rewriteExpression(Expression expression, CreateUpdateProcedureCommand procCommand, CommandContext context, QueryMetadataInterface metadata) throws TeiidComponentException, TeiidProcessingException
TeiidComponentException
TeiidProcessingException
public static Query createInlineViewQuery(GroupSymbol group, Command nested, QueryMetadataInterface metadata, java.util.List<SingleElementSymbol> actualSymbols) throws QueryMetadataException, QueryResolverException, TeiidComponentException
QueryMetadataException
QueryResolverException
TeiidComponentException
public static void makeSelectUnique(Select select, boolean expressionSymbolsOnly)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |