Package org.teiid.translator
Class ExecutionFactory<F,C>
- java.lang.Object
-
- org.teiid.translator.ExecutionFactory<F,C>
-
- Direct Known Subclasses:
AccumuloExecutionFactory
,BaseDelegatingExecutionFactory
,CassandraExecutionFactory
,CouchbaseExecutionFactory
,ExcelExecutionFactory
,FileExecutionFactory
,InfinispanExecutionFactory
,JDBCExecutionFactory
,JPA2ExecutionFactory
,LDAPExecutionFactory
,MongoDBExecutionFactory
,ODataExecutionFactory
,ODataExecutionFactory
,OlapExecutionFactory
,OpenAPIExecutionFactory
,S3ExecutionFactory
,SalesForceExecutionFactory
,SimpleDBExecutionFactory
,SolrExecutionFactory
,SpreadsheetExecutionFactory
,SwaggerExecutionFactory
,WSExecutionFactory
,YahooExecutionFactory
public class ExecutionFactory<F,C> extends Object
The primary entry point for a Translator. This class should be extended by the custom translator writer. The deployer instantiates this class through reflection. So it is important to have no-arg constructor. Once constructed the "start" method is called. This class represents the basic capabilities of the translator.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ExecutionFactory.Format
static class
ExecutionFactory.NullOrder
static class
ExecutionFactory.SupportedJoinCriteria
static class
ExecutionFactory.TransactionSupport
-
Field Summary
Fields Modifier and Type Field Description static int
DEFAULT_MAX_FROM_GROUPS
static int
DEFAULT_MAX_IN_CRITERIA_SIZE
static int
DEFAULT_MAX_PROJECTED_COLUMNS
-
Constructor Summary
Constructors Constructor Description ExecutionFactory()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected FunctionMethod
addPushDownFunction(String qualifier, String name, String returnType, String... paramTypes)
Adds a pushdown function.boolean
areLobsUsableAfterClose()
Indicates if LOBs are usable after the execution is closed.void
closeConnection(C connection, F factory)
Closes a connection object from the given connection factory.ProcedureExecution
createDirectExecution(List<Argument> arguments, Command command, ExecutionContext executionContext, RuntimeMetadata metadata, C connection)
Execution
createExecution(Command command, ExecutionContext executionContext, RuntimeMetadata metadata, C connection)
Create an execution object for the specified commandProcedureExecution
createProcedureExecution(Call command, ExecutionContext executionContext, RuntimeMetadata metadata, C connection)
ResultSetExecution
createResultSetExecution(QueryExpression command, ExecutionContext executionContext, RuntimeMetadata metadata, C connection)
UpdateExecution
createUpdateExecution(Command command, ExecutionContext executionContext, RuntimeMetadata metadata, C connection)
CacheDirective
getCacheDirective(Command command, ExecutionContext executionContext, RuntimeMetadata metadata)
Get theCacheDirective
to control command caching.String
getCollationLocale()
Indicates the collation used for sortingC
getConnection(F factory)
Deprecated.C
getConnection(F factory, ExecutionContext executionContext)
Return a connection object from the given connection factory.ExecutionFactory.NullOrder
getDefaultNullOrder()
Returns the default null orderingString
getDirectQueryProcedureName()
Defines the name of the direct processing procedure.String
getExcludedCommonTableExpressionName()
static <T> T
getInstance(Class<T> expectedType, String className, Collection<?> ctorObjs, Class<? extends T> defaultClass)
LanguageFactory
getLanguageFactory()
Obtain a reference to the default LanguageFactory that can be used to construct new language interface objects.int
getMaxDependentInPredicates()
Get the integer value representing the max number of dependent IN predicates.int
getMaxFromGroups()
The number of groups supported in the from clause.int
getMaxInCriteriaSize()
Get the integer value representing the number of values allowed in an IN criteria in the WHERE clause of a queryint
getMaxProjectedColumns()
The number of columns supported in projected select clause.void
getMetadata(MetadataFactory metadataFactory, C conn)
Implement to provide metadata to the metadata for use by the engine.MetadataProcessor<C>
getMetadataProcessor()
Get a MetadataProcessor for the translator to read the metadata.String
getNativeQueryProcedureName()
Deprecated.List<FunctionMethod>
getPushDownFunctions()
Get a list ofFunctionMethod
s that will be contributed to the SYS schema.Character
getRequiredLikeEscape()
The required escape character or null if all are supported.List<String>
getSupportedFunctions()
Get list of all supported function names.ExecutionFactory.SupportedJoinCriteria
getSupportedJoinCriteria()
Get the supported join criteria.ExecutionFactory.TransactionSupport
getTransactionSupport()
TypeFacility
getTypeFacility()
Obtain a reference to the type facility, which can be used to perform many type conversions supplied by the Connector API.void
initCapabilities(C connection)
Will be called bystart()
with a null connection if a source connection is notisSourceRequiredForCapabilities()
boolean
isCopyLobs()
boolean
isForkable()
When forkable the engine may use a separate thread to interact with returnedExecution
.boolean
isImmutable()
Defines if the Connector is read-only connectorboolean
isSourceRequired()
Flag that indicates if a underlying source connection required for this execution factory to workboolean
isSourceRequiredForCapabilities()
If true, theinitCapabilities(Object)
method will be consulted prior to determining the capabilitiesboolean
isSourceRequiredForMetadata()
Flag that indicates if a underlying source connection required for this execution factory to return metadataboolean
isThreadBound()
boolean
requiresCriteria()
Whether the source supports queries without criteria.boolean
returnsSingleUpdateCount()
True if only a single value is returned for the update count.void
setCollationLocale(String collation)
void
setCopyLobs(boolean copyLobs)
void
setDirectQueryProcedureName(String name)
void
setExcludedCommonTableExpressionName(String excludedCommonTableExpressionName)
void
setImmutable(boolean arg0)
void
setMaxDependentInPredicates(int maxDependentInPredicates)
void
setMaxInCriteriaSize(int maxInSize)
void
setNativeQueryProcedureName(String name)
Deprecated.void
setRequiresCriteria(boolean requiresCriteria)
void
setSourceRequired(boolean value)
void
setSourceRequiredForMetadata(boolean sourceRequiredForMetadata)
void
setSupportedJoinCriteria(ExecutionFactory.SupportedJoinCriteria supportedJoinCriteria)
void
setSupportsDirectQueryProcedure(boolean state)
void
setSupportsFullOuterJoins(boolean supportsFullOuterJoins)
void
setSupportsInnerJoins(boolean supportsInnerJoins)
void
setSupportsNativeQueries(boolean state)
Deprecated.void
setSupportsOrderBy(boolean supportsOrderBy)
void
setSupportsOuterJoins(boolean supportsOuterJoins)
void
setSupportsSelectDistinct(boolean supportsSelectDistinct)
void
setThreadBound(boolean threadBound)
void
setTransactionSupport(ExecutionFactory.TransactionSupport transactionSupport)
void
start()
Initialize the connector with supplied configurationboolean
supportsAdvancedOlapOperations()
boolean
supportsAggregatesAvg()
Support indicates connector can accept the AVG aggregate functionboolean
supportsAggregatesCount()
Support indicates connector can accept the COUNT aggregate functionboolean
supportsAggregatesCountBig()
boolean
supportsAggregatesCountStar()
Support indicates connector can accept the COUNT(*) aggregate functionboolean
supportsAggregatesDistinct()
Support indicates connector can accept DISTINCT within aggregate functionsboolean
supportsAggregatesEnhancedNumeric()
Support indicates connector can accept STDDEV_POP, STDDEV_VAR, VAR_POP, VAR_SAMPboolean
supportsAggregatesMax()
Support indicates connector can accept the MAX aggregate functionboolean
supportsAggregatesMin()
Support indicates connector can accept the MIN aggregate functionboolean
supportsAggregatesSum()
Support indicates connector can accept the SUM aggregate functionboolean
supportsAliasedTable()
Support indicates connector can accept groups with aliasesboolean
supportsArrayAgg()
boolean
supportsArrayType()
The engine uses array types for dependent joins and for array expression.boolean
supportsBatchedUpdates()
Whether the source supportsBatchedUpdates
boolean
supportsBulkUpdate()
Whether the source supports updates with multiple value setsboolean
supportsCommonTableExpressions()
boolean
supportsCompareCriteriaEquals()
Support indicates connector accepts criteria of form (element = constant)boolean
supportsCompareCriteriaOrdered()
Support indicates connector accepts criteria of form (element <=|>= constant)
The query engine will may pushdown queries containing < or > if NOT is also supported.boolean
supportsCompareCriteriaOrderedExclusive()
Support indicates connector accepts criteria of form (element <|> constant)boolean
supportsConvert(int fromType, int toType)
Used for fine grained control of convert/cast pushdown.boolean
supportsCorrelatedSubqueries()
Support indicates connector can accept correlated subqueries wherever subqueries are acceptedboolean
supportsCorrelatedSubqueryLimit()
boolean
supportsDependentJoins()
NOTE: The pushed independent tuples will not have been converted to a unique set and may contain duplicates.boolean
supportsDirectQueryProcedure()
True, if this translator supports execution of source specific commands unaltered through a direct procedure.boolean
supportsElementaryOlapOperations()
boolean
supportsExcept()
Support indicates that the connector supports the EXCEPT of two queries.boolean
supportsExistsCriteria()
Support indicates connector accepts the EXISTS criteriaboolean
supportsFormatLiteral(String literal, ExecutionFactory.Format format)
boolean
supportsFullDependentJoins()
boolean
supportsFullOuterJoins()
Support indicates connector can accept full outer joinsboolean
supportsFunctionsInGroupBy()
Support indicates that the connector supports non-column expressions in GROUP BY, such as:SELECT dayofmonth(theDate), COUNT(*) FROM table GROUP BY dayofmonth(theDate)
boolean
supportsGeographyType()
If the geography type is supported by the standard ST_ geospatial functionsboolean
supportsGroupBy()
Whether the source supports an explicit GROUP BY clauseboolean
supportsGroupByMultipleDistinctAggregates()
Whether the source supports grouping with multiple distinct aggregatesboolean
supportsGroupByRollup()
boolean
supportsHaving()
Whether the source supports the HAVING clauseboolean
supportsInCriteria()
Support indicates connector accepts criteria of form (element IN set)boolean
supportsInCriteriaSubquery()
Support indicates connector accepts IN criteria with a subquery on the right sideboolean
supportsInlineViews()
Support indicates connector can accept inline views (subqueries in the FROM clause).boolean
supportsInnerJoins()
Support indicates connector can accept inner or cross joinsboolean
supportsInsertWithQueryExpression()
boolean
supportsIntersect()
Support indicates that the connector supports the INTERSECT of two queries.boolean
supportsIsDistinctCriteria()
Support indicates connector accepts criteria of form (exp1 IS DISTINCT exp2)boolean
supportsIsNullCriteria()
Support indicates connector accepts criteria of form (element IS NULL)boolean
supportsLateralJoin()
boolean
supportsLateralJoinCondition()
boolean
supportsLikeCriteria()
Support indicates connector accepts criteria of form (element LIKE constant)boolean
supportsLikeCriteriaEscapeCharacter()
Support indicates connector accepts criteria of form (element LIKE constant ESCAPE char)boolean
supportsLikeRegex()
boolean
supportsListAgg()
boolean
supportsMultipleOpenExecutions()
boolean
supportsNativeQueries()
Deprecated.boolean
supportsNotCriteria()
Support indicates connector accepts logical criteria NOTboolean
supportsOnlyCorrelatedSubqueries()
boolean
supportsOnlyFormatLiterals()
boolean
supportsOnlyLateralJoinProcedure()
boolean
supportsOnlyLiteralComparison()
boolean
supportsOnlySingleTableGroupBy()
Whether the source supports grouping only over a single tableboolean
supportsOnlyTimestampAddLiteral()
boolean
supportsOrCriteria()
Support indicates connector accepts logical criteria connected by ORboolean
supportsOrderBy()
Support indicates connector accepts ORDER BY clause, including multiple elements and ascending and descending sorts.boolean
supportsOrderByNullOrdering()
Returns whether the database supports explicit null ordering.boolean
supportsOrderByUnrelated()
Support indicates connector accepts ORDER BY clause with columns not from the selectboolean
supportsOrderByWithExtendedGrouping()
boolean
supportsOuterJoins()
Support indicates connector can accept left outer joinsboolean
supportsPartialFiltering()
Return true if the source has columns marked with the teiid_rel:partial that can return more rows than specified by a filter if the column is also projected.boolean
supportsProcedureParameterExpression()
Return true if the translator supports expressions as procedure paramters.boolean
supportsProcedureTable()
boolean
supportsQuantifiedCompareCriteriaAll()
Support indicates connector accepts the quantified comparison criteria that use ALLboolean
supportsQuantifiedCompareCriteriaSome()
Support indicates connector accepts the quantified comparison criteria that use SOMEboolean
supportsRecursiveCommonTableExpressions()
boolean
supportsRowLimit()
Gets whether the connector can limit the number of rows returned by a query.boolean
supportsRowOffset()
Gets whether the connector supports a SQL clause (similar to the LIMIT with an offset) that can return result sets that start in the middle of the resulting rows returned by a queryboolean
supportsScalarSubqueries()
Support indicates connector can accept scalar subqueries in the SELECT, WHERE, and HAVING clausesboolean
supportsScalarSubqueryProjection()
If a scalar subquery can be projected.boolean
supportsSearchedCaseExpressions()
Support indicates connector can accept queries with searched CASE WHEN criteria ...boolean
supportsSelectDistinct()
Support indicates connector can accept queries with SELECT DISTINCTboolean
supportsSelectExpression()
Support indicates connector can accept expressions other than element symbols in the SELECT clause.boolean
supportsSelectExpressionArrayType()
boolean
supportsSelectWithoutFrom()
boolean
supportsSelfJoins()
Support indicates connector can accept self-joins where a group is joined to itself with aliases.boolean
supportsSetQueryLimitOffset()
Support indicates that the connector supports an LIMIT/OFFSET on a SetQuery.boolean
supportsSetQueryOrderBy()
Support indicates that the connector supports an ORDER BY on a SetQuery.boolean
supportsSimilarTo()
boolean
supportsStringAgg()
boolean
supportsSubqueryCommonTableExpressions()
boolean
supportsSubqueryInOn()
Refines subquery support.boolean
supportsUnions()
Support indicates that the connector supports the UNION of two queries.boolean
supportsUpsert()
boolean
supportsWindowDistinctAggregates()
boolean
supportsWindowFrameClause()
boolean
supportsWindowFunctionCumeDist()
boolean
supportsWindowFunctionNthValue()
boolean
supportsWindowFunctionNtile()
boolean
supportsWindowFunctionPercentRank()
boolean
supportsWindowOrderByWithAggregates()
boolean
useAnsiJoin()
Whether the source prefers to use ANSI style joins.boolean
useBindingsForDependentJoin()
If dependent join predicates should use literals that are marked as bind eligible.
-
-
-
Field Detail
-
DEFAULT_MAX_FROM_GROUPS
public static final int DEFAULT_MAX_FROM_GROUPS
- See Also:
- Constant Field Values
-
DEFAULT_MAX_PROJECTED_COLUMNS
public static final int DEFAULT_MAX_PROJECTED_COLUMNS
- See Also:
- Constant Field Values
-
DEFAULT_MAX_IN_CRITERIA_SIZE
public static final int DEFAULT_MAX_IN_CRITERIA_SIZE
- See Also:
- Constant Field Values
-
-
Method Detail
-
start
public void start() throws TranslatorException
Initialize the connector with supplied configuration- Throws:
TranslatorException
-
isImmutable
@TranslatorProperty(display="Is Immutable", description="Is Immutable, True if the source never changes.", advanced=true) public boolean isImmutable()
Defines if the Connector is read-only connector- Returns:
-
setImmutable
public void setImmutable(boolean arg0)
-
isCopyLobs
@TranslatorProperty(display="Copy LOBs", description="If true, returned LOBs will be copied, rather than streamed from the source", advanced=true) public boolean isCopyLobs()
-
setCopyLobs
public void setCopyLobs(boolean copyLobs)
-
getConnection
@Deprecated public C getConnection(F factory) throws TranslatorException
Deprecated.Return a connection object from the given connection factory. The default implementation assumes a JCAConnectionFactory
. Subclasses should override, if they use another type of connection factory.- Parameters:
factory
-- Returns:
- a connection
- Throws:
TranslatorException
- See Also:
getConnection(Object, ExecutionContext)
-
getConnection
public C getConnection(F factory, ExecutionContext executionContext) throws TranslatorException
Return a connection object from the given connection factory. The default implementation assumes a JCAConnectionFactory
. Subclasses should override, if they use another type of connection factory or wish to use theExecutionContext
. By default callsgetConnection(Object)
- Parameters:
factory
-executionContext
- null if this is a system request for a connection- Returns:
- a connection
- Throws:
TranslatorException
-
closeConnection
public void closeConnection(C connection, F factory)
Closes a connection object from the given connection factory. The default implementation assumes a JCAConnection
. Subclasses should override, if they use another type of connection.- Parameters:
connection
-factory
-
-
isSourceRequired
public boolean isSourceRequired()
Flag that indicates if a underlying source connection required for this execution factory to work- Returns:
-
setSourceRequired
public void setSourceRequired(boolean value)
-
isSourceRequiredForMetadata
public boolean isSourceRequiredForMetadata()
Flag that indicates if a underlying source connection required for this execution factory to return metadata- Returns:
- true if required
-
isSourceRequiredForCapabilities
public boolean isSourceRequiredForCapabilities()
If true, theinitCapabilities(Object)
method will be consulted prior to determining the capabilities- Returns:
-
initCapabilities
public void initCapabilities(C connection) throws TranslatorException
Will be called bystart()
with a null connection if a source connection is notisSourceRequiredForCapabilities()
- Parameters:
connection
-- Throws:
TranslatorException
-
setSourceRequiredForMetadata
public void setSourceRequiredForMetadata(boolean sourceRequiredForMetadata)
-
getLanguageFactory
public LanguageFactory getLanguageFactory()
Obtain a reference to the default LanguageFactory that can be used to construct new language interface objects. This is typically needed when modifying the language objects passed to the connector or for testing when objects need to be created.
-
getTypeFacility
public TypeFacility getTypeFacility()
Obtain a reference to the type facility, which can be used to perform many type conversions supplied by the Connector API.
-
createExecution
public Execution createExecution(Command command, ExecutionContext executionContext, RuntimeMetadata metadata, C connection) throws TranslatorException
Create an execution object for the specified command- Parameters:
command
- the commandexecutionContext
- Provides information about the context that this command is executing within, such as the identifiers for the command being executedmetadata
- Access to runtime metadata if needed to translate the commandconnection
- connection factory object to the data source- Returns:
- An execution object that can use to execute the command
- Throws:
TranslatorException
-
createResultSetExecution
public ResultSetExecution createResultSetExecution(QueryExpression command, ExecutionContext executionContext, RuntimeMetadata metadata, C connection) throws TranslatorException
- Throws:
TranslatorException
-
createProcedureExecution
public ProcedureExecution createProcedureExecution(Call command, ExecutionContext executionContext, RuntimeMetadata metadata, C connection) throws TranslatorException
- Throws:
TranslatorException
-
createUpdateExecution
public UpdateExecution createUpdateExecution(Command command, ExecutionContext executionContext, RuntimeMetadata metadata, C connection) throws TranslatorException
- Throws:
TranslatorException
-
createDirectExecution
public ProcedureExecution createDirectExecution(List<Argument> arguments, Command command, ExecutionContext executionContext, RuntimeMetadata metadata, C connection) throws TranslatorException
- Throws:
TranslatorException
-
getMetadataProcessor
public MetadataProcessor<C> getMetadataProcessor()
Get a MetadataProcessor for the translator to read the metadata. Typically this will return a new instance.- Returns:
-
supportsSelectDistinct
@TranslatorProperty(display="Supports Select Distinct", description="True, if this connector supports SELECT DISTINCT", advanced=true) public boolean supportsSelectDistinct()
Support indicates connector can accept queries with SELECT DISTINCT- Since:
- 3.1 SP2
-
setSupportsSelectDistinct
public void setSupportsSelectDistinct(boolean supportsSelectDistinct)
-
supportsSelectExpression
public boolean supportsSelectExpression()
Support indicates connector can accept expressions other than element symbols in the SELECT clause. Specific supports for the expression type are still checked.- Since:
- 6.1.0
-
supportsAliasedTable
public boolean supportsAliasedTable()
Support indicates connector can accept groups with aliases- Since:
- 3.1 SP2
-
getSupportedJoinCriteria
@TranslatorProperty(display="Supported Join Criteria", description="Returns one of any, theta, equi, or key", advanced=true) public ExecutionFactory.SupportedJoinCriteria getSupportedJoinCriteria()
Get the supported join criteria. A null return value will be treated asExecutionFactory.SupportedJoinCriteria.ANY
- Since:
- 6.1.0
-
setSupportedJoinCriteria
public void setSupportedJoinCriteria(ExecutionFactory.SupportedJoinCriteria supportedJoinCriteria)
-
supportsInnerJoins
@TranslatorProperty(display="Supports Inner Joins", description="True, if this connector supports inner joins", advanced=true) public boolean supportsInnerJoins()
Support indicates connector can accept inner or cross joins- Since:
- 6.1.0
-
setSupportsInnerJoins
public void setSupportsInnerJoins(boolean supportsInnerJoins)
-
supportsSelfJoins
public boolean supportsSelfJoins()
Support indicates connector can accept self-joins where a group is joined to itself with aliases. Connector must also supportsupportsAliasedTable()
.- Since:
- 3.1 SP2
-
supportsOuterJoins
@TranslatorProperty(display="Supports Outer Joins", description="True, if this connector supports outer joins", advanced=true) public boolean supportsOuterJoins()
Support indicates connector can accept left outer joins- Since:
- 3.1 SP2
-
setSupportsOuterJoins
public void setSupportsOuterJoins(boolean supportsOuterJoins)
-
supportsFullOuterJoins
@TranslatorProperty(display="Supports Full Outer Joins", description="True, if this connector supports full outer joins", advanced=true) public boolean supportsFullOuterJoins()
Support indicates connector can accept full outer joins- Since:
- 3.1 SP2
-
setSupportsFullOuterJoins
public void setSupportsFullOuterJoins(boolean supportsFullOuterJoins)
-
supportsInlineViews
public boolean supportsInlineViews()
Support indicates connector can accept inline views (subqueries in the FROM clause).- Since:
- 4.1
-
supportsIsDistinctCriteria
public boolean supportsIsDistinctCriteria()
Support indicates connector accepts criteria of form (exp1 IS DISTINCT exp2)- Since:
- 10.0
-
supportsCompareCriteriaEquals
public boolean supportsCompareCriteriaEquals()
Support indicates connector accepts criteria of form (element = constant)- Since:
- 3.1 SP2
-
supportsCompareCriteriaOrdered
public boolean supportsCompareCriteriaOrdered()
Support indicates connector accepts criteria of form (element <=|>= constant)
The query engine will may pushdown queries containing < or > if NOT is also supported.- Since:
- 3.1 SP2
-
supportsCompareCriteriaOrderedExclusive
public boolean supportsCompareCriteriaOrderedExclusive()
Support indicates connector accepts criteria of form (element <|> constant)
-
supportsLikeCriteria
public boolean supportsLikeCriteria()
Support indicates connector accepts criteria of form (element LIKE constant)- Since:
- 3.1 SP2
-
supportsLikeCriteriaEscapeCharacter
public boolean supportsLikeCriteriaEscapeCharacter()
Support indicates connector accepts criteria of form (element LIKE constant ESCAPE char)- Since:
- 3.1 SP2
-
supportsInCriteria
public boolean supportsInCriteria()
Support indicates connector accepts criteria of form (element IN set)- Since:
- 3.1 SP2
-
supportsInCriteriaSubquery
public boolean supportsInCriteriaSubquery()
Support indicates connector accepts IN criteria with a subquery on the right side- Since:
- 4.0
-
supportsIsNullCriteria
public boolean supportsIsNullCriteria()
Support indicates connector accepts criteria of form (element IS NULL)- Since:
- 3.1 SP2
-
supportsOrCriteria
public boolean supportsOrCriteria()
Support indicates connector accepts logical criteria connected by OR- Since:
- 3.1 SP2
-
supportsNotCriteria
public boolean supportsNotCriteria()
Support indicates connector accepts logical criteria NOT- Since:
- 3.1 SP2
-
supportsExistsCriteria
public boolean supportsExistsCriteria()
Support indicates connector accepts the EXISTS criteria- Since:
- 4.0
-
supportsQuantifiedCompareCriteriaSome
public boolean supportsQuantifiedCompareCriteriaSome()
Support indicates connector accepts the quantified comparison criteria that use SOME- Since:
- 4.0
-
supportsQuantifiedCompareCriteriaAll
public boolean supportsQuantifiedCompareCriteriaAll()
Support indicates connector accepts the quantified comparison criteria that use ALL- Since:
- 4.0
-
supportsOrderBy
@TranslatorProperty(display="Supports ORDER BY", description="True, if this connector supports ORDER BY", advanced=true) public boolean supportsOrderBy()
Support indicates connector accepts ORDER BY clause, including multiple elements and ascending and descending sorts.- Since:
- 3.1 SP2
-
setSupportsOrderBy
public void setSupportsOrderBy(boolean supportsOrderBy)
-
getCollationLocale
@TranslatorProperty(display="Collation Locale", description="The collation locale used by default for sorting.", advanced=true) public String getCollationLocale()
Indicates the collation used for sorting
-
setCollationLocale
public void setCollationLocale(String collation)
-
supportsOrderByUnrelated
public boolean supportsOrderByUnrelated()
Support indicates connector accepts ORDER BY clause with columns not from the select- Returns:
- Since:
- 6.2
-
getDefaultNullOrder
public ExecutionFactory.NullOrder getDefaultNullOrder()
Returns the default null ordering- Returns:
- the
ExecutionFactory.NullOrder
- Since:
- 7.1
-
supportsOrderByNullOrdering
public boolean supportsOrderByNullOrdering()
Returns whether the database supports explicit null ordering.- Returns:
- true if nulls first/last can be specified
- Since:
- 7.1
-
supportsGroupBy
public boolean supportsGroupBy()
Whether the source supports an explicit GROUP BY clause- Since:
- 6.1
-
supportsOnlySingleTableGroupBy
public boolean supportsOnlySingleTableGroupBy()
Whether the source supports grouping only over a single table- Returns:
-
supportsGroupByMultipleDistinctAggregates
public boolean supportsGroupByMultipleDistinctAggregates()
Whether the source supports grouping with multiple distinct aggregates- Returns:
-
supportsHaving
public boolean supportsHaving()
Whether the source supports the HAVING clause- Since:
- 6.1
-
supportsAggregatesSum
public boolean supportsAggregatesSum()
Support indicates connector can accept the SUM aggregate function- Since:
- 3.1 SP2
-
supportsAggregatesAvg
public boolean supportsAggregatesAvg()
Support indicates connector can accept the AVG aggregate function- Since:
- 3.1 SP2
-
supportsAggregatesMin
public boolean supportsAggregatesMin()
Support indicates connector can accept the MIN aggregate function- Since:
- 3.1 SP2
-
supportsAggregatesMax
public boolean supportsAggregatesMax()
Support indicates connector can accept the MAX aggregate function- Since:
- 3.1 SP2
-
supportsAggregatesCount
public boolean supportsAggregatesCount()
Support indicates connector can accept the COUNT aggregate function- Since:
- 3.1 SP2
-
supportsAggregatesCountStar
public boolean supportsAggregatesCountStar()
Support indicates connector can accept the COUNT(*) aggregate function- Since:
- 3.1 SP2
-
supportsAggregatesDistinct
public boolean supportsAggregatesDistinct()
Support indicates connector can accept DISTINCT within aggregate functions- Since:
- 3.1 SP2
-
supportsAggregatesEnhancedNumeric
public boolean supportsAggregatesEnhancedNumeric()
Support indicates connector can accept STDDEV_POP, STDDEV_VAR, VAR_POP, VAR_SAMP- Since:
- 7.1
-
supportsStringAgg
public boolean supportsStringAgg()
- Returns:
- true if string_agg is supported
- Since:
- 8.4
-
supportsListAgg
public boolean supportsListAgg()
- Returns:
- true if the translator supports a simplified string_agg - listagg
- Since:
- 11.2
-
supportsScalarSubqueries
public boolean supportsScalarSubqueries()
Support indicates connector can accept scalar subqueries in the SELECT, WHERE, and HAVING clauses- Since:
- 4.0
-
supportsCorrelatedSubqueries
public boolean supportsCorrelatedSubqueries()
Support indicates connector can accept correlated subqueries wherever subqueries are accepted- Since:
- 4.0
-
supportsSearchedCaseExpressions
public boolean supportsSearchedCaseExpressions()
Support indicates connector can accept queries with searched CASE WHEN criteria ... END- Since:
- 4.0
-
supportsUnions
public boolean supportsUnions()
Support indicates that the connector supports the UNION of two queries.- Since:
- 4.2
-
supportsSetQueryOrderBy
public boolean supportsSetQueryOrderBy()
Support indicates that the connector supports an ORDER BY on a SetQuery.- Since:
- 5.6
-
supportsSetQueryLimitOffset
public boolean supportsSetQueryLimitOffset()
Support indicates that the connector supports an LIMIT/OFFSET on a SetQuery.- Since:
- 10.0
-
supportsIntersect
public boolean supportsIntersect()
Support indicates that the connector supports the INTERSECT of two queries.- Since:
- 5.6
-
supportsExcept
public boolean supportsExcept()
Support indicates that the connector supports the EXCEPT of two queries.- Since:
- 5.6
-
getSupportedFunctions
public List<String> getSupportedFunctions()
Get list of all supported function names. Arithmetic functions have names like "+".
-
getPushDownFunctions
public List<FunctionMethod> getPushDownFunctions()
Get a list ofFunctionMethod
s that will be contributed to the SYS schema. To avoid conflicts with system functions, the function name should contain a qualifier - typically <translator name>.<function name>- Returns:
- See Also:
addPushDownFunction(String, String, String, String...)
-
addPushDownFunction
protected FunctionMethod addPushDownFunction(String qualifier, String name, String returnType, String... paramTypes)
Adds a pushdown function.- Parameters:
qualifier
- will be pre-pended to the namename
-returnType
- seeTypeFacility.RUNTIME_NAMES
for type namesparamTypes
- seeTypeFacility.RUNTIME_NAMES
for type names- Returns:
- the FunctionMethod created.
-
getMaxInCriteriaSize
@TranslatorProperty(display="Max number of IN predicate entries", advanced=true) public int getMaxInCriteriaSize()
Get the integer value representing the number of values allowed in an IN criteria in the WHERE clause of a query- Since:
- 5.0
-
setMaxInCriteriaSize
public void setMaxInCriteriaSize(int maxInSize)
-
getMaxDependentInPredicates
@TranslatorProperty(display="Max number of dependent IN predicates", advanced=true) public int getMaxDependentInPredicates()
Get the integer value representing the max number of dependent IN predicates. This may be used to split a single dependent value via OR, or multiple dependent values via AND.
-
setMaxDependentInPredicates
public void setMaxDependentInPredicates(int maxDependentInPredicates)
-
supportsFunctionsInGroupBy
public boolean supportsFunctionsInGroupBy()
Support indicates that the connector supports non-column expressions in GROUP BY, such as:
SELECT dayofmonth(theDate), COUNT(*) FROM table GROUP BY dayofmonth(theDate)
- Since:
- 5.0
-
supportsRowLimit
public boolean supportsRowLimit()
Gets whether the connector can limit the number of rows returned by a query.- Since:
- 5.0 SP1
-
supportsRowOffset
public boolean supportsRowOffset()
Gets whether the connector supports a SQL clause (similar to the LIMIT with an offset) that can return result sets that start in the middle of the resulting rows returned by a query- Since:
- 5.0 SP1
-
getMaxFromGroups
public int getMaxFromGroups()
The number of groups supported in the from clause. Added for a Sybase limitation.- Returns:
- the number of groups supported in the from clause, or -1 if there is no limit
- Since:
- 5.6
-
getMaxProjectedColumns
public int getMaxProjectedColumns()
The number of columns supported in projected select clause. Added for a postgresql limitation.- Returns:
- the maximum number of columns in the projected select clause or -1 if there is no limit
- Since:
- 12.1
-
useAnsiJoin
public boolean useAnsiJoin()
Whether the source prefers to use ANSI style joins.- Since:
- 6.0
-
requiresCriteria
@TranslatorProperty(display="Requries Criteria", description="True, if this connector requires criteria on source queries", advanced=true) public boolean requiresCriteria()
Whether the source supports queries without criteria.- Since:
- 6.0
-
setRequiresCriteria
public void setRequiresCriteria(boolean requiresCriteria)
-
supportsBatchedUpdates
public boolean supportsBatchedUpdates()
Whether the source supportsBatchedUpdates
- Since:
- 6.0
-
supportsBulkUpdate
public boolean supportsBulkUpdate()
Whether the source supports updates with multiple value sets- Since:
- 6.0
-
supportsInsertWithQueryExpression
public boolean supportsInsertWithQueryExpression()
Support indicates that the connector can accept INSERTs with values specified by aSetQuery
orSelect
- Since:
- 6.1
-
getInstance
public static <T> T getInstance(Class<T> expectedType, String className, Collection<?> ctorObjs, Class<? extends T> defaultClass) throws TranslatorException
- Throws:
TranslatorException
-
getMetadata
public void getMetadata(MetadataFactory metadataFactory, C conn) throws TranslatorException
Implement to provide metadata to the metadata for use by the engine. This is the primary method of creating metadata for dynamic VDBs.- Parameters:
metadataFactory
-conn
- may be null if the source is not required- Throws:
TranslatorException
- to indicate a recoverable error, otherwise a RuntimeException- See Also:
isSourceRequiredForMetadata()
-
areLobsUsableAfterClose
public boolean areLobsUsableAfterClose()
Indicates if LOBs are usable after the execution is closed. This check is not performed for values that are alreadyClobType
orBlobType
- Returns:
- true if LOBs can be used after close
- Since:
- 7.2
-
supportsCommonTableExpressions
public boolean supportsCommonTableExpressions()
- Returns:
- true if the WITH clause is supported
- Since:
- 7.2
-
supportsRecursiveCommonTableExpressions
public boolean supportsRecursiveCommonTableExpressions()
- Returns:
- true if a recursive WITH clause item is supported
- Since:
- 8.9
-
supportsSubqueryCommonTableExpressions
public boolean supportsSubqueryCommonTableExpressions()
- Returns:
- true if the WITH clause can appear in subqueries
- Since:
- 8.12
-
supportsCorrelatedSubqueryLimit
public boolean supportsCorrelatedSubqueryLimit()
- Returns:
- true if a correlated subquery can support a limit clause
- Since:
- 8.12
-
supportsAdvancedOlapOperations
public boolean supportsAdvancedOlapOperations()
- Returns:
- true if Advanced OLAP operations are supported including the aggregate function filter clause.
- Since:
- 7.5
-
supportsElementaryOlapOperations
public boolean supportsElementaryOlapOperations()
- Returns:
- true if Elementary OLAP operations are supported including window functions and inline window specifications that include simple expressions in partitioning and ordering
- Since:
- 7.5
-
supportsWindowFrameClause
public boolean supportsWindowFrameClause()
- Returns:
- true if the window frame clause is supported
-
supportsWindowFunctionNtile
public boolean supportsWindowFunctionNtile()
- Returns:
- true if ntile is supported.
defaults to
supportsElementaryOlapOperations()
- Since:
- 11.1
-
supportsWindowOrderByWithAggregates
public boolean supportsWindowOrderByWithAggregates()
- Returns:
- true if all aggregates can have window function order by clauses.
- Since:
- 7.5
-
supportsWindowDistinctAggregates
public boolean supportsWindowDistinctAggregates()
- Returns:
- true if distinct aggregates can be windowed function.
- Since:
- 7.6
-
supportsArrayAgg
public boolean supportsArrayAgg()
- Returns:
- true if array_agg is supported
- Since:
- 7.5
-
supportsSimilarTo
public boolean supportsSimilarTo()
- Returns:
- true if the SIMILAR TO predicate is supported
- Since:
- 7.5
-
supportsLikeRegex
public boolean supportsLikeRegex()
- Returns:
- true if the LIKE_REGEX predicate is supported
- Since:
- 7.4
-
supportsConvert
public boolean supportsConvert(int fromType, int toType)
Used for fine grained control of convert/cast pushdown. ThegetSupportedFunctions()
should containSourceSystemFunctions.CONVERT
. This method can then return false to indicate a lack of specific support. The engine will does not care about an unnecessary conversion where fromType == toType. By default lob conversion is disabled.- Parameters:
fromType
-toType
-- Returns:
- true if the given conversion is supported.
- Since:
- 8.0
- See Also:
TypeFacility.RUNTIME_CODES
,TypeFacility.RUNTIME_CODES
-
supportsOnlyLiteralComparison
public boolean supportsOnlyLiteralComparison()
- Returns:
- true if only Literal comparisons (equality, ordered, like, etc.) are supported for non-join conditions.
- Since:
- 8.0
-
supportsDependentJoins
public boolean supportsDependentJoins()
NOTE: The pushed independent tuples will not have been converted to a unique set and may contain duplicates.- Returns:
- true if dependent join key pushdown is supported
- Since:
- 8.0
-
supportsFullDependentJoins
public boolean supportsFullDependentJoins()
- Returns:
- true if full dependent join pushdown is supported
- Since:
- 8.5
-
supportsOnlyFormatLiterals
public boolean supportsOnlyFormatLiterals()
- Returns:
- true if only literal formats are supports.
-
supportsFormatLiteral
public boolean supportsFormatLiteral(String literal, ExecutionFactory.Format format)
- Parameters:
literal
-format
-- Returns:
- true if the given Java format string is supported
-
supportsSubqueryInOn
public boolean supportsSubqueryInOn()
Refines subquery support.- Returns:
- true if subqueries are supported in the on clause.
-
getCacheDirective
public CacheDirective getCacheDirective(Command command, ExecutionContext executionContext, RuntimeMetadata metadata) throws TranslatorException
Get theCacheDirective
to control command caching.Use
CacheDirective.Scope.NONE
to indicate to the engine that no caching should be performed by the engine.If cache parameters on the
CacheDirective
will be changed by theExecution
, then a new instance of aCacheDirective
should be set each time.- Parameters:
command
-executionContext
-metadata
-- Throws:
TranslatorException
-
isForkable
public boolean isForkable()
When forkable the engine may use a separate thread to interact with returnedExecution
.- Returns:
- true if
Execution
s can be called in separate threads from the processing thread
-
isThreadBound
@TranslatorProperty(display="Thread Bound", description="True, if this translator\'s executions must complete in a single thread.", advanced=true) public boolean isThreadBound()
- Returns:
- True, if this translator's executions must complete in a single thread.
-
supportsArrayType
public boolean supportsArrayType()
The engine uses array types for dependent joins and for array expression.- Returns:
- true if an array type is supported.
-
supportsSelectExpressionArrayType
public boolean supportsSelectExpressionArrayType()
- Returns:
- true if array type expressions can be projected
-
supportsNativeQueries
@Deprecated @TranslatorProperty(display="Deprecated Property:Supports Direct Query Procedure", description="Deprecated Property, Use Supports Direct Query Procedure instead", advanced=true) public final boolean supportsNativeQueries()
Deprecated.True, if this translator supports execution of source specific commands unaltered through a direct procedure.- Returns:
- See Also:
supportsDirectQueryProcedure()
-
setSupportsNativeQueries
@Deprecated public final void setSupportsNativeQueries(boolean state)
Deprecated.- See Also:
setSupportsDirectQueryProcedure(boolean)
-
supportsDirectQueryProcedure
@TranslatorProperty(display="Supports Direct Query Procedure", description="True, if this translator supports execution of source specific commands unaltered through a direct procedure", advanced=true) public boolean supportsDirectQueryProcedure()
True, if this translator supports execution of source specific commands unaltered through a direct procedure.- Returns:
-
setSupportsDirectQueryProcedure
public void setSupportsDirectQueryProcedure(boolean state)
-
getNativeQueryProcedureName
@Deprecated @TranslatorProperty(display="Deprecated Property:Direct Query Procedure Name", description="Deprecated Property, use Direct Query Procedure Name", advanced=true) public final String getNativeQueryProcedureName()
Deprecated.Defines the name of the direct processing procedure. This metadata or signature of the procedure is defined automatically.- Returns:
- See Also:
getDirectQueryProcedureName()
-
setNativeQueryProcedureName
@Deprecated public final void setNativeQueryProcedureName(String name)
Deprecated.- See Also:
setDirectQueryProcedureName(String)
-
getDirectQueryProcedureName
@TranslatorProperty(display="Direct Query Procedure Name", description="The name of the direct query procedure", advanced=true) public String getDirectQueryProcedureName()
Defines the name of the direct processing procedure. This metadata or signature of the procedure is defined automatically.- Returns:
-
setDirectQueryProcedureName
public void setDirectQueryProcedureName(String name)
-
supportsOnlyCorrelatedSubqueries
public boolean supportsOnlyCorrelatedSubqueries()
- Returns:
- true if only correlated subqueries are supported.
-
supportsSelectWithoutFrom
public boolean supportsSelectWithoutFrom()
- Returns:
- true if the translator support SELECT without a FROM clause
-
supportsGroupByRollup
public boolean supportsGroupByRollup()
- Returns:
- true if the translator support GROUP BY ROLLUP
-
supportsOrderByWithExtendedGrouping
public boolean supportsOrderByWithExtendedGrouping()
- Returns:
- true if order by is supported over a grouping with a rollup, cube, etc.
-
setThreadBound
public void setThreadBound(boolean threadBound)
-
returnsSingleUpdateCount
public boolean returnsSingleUpdateCount()
True if only a single value is returned for the update count. This overrides the default expectation of an update count array for bulk/batch commands. It is expected that every command is successful.- Returns:
-
supportsPartialFiltering
public boolean supportsPartialFiltering()
Return true if the source has columns marked with the teiid_rel:partial that can return more rows than specified by a filter if the column is also projected. This most closely matches the semantics of ldap queries with multi-valued attributes marked as partial.
When true, the following supports cannot also be true:- supportsOuterJoins()
- supportsFullOuterJoins()
- supportsInlineViews()
- supportsIntersect()
- supportsExcept()
- supportsSelectExpression()
- supportsUnions()
- supportsSelectDistinct()
- supportsGroupBy()
- Returns:
-
useBindingsForDependentJoin
public boolean useBindingsForDependentJoin()
If dependent join predicates should use literals that are marked as bind eligible.
-
getRequiredLikeEscape
public Character getRequiredLikeEscape()
The required escape character or null if all are supported.- Returns:
-
supportsScalarSubqueryProjection
public boolean supportsScalarSubqueryProjection()
If a scalar subquery can be projected.- Returns:
-
getTransactionSupport
@TranslatorProperty(display="Transaction Support", description="The level of transaction support. Used by the engine to determine if a transaction is needed for autoCommit mode.", advanced=true) public ExecutionFactory.TransactionSupport getTransactionSupport()
-
setTransactionSupport
public void setTransactionSupport(ExecutionFactory.TransactionSupport transactionSupport)
-
getExcludedCommonTableExpressionName
@TranslatorProperty(display="Excluded Common Table Expression Name", description="Set if the source won\'t support the given common table expression name.", advanced=true) public String getExcludedCommonTableExpressionName()
-
setExcludedCommonTableExpressionName
public void setExcludedCommonTableExpressionName(String excludedCommonTableExpressionName)
-
supportsLateralJoin
public boolean supportsLateralJoin()
- Returns:
- true if the source supports lateral join
-
supportsLateralJoinCondition
public boolean supportsLateralJoinCondition()
- Returns:
- true if the source supports lateral join conditions
-
supportsOnlyLateralJoinProcedure
public boolean supportsOnlyLateralJoinProcedure()
- Returns:
- true if lateral joins are restricted to only procedures / table valued functions
-
supportsProcedureTable
public boolean supportsProcedureTable()
- Returns:
-
supportsUpsert
public boolean supportsUpsert()
- Returns:
- true if the source supports upsert
-
supportsOnlyTimestampAddLiteral
public boolean supportsOnlyTimestampAddLiteral()
- Returns:
- true if the source supports only timestamp add literals
-
supportsWindowFunctionPercentRank
public boolean supportsWindowFunctionPercentRank()
- Returns:
- true if percent_rank is supported.
defaults to
supportsElementaryOlapOperations()
- Since:
- 11.1
-
supportsWindowFunctionCumeDist
public boolean supportsWindowFunctionCumeDist()
- Returns:
- true if cume_dist is supported.
defaults to
supportsElementaryOlapOperations()
- Since:
- 11.1
-
supportsWindowFunctionNthValue
public boolean supportsWindowFunctionNthValue()
- Returns:
- true if nth_value is supported.
defaults to
supportsElementaryOlapOperations()
- Since:
- 11.1
-
supportsMultipleOpenExecutions
public boolean supportsMultipleOpenExecutions()
- Returns:
- true if multiple executions may be open against a single connection at a time
- Since:
- 11.2
-
supportsAggregatesCountBig
public boolean supportsAggregatesCountBig()
- Returns:
- true if the translator supports a specific count aggregate returning a long value
supportsAggregatesCount()
will be consulted by the engine, this capability only affects the name of the pushed count function if a long value is expected - Since:
- 11.2
-
supportsGeographyType
public boolean supportsGeographyType()
If the geography type is supported by the standard ST_ geospatial functions- Returns:
- true if the translator supports the geography type
- Since:
- 11.2
-
supportsProcedureParameterExpression
public boolean supportsProcedureParameterExpression()
Return true if the translator supports expressions as procedure paramters.- Returns:
- Since:
- 13.0
-
-