public class QueryResolver extends Object
The QueryResolver is used between Parsing and QueryValidation. The SQL queries, inserts, updates and deletes are parsed and converted into objects. The language objects have variable names which resolved to fully qualified names using metadata information. The resolver is also used in transforming the values in language objects to their variable types defined in metadata.
Constructor and Description |
---|
QueryResolver() |
Modifier and Type | Method and Description |
---|---|
static Command |
expandCommand(ProcedureContainer proc,
QueryMetadataInterface metadata,
AnalysisRecord analysisRecord) |
static Map<ElementSymbol,Expression> |
getVariableValues(Command command,
boolean changingOnly,
QueryMetadataInterface metadata) |
static boolean |
isView(GroupSymbol virtualGroup,
QueryMetadataInterface qmi) |
static TempMetadataStore |
resolveCommand(Command currentCommand,
GroupSymbol container,
int type,
QueryMetadataInterface metadata,
boolean inferProcedureResultSetColumns)
Resolve a command in a given type container and type context.
|
static TempMetadataStore |
resolveCommand(Command command,
QueryMetadataInterface metadata)
This implements an algorithm to resolve all the symbols created by the
parser into real metadata IDs
|
static TempMetadataStore |
resolveCommand(Command currentCommand,
QueryMetadataInterface metadata,
boolean resolveNullLiterals) |
static void |
resolveCriteria(Criteria criteria,
QueryMetadataInterface metadata)
Resolve just a criteria.
|
static void |
resolveSubqueries(Command command,
TempMetadataAdapter metadata,
Collection<GroupSymbol> externalGroups) |
static QueryNode |
resolveView(GroupSymbol virtualGroup,
QueryNode qnode,
String cacheString,
QueryMetadataInterface qmi,
boolean logValidation) |
static void |
setChildMetadata(Command subCommand,
Command parent) |
static void |
setChildMetadata(Command subCommand,
TempMetadataStore parentTempMetadata,
GroupContext parentContext) |
static void |
validateProjectedSymbols(GroupSymbol virtualGroup,
List<? extends Expression> symbols,
List<? extends Expression> projectedSymbols) |
static void |
validateProjectedSymbols(GroupSymbol virtualGroup,
QueryMetadataInterface qmi,
Command result) |
public static Command expandCommand(ProcedureContainer proc, QueryMetadataInterface metadata, AnalysisRecord analysisRecord) throws QueryResolverException, QueryMetadataException, TeiidComponentException
public static TempMetadataStore resolveCommand(Command command, QueryMetadataInterface metadata) throws QueryResolverException, TeiidComponentException
command
- Command the SQL command we are running (Select, Update,
Insert, Delete)metadata
- QueryMetadataInterface the metadataQueryResolverException
TeiidComponentException
public static TempMetadataStore resolveCommand(Command currentCommand, GroupSymbol container, int type, QueryMetadataInterface metadata, boolean inferProcedureResultSetColumns) throws QueryResolverException, TeiidComponentException
type
- The Command
typeinferProcedureResultSetColumns
- if true and the currentCommand is a procedure definition, then resolving will set the getResultSetColumns on the command to what is discoverable in the procedure body.QueryResolverException
TeiidComponentException
public static TempMetadataStore resolveCommand(Command currentCommand, QueryMetadataInterface metadata, boolean resolveNullLiterals) throws QueryResolverException, TeiidComponentException
public static void resolveCriteria(Criteria criteria, QueryMetadataInterface metadata) throws QueryResolverException, QueryMetadataException, TeiidComponentException
criteria
- Criteria to resolvemetadata
- Metadata implementationQueryResolverException
QueryMetadataException
TeiidComponentException
public static void setChildMetadata(Command subCommand, TempMetadataStore parentTempMetadata, GroupContext parentContext)
public static Map<ElementSymbol,Expression> getVariableValues(Command command, boolean changingOnly, QueryMetadataInterface metadata) throws QueryMetadataException, QueryResolverException, TeiidComponentException
public static void resolveSubqueries(Command command, TempMetadataAdapter metadata, Collection<GroupSymbol> externalGroups) throws QueryResolverException, TeiidComponentException
public static QueryNode resolveView(GroupSymbol virtualGroup, QueryNode qnode, String cacheString, QueryMetadataInterface qmi, boolean logValidation) throws TeiidComponentException, QueryMetadataException, QueryResolverException, QueryValidatorException
public static void validateProjectedSymbols(GroupSymbol virtualGroup, QueryMetadataInterface qmi, Command result) throws QueryMetadataException, TeiidComponentException, QueryValidatorException
public static void validateProjectedSymbols(GroupSymbol virtualGroup, List<? extends Expression> symbols, List<? extends Expression> projectedSymbols) throws QueryValidatorException
QueryValidatorException
public static boolean isView(GroupSymbol virtualGroup, QueryMetadataInterface qmi) throws TeiidComponentException, QueryMetadataException
Copyright © 2019. All rights reserved.