Package org.teiid.query.resolver
Class ProcedureContainerResolver
- java.lang.Object
-
- org.teiid.query.resolver.ProcedureContainerResolver
-
- All Implemented Interfaces:
CommandResolver
- Direct Known Subclasses:
DeleteResolver
,ExecResolver
,InsertResolver
,UpdateResolver
public abstract class ProcedureContainerResolver extends Object implements CommandResolver
-
-
Constructor Summary
Constructors Constructor Description ProcedureContainerResolver()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description static void
addChanging(TempMetadataStore discoveredMetadata, GroupContext externalGroups, List<ElementSymbol> elements)
static GroupSymbol
addScalarGroup(String name, TempMetadataStore metadata, GroupContext externalGroups, List<? extends Expression> symbols)
static GroupSymbol
addScalarGroup(String name, TempMetadataStore metadata, GroupContext externalGroups, List<? extends Expression> symbols, boolean updatable)
static GroupSymbol
addScalarGroup(String name, TempMetadataStore metadata, GroupContext externalGroups, List<? extends Expression> symbols, boolean[] updatable)
Command
expandCommand(ProcedureContainer procCommand, QueryMetadataInterface metadata, AnalysisRecord analysis)
Expand a command by finding and attaching all subcommands to the command.static void
findChildCommandMetadata(Command currentCommand, GroupSymbol container, int type, QueryMetadataInterface metadata, boolean inferProcedureResultSetColumns)
Set the appropriate "external" metadata for the given commandprotected abstract String
getPlan(QueryMetadataInterface metadata, GroupSymbol group)
For a given resolver, this returns the unparsed command.static UpdateValidator.UpdateInfo
getUpdateInfo(GroupSymbol group, QueryMetadataInterface metadata)
static UpdateValidator.UpdateInfo
getUpdateInfo(GroupSymbol group, QueryMetadataInterface metadata, int type, boolean validate)
void
resolveCommand(Command command, TempMetadataAdapter metadata, boolean resolveNullLiterals)
Resolve the command using the metadata.protected void
resolveGroup(TempMetadataAdapter metadata, ProcedureContainer procCommand)
abstract void
resolveProceduralCommand(Command command, TempMetadataAdapter metadata)
static String
validateUpdateInfo(GroupSymbol group, int type, UpdateValidator.UpdateInfo info)
-
-
-
Method Detail
-
resolveProceduralCommand
public abstract void resolveProceduralCommand(Command command, TempMetadataAdapter metadata) throws QueryMetadataException, QueryResolverException, TeiidComponentException
-
expandCommand
public Command expandCommand(ProcedureContainer procCommand, QueryMetadataInterface metadata, AnalysisRecord analysis) throws QueryMetadataException, QueryResolverException, TeiidComponentException
Expand a command by finding and attaching all subcommands to the command. If some initial resolution must be done for this to be accomplished, that is ok, but it should be kept to a minimum.- Parameters:
procCommand
- The command to expandmetadata
- Metadata accessanalysis
- The analysis record that will be filled in if doing annotation.- Throws:
QueryMetadataException
- If there is a metadata problemQueryResolverException
- If the query cannot be resolvedTeiidComponentException
- If there is an internal error
-
getPlan
protected abstract String getPlan(QueryMetadataInterface metadata, GroupSymbol group) throws TeiidComponentException, QueryMetadataException, QueryResolverException
For a given resolver, this returns the unparsed command.- Parameters:
metadata
-group
-- Returns:
- Throws:
TeiidComponentException
QueryMetadataException
QueryResolverException
-
addChanging
public static void addChanging(TempMetadataStore discoveredMetadata, GroupContext externalGroups, List<ElementSymbol> elements)
-
resolveCommand
public void resolveCommand(Command command, TempMetadataAdapter metadata, boolean resolveNullLiterals) throws QueryMetadataException, QueryResolverException, TeiidComponentException
Description copied from interface:CommandResolver
Resolve the command using the metadata.- Specified by:
resolveCommand
in interfaceCommandResolver
- Parameters:
command
- The command to resolvemetadata
- MetadataresolveNullLiterals
- true if the resolver should consider replacing null literals with more appropriate types- Throws:
QueryMetadataException
- If there is a metadata problemQueryResolverException
- If the query cannot be resolvedTeiidComponentException
- If there is an internal error- See Also:
CommandResolver.resolveCommand(org.teiid.query.sql.lang.Command, org.teiid.query.metadata.TempMetadataAdapter, boolean)
-
getUpdateInfo
public static UpdateValidator.UpdateInfo getUpdateInfo(GroupSymbol group, QueryMetadataInterface metadata, int type, boolean validate) throws QueryMetadataException, TeiidComponentException, QueryResolverException
-
validateUpdateInfo
public static String validateUpdateInfo(GroupSymbol group, int type, UpdateValidator.UpdateInfo info)
-
getUpdateInfo
public static UpdateValidator.UpdateInfo getUpdateInfo(GroupSymbol group, QueryMetadataInterface metadata) throws TeiidComponentException, QueryMetadataException, QueryResolverException
-
resolveGroup
protected void resolveGroup(TempMetadataAdapter metadata, ProcedureContainer procCommand) throws TeiidComponentException, QueryResolverException
- Parameters:
metadata
-procCommand
-- Throws:
TeiidComponentException
QueryResolverException
-
addScalarGroup
public static GroupSymbol addScalarGroup(String name, TempMetadataStore metadata, GroupContext externalGroups, List<? extends Expression> symbols)
-
addScalarGroup
public static GroupSymbol addScalarGroup(String name, TempMetadataStore metadata, GroupContext externalGroups, List<? extends Expression> symbols, boolean updatable)
-
addScalarGroup
public static GroupSymbol addScalarGroup(String name, TempMetadataStore metadata, GroupContext externalGroups, List<? extends Expression> symbols, boolean[] updatable)
-
findChildCommandMetadata
public static void findChildCommandMetadata(Command currentCommand, GroupSymbol container, int type, QueryMetadataInterface metadata, boolean inferProcedureResultSetColumns) throws QueryMetadataException, TeiidComponentException, QueryResolverException
Set the appropriate "external" metadata for the given command- Parameters:
inferProcedureResultSetColumns
-- Throws:
QueryResolverException
QueryMetadataException
TeiidComponentException
-
-