public class SqlQuery extends QueryClause implements SqlStatement, ITableFunctionParameter
AbstractSyntaxTree.LogCounter
Modifier and Type | Method and Description |
---|---|
SqlQuery |
addJoin(oracle.odi.domain.mapping.physical.MapPhysicalNode physicalNode,
JoinTable.JoinType joinType,
SqlQuery joinQuery,
ArrayExpression[] joinConditionHolder,
boolean addJoinCondition,
boolean orderedJoin,
SqlQuery.SelectMapContainer selectMapContainer,
oracle.odi.domain.mapping.IMapComponent leftComponent,
oracle.odi.domain.mapping.IMapComponent rightComponent,
oracle.odi.domain.mapping.MapConnectorPoint leftPoint,
oracle.odi.domain.mapping.MapConnectorPoint rightPoint,
boolean inDataset,
java.util.Set existingAliasSet,
boolean optimizeLeftInlineViews,
boolean isCombinedQuery)
Add a query to be joined to this query.
|
java.util.List |
getAliasList()
Get the list of aliases of the select items of this query.
|
java.util.List |
getChildren()
Get the list of child objects owned by this substitution API object.
|
java.lang.String |
getColumnAliasSeparator()
Gets the separator between column expression and alias, based on the source technology of this query.
|
java.lang.String |
getConstantFromClauseText()
Get the FROM clause text for a query with only constant select item expressions, and no
real source.
|
java.lang.String |
getConstantFromClauseText(boolean includeFromKeyword)
Get the FROM clause text for a query with only constant select item expressions, and no
real source.
|
oracle.odi.domain.adapter.relational.IColumn |
getExpressionColumn(Expression expr)
Get the source column referenced by the expression of an select item.
|
java.util.List |
getExpressions()
Get a list of expressions owned by this substitution API object.
|
java.util.List |
getFromList()
Get the From clause list of the query.
|
java.util.List |
getGroupByList()
Get the GROUP BY expressions of this query.
|
java.util.List |
getHavingList()
Get the HAVING expressions of this query.
|
SqlQuery |
getInputQuery(int index)
Get the input queries that are used in a set query (e.g.
|
int |
getInputQueryCount() |
oracle.odi.domain.mapping.physical.MapPhysicalNode |
getJournalizedSource()
Get the journalized source node for this query.
|
java.util.List |
getLateralViewList()
Gets the flattened complex columns that would result in a Hive lateral view, basically only those complex columns that comprise a collection.
|
java.util.List |
getNonOrderedComponents()
Get the list of components participating in the non-ANSI join of this query.
|
java.util.List |
getOrderByList()
Get the ORDER BY expressions of this query.
|
oracle.odi.domain.mapping.IMapComponent |
getQuerySourceComponent()
Get the source mapping component that acts as the main source for this query.
|
java.util.List |
getSelectHints()
Get the select hints associated with this query.
|
java.util.List |
getSelectList()
Get the list of select items of this query.
|
SqlQuery |
getSetOperand()
Gets the query that is linked with this query through a set operation.
|
java.lang.String |
getSetOperation()
Gets the set operation linking this query with another query.
|
java.util.List |
getSourceColumns()
Get the source columns referenced by the select items of this query.
|
oracle.odi.domain.adapter.topology.ILocation |
getSourceLocation()
Get source location information for this AST, if any is defined, else return null.
|
TableReference |
getSourceTable(java.lang.String baseName)
Get the source table of this query
|
java.util.Collection |
getSourceTables()
Get all source tables involved in this query.
|
java.util.List |
getSourceTables(boolean includeSubqueries)
Get all source tables, including those referenced in subqueries.
|
java.util.List |
getSubqueries() |
java.util.Map |
getTemplateSubstitutionMap()
Get a hash map containing built-in template substitution variable names as the hash key,
and the substitution variable value as values.
|
java.lang.String |
getText()
Get the expanded text of this query object which represents a SELECT statement.
|
java.lang.String |
getType()
Get a class type string for this substitution API object.
|
java.util.List |
getWhereList()
Get the where clause of the query.
|
boolean |
hasAggregation()
Returns true if this query has aggregation, otherwise false.
|
boolean |
hasFilterWithAggregation() |
boolean |
hasJournalizedSource() |
boolean |
hasNonOrderedJoin()
Check if this query is participating in an non-ANSI join.
|
boolean |
hasSourceReference()
Checks whether the select items of this query references a source object
|
boolean |
hasWindowFunction()
Returns true if this query has a window or analytical function, otherwise false.
|
boolean |
hasWindowFunction(oracle.odi.domain.adapter.topology.ITechnology techno)
Returns true if this query has a window or analytical function, otherwise false.
|
boolean |
isANSI() |
boolean |
isConstantQuery()
Return true if the query has no real source, but is projecting a set of constants in the select list.
|
boolean |
isDistinct()
Check if the query has a distinct clause.
|
boolean |
isPassive() |
boolean |
isPivot()
Check if the query is created from a pivot component.
|
boolean |
isStagingQuery() |
boolean |
isSubquery() |
java.lang.String |
toString()
Return a string representation of this query.
|
getParentQuery
getCodeGenerationTemplate, getCodeGenerationTemplateName, getCustomTemplate, getKMName, getLeafLevelChildren, getMapPhysicalNode, getOrder, getParentAST, getParentOfType, getPropertyValue, getSourceLanguage, getSourceTechnology, getSourceText, getTargetLanguage, getTargetLocation, getTargetTechnology, getTargetText, hasCustomTemplate, hasSourceAndTargetText, isLeafLevelNode, isPushFromSource
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
getParentAST
public java.util.List getSelectList()
public java.util.List getAliasList()
public boolean isPassive()
public boolean isDistinct()
public boolean isPivot()
public java.util.List getFromList() throws GenerationException
GenerationException
public java.util.List getWhereList()
public java.lang.String getText() throws GenerationException
getText
in interface ITableFunctionParameter
getText
in class AbstractSyntaxTree
GenerationException
public java.util.Map getTemplateSubstitutionMap()
AbstractSyntaxTree
getTemplateSubstitutionMap
in class AbstractSyntaxTree
public java.util.List getChildren()
AbstractSyntaxTree
getChildren
in interface ITableFunctionParameter
getChildren
in class AbstractSyntaxTree
public java.lang.String getType()
AbstractSyntaxTree
getType
in class AbstractSyntaxTree
public boolean isANSI()
public java.util.List getGroupByList()
public java.util.List getHavingList()
public java.util.List getOrderByList()
public SqlQuery addJoin(oracle.odi.domain.mapping.physical.MapPhysicalNode physicalNode, JoinTable.JoinType joinType, SqlQuery joinQuery, ArrayExpression[] joinConditionHolder, boolean addJoinCondition, boolean orderedJoin, SqlQuery.SelectMapContainer selectMapContainer, oracle.odi.domain.mapping.IMapComponent leftComponent, oracle.odi.domain.mapping.IMapComponent rightComponent, oracle.odi.domain.mapping.MapConnectorPoint leftPoint, oracle.odi.domain.mapping.MapConnectorPoint rightPoint, boolean inDataset, java.util.Set existingAliasSet, boolean optimizeLeftInlineViews, boolean isCombinedQuery) throws GenerationException
physicalNode
- the physical node of join.joinType
- The join type of this join to be added. Can be one of the following: INNER, LEFT OUTER, RIGHT OUTER, FULl OUTER, NATURAL, CROSS.joinQuery
- The query to be joined with this query.joinCondition
- The join condition expression for this join.orderedJoin
- The indicator whether this is an ANSI join.selectMapContainer
- The select map hash table. The hash key is a select item, and the value is a list of redirected select items inside subqueries.leftComponent
- The component that contributes to the left side of the join.rightComponent
- The component that contributes to the right side of the join.leftPoint
- The connector point that contributes to the left side of the join.rightPoint
- The connector point that contributes to the right side of the join.inDataset
- Indicate if this is a join within a dataset.existingAliasSet
- set of existing aliases used in the queryoptimizeLeftInlineViews
- specifies whether inline views created for the left side, or source, should be pruned to include only those
attributes used downstream. This value should be true except for nth row lookup operations where all attributes from the source
should be included in the select list.isCombinedQuery
- indicate whether this sqlquery is a combined query. Suppose we have a join with 3 inputs. The first call to addJoin() would process
INPUT1 and INPUT2, and create a combined query INPUT12. The next call will process INPUT12 and INPUT3. Here INPUT12 is a combined query.GenerationException
public java.util.List getSourceColumns() throws oracle.odi.domain.adapter.AdapterException
oracle.odi.domain.adapter.AdapterException
public oracle.odi.domain.adapter.relational.IColumn getExpressionColumn(Expression expr) throws oracle.odi.domain.adapter.AdapterException
oracle.odi.domain.adapter.AdapterException
public oracle.odi.domain.adapter.topology.ILocation getSourceLocation() throws GenerationException
AbstractSyntaxTree
getSourceLocation
in class AbstractSyntaxTree
GenerationException
public java.util.List getExpressions()
AbstractSyntaxTree
getExpressions
in class QueryClause
public SqlQuery getInputQuery(int index) throws GenerationException
index
- The index of the query.GenerationException
public int getInputQueryCount()
public java.lang.String getSetOperation()
public SqlQuery getSetOperand()
public TableReference getSourceTable(java.lang.String baseName)
baseName
- The base table name of the source table.public java.util.Collection getSourceTables()
public java.lang.String toString()
toString
in class java.lang.Object
public oracle.odi.domain.mapping.physical.MapPhysicalNode getJournalizedSource()
public boolean hasJournalizedSource()
public boolean hasFilterWithAggregation()
public boolean hasAggregation()
public boolean hasWindowFunction(oracle.odi.domain.adapter.topology.ITechnology techno)
techno
- technology used to get list of aggregation functions to check against.public java.util.List getLateralViewList()
public boolean hasWindowFunction() throws GenerationException
techno
- technology used to get list of aggregation functions to check against.GenerationException
public java.util.List getSelectHints()
public boolean hasNonOrderedJoin()
public java.util.List getNonOrderedComponents()
public boolean isConstantQuery() throws GenerationException
GenerationException
public java.lang.String getConstantFromClauseText() throws GenerationException
GenerationException
public java.lang.String getConstantFromClauseText(boolean includeFromKeyword) throws GenerationException
includeFromKeyword
- If true, include the "FROM" keyword in the text, else just include the FROM table name.GenerationException
public boolean isStagingQuery()
public oracle.odi.domain.mapping.IMapComponent getQuerySourceComponent()
public boolean hasSourceReference()
public java.lang.String getColumnAliasSeparator()
public java.util.List getSubqueries() throws GenerationException
GenerationException
public java.util.List getSourceTables(boolean includeSubqueries) throws GenerationException
includeSubqueries
- If true, include source tables referenced through subqueries.GenerationException
public boolean isSubquery()