public class TSelectSqlStatement extends TCustomSqlStatement
TSelectSqlStatement represents query specification, query expression and select statement.
getResultColumnList()TCustomSqlStatement.joinsTCustomSqlStatement.getWhereClause()getGroupByClause()getGroupByClause()getOrderbyClause()getOffsetClause()getComputeClause()getForUpdateClause()TCustomSqlStatement.getCteList()isCombinedQuery() to check whether UNION, EXCEPT and INTERSECT operators is used.
If returns true, use getLeftStmt() and getRightStmt() to get query expression.
You need to check isCombinedQuery() recursively, all clauses of TSelectSqlStatement
only available when this function returns false.| Modifier and Type | Field and Description |
|---|---|
static int |
SET_OPERATOR_EXCEPTDISTINCT |
static int |
SET_OPERATOR_INTERSECTDISTINCT |
static int |
SET_OPERATOR_MINUSDISTINCT |
static int |
SET_OPERATOR_NONE |
static int |
SET_OPERATOR_UNIONDISTINCT |
static int |
setOperator_except |
static int |
setOperator_exceptall |
static int |
setOperator_intersect |
static int |
setOperator_intersectall |
static int |
setOperator_minus |
static int |
setOperator_minusall |
static int |
setOperator_union |
static int |
setOperator_unionall |
dummytag, fromClause, fromSourceJoin, fromSourceTable, isparsed, joins, parser, plsqlparser, rootNode, sourcetokenlist, sqlstatementtype, stmtScope, tablesdbvendor, doubleLinkedTokenListToString, nodeActionAppend, nodeActionInsert, nodeActionRemove, nodeActionUnknown, nodeActionUpdate, nodeActionUpdateText, nodeChangeEndToken, nodeChangeStartToken| Constructor and Description |
|---|
TSelectSqlStatement(EDbVendor dbvendor) |
addToTables, analyzeFromTable, analyzeFromTable, analyzeJoin, analyzeTablename, analyzeTableOrJoin, asCanonical, checkNonQualifiedColumnReferenceInSubQueryOfUplevelStmt, clearError, dochecksyntax, findTable, fireOnMetaDatabaseTableColumn, getAncestorStmt, getColumnsInTable, getColumnsInTable, getCteIncludeThisStmt, getCteList, getDaxFunctionStack, getEndlabelName, getErrorCount, getErrormessage, getFirstPhysicalTable, getFrameStack, getFromSourceJoin, getFromSourceTable, getGlobalScope, getIndexColumns, getJoins, getLabelName, getOrphanColumns, getOutputClause, getParentObjectName, getParentStmt, getRelationName, getRelations, getReturningClause, getSqlEnv, getStatements, getStmtScope, getSymbolTable, getSyntaxErrors, getSyntaxHints, getTables, getTargetTable, getTokenList, getTopClause, getTopStatement, getUsingVariableList, getVariableStack, getWhereClause, isathenaplsql, isBigQueryplsql, isdatabricksplsql, isGaussDBStoredProcedure, isgreeplumplsql, isnzplsql, isoracleplsql, ispgplsql, isprestoplsql, issnowflakeplsql, isTableACTE, isverticaplsql, linkColumnReferenceToTable, linkColumnToTable, linkToFirstTable, locateVariableOrParameter, locateVariableOrParameter, OracleStatementCanBeSeparatedByBeginEndPair, parseerrormessagehandle, parsestatement, parsestatement, searchCTEList, searchDaxVariableInStack, searchFunctionInSQLEnv, setAlreadyAddToParent, setCteIncludeThisStmt, setCteList, setEndlabelName, setFrameStack, setFromClause, setLabelName, setOutputClause, setParentStmt, setParentStmtToNull, setResultColumnList, setReturningClause, setStmtScope, setTargetTable, setTopClause, setUsingVariableList, setVariableStack, setWhereClause, size, toScript, VerticaStatementCanBeSeparatedByBeginEndPairaddAllMyTokensToTokenList, addToTokenChain, appendNewNode, calculateTokenCount, doAppendNewNode, doParse, fastSetString, getAnchorNode, getColumnNo, getCommentAfterNode, getCommentBeforeNode, getCompactString, getDummyTag, getEvaluateDatatype, getEvalValue, getGsqlparser, getLineNo, getLocation, getMd5, getNodeStatus, getNodeType, getPlainText, getStartToken, getTokenCount, hasNext, init, init, init, init, init, init, insertAfterAToken, insertNewNodeBeforeMe, isChanged, isTokensInChain, next, refreshAllNodesTokenCount, remove, removeAllMyTokensFromTokenList, removeTokens, removeTokensBetweenNodes, removeTokensBetweenToken, replaceWithNewNode, resetIterator, setAnchorNode, setChanged, setDummyTag, setEndToken, setEndToken, setEndToken, setEndToken, setEndToken, setEndTokenDirectly, setEvaluateDatatype, setEvalValue, setGsqlparser, setIncludingComment, setLocation, setNewSubNode, setNodeStatus, setNodeType, setParent, setPlainText, setStartToken, setStartToken, setStartToken, setStartToken, setStartTokenDirectly, setString, setString2, subNodeInNode, toString, toString2clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitforEachRemainingpublic static final int SET_OPERATOR_NONE
public static final int setOperator_union
public static final int setOperator_unionall
public static final int SET_OPERATOR_UNIONDISTINCT
public static final int setOperator_intersect
public static final int setOperator_intersectall
public static final int SET_OPERATOR_INTERSECTDISTINCT
public static final int setOperator_minus
public static final int setOperator_minusall
public static final int SET_OPERATOR_MINUSDISTINCT
public static final int setOperator_except
public static final int setOperator_exceptall
public static final int SET_OPERATOR_EXCEPTDISTINCT
public TSelectSqlStatement(EDbVendor dbvendor)
public TSourceToken getEndToken()
TParseTreeNodegetEndToken in class TParseTreeNodepublic void setSubQueryInFromClauseCanUseParentSelectAsEnclosingScope(boolean subQueryInFromClauseCanUseParentSelectAsEnclosingScope)
public boolean isSubQueryInFromClauseCanUseParentSelectAsEnclosingScope()
public boolean isStarColumnPushedDown()
public void setStarColumnPushedDown(boolean starColumnPushedDown)
public ArrayList<TAttributeNode> getAttributes()
getAttributes in interface IRelationgetAttributes in class TCustomSqlStatementpublic ArrayList<TSelectSqlStatement> getMultiSelectStatements()
public void setClusterBy(TClusterBy clusterBy)
public TClusterBy getClusterBy()
public void setConsume(boolean consume)
public boolean isConsume()
public TStatementList getHiveBodyList()
getMultiSelectStatements() to retrieve
multimple select statement in Hive from query ... select, select, ...public void setSelectModifiers(ArrayList<TSelectModifier> selectModifiers)
public ArrayList<TSelectModifier> getSelectModifiers()
public void setTimeTravel(TTimeTravel timeTravel)
public void setHintClause(THintClause hintClause)
public TTimeTravel getTimeTravel()
public THintClause getHintClause()
public void setFetchFirstClause(TFetchFirstClause fetchFirstClause)
public void setParenthesisCount(int parenthesisCount)
public void setParenthesisCountBeforeOrder(int parenthesisCountBeforeOrder)
public void setAll(boolean all)
public void setSetOperatorType(ESetOperatorType setOperatorType)
public void setWindowClause(TWindowClause windowClause)
public void setLockingClauses(TPTNodeList<TLockingClause> lockingClauses)
public void setSelectDistinct(TSelectDistinct selectDistinct)
public void setExpandOnClause(TExpandOnClause expandOnClause)
public void setSetOperator(int setOperator)
public void setLeftStmt(TSelectSqlStatement leftStmt)
public void setRightStmt(TSelectSqlStatement rightStmt)
public void setValueClause(TValueClause valueClause)
public void setOracleHint(String oracleHint)
public void setHiveHintClause(THiveHintClause hiveHintClause)
public void setTransformClause(THiveTransformClause transformClause)
public void setDistributeBy(TDistributeBy distributeBy)
public void setIntoClause(TIntoClause intoClause)
public void setOrderbyClause(TOrderBy newOrderbyClause)
public void setQualifyClause(TQualifyClause qualifyClause)
public void setSampleClause(TSampleClause sampleClause)
public void setTeradataWithClause(TTeradataWithClause teradataWithClause)
public void setForUpdateClause(TForUpdate forUpdateClause)
public void setComputeClause(TComputeClause computeClause)
public void setGroupByClause(TGroupBy groupByClause)
public void setHierarchicalClause(THierarchical hierarchicalClause)
public void setLimitClause(TLimitClause limitClause)
public void setOffsetClause(TOffsetClause offsetClause)
public void setOptionClause(TOptionClause optionClause)
public void setIsolationClause(TIsolationClause isolationClause)
public void setIntoTableClause(TIntoTableClause intoTableClause)
public int getParenthesisCountBeforeOrder()
public int getParenthesisCount()
public void setQueryOfCTE(boolean queryOfCTE)
public boolean isQueryOfCTE()
public TOffsetClause getOffsetClause()
OFFSET 2 ROWS FETCH NEXT 4 ROWS ONLY;
offset clausepublic TFetchFirstClause getFetchFirstClause()
OFFSET 2 ROWS FETCH NEXT 4 ROWS ONLY;
fetch first/next clausepublic TOptionClause getOptionClause()
sql server option clauseTOptionClausepublic TIsolationClause getIsolationClause()
isolation clausepublic TSortBy getSortBy()
Hive sort by clausepublic TIntoTableClause getIntoTableClause()
informix into table clausepublic void setSelectToken(TSourceToken selectToken)
public TSourceToken getSelectToken()
public boolean isAll()
public boolean isSetOpDistinct()
public ESetOperatorType getSetOperatorType()
public TWindowClause getWindowClause()
window clause.public TPTNodeList<TLockingClause> getLockingClauses()
TLockingClausepublic TSelectDistinct getSelectDistinct()
distinct clausepublic TIntoClause getIntoClause()
into clausepublic TOrderBy getOrderbyClause()
order by clausepublic TQualifyClause getQualifyClause()
teradata qualify clausepublic TTeradataWithClause getTeradataWithClause()
Teradata with clause public TSampleClause getSampleClause()
SQL Server sample clausepublic TForUpdate getForUpdateClause()
for update clausepublic TComputeClause getComputeClause()
SQL Server compute clausepublic TGroupBy getGroupByClause()
group by clause and having clausepublic THierarchical getHierarchicalClause()
Oracle hierarchical_query_clausepublic TLimitClause getLimitClause()
MySQL,PostgreSQL limit clausepublic TExpandOnClause getExpandOnClause()
Teradata expand on clausepublic int getSetOperator()
getSetOperatorType() and isAll() instead.public TSelectSqlStatement getLeftStmt()
getSetOperator() is not setOperator_none.public TSelectSqlStatement getFarLeftStmt()
public TSelectSqlStatement getRightStmt()
getSetOperator() is not setOperator_none.public boolean isValueClause()
public String getOracleHint()
getHint()public THiveHintClause getHiveHintClause()
Hive hint clausepublic THiveTransformClause getTransformClause()
Hive from clausepublic TDistributeBy getDistributeBy()
Hive distribute by clausepublic TValueClause getValueClause()
DB2 value clausepublic void setChildOfCombinedQuery(boolean childOfCombinedQuery)
public boolean isChildOfCombinedQuery()
public TreeMap<String,TResultColumn> getExpandedResultColumns()
getExpandedResultColumns in class TCustomSqlStatementpublic ArrayList<TSelectSqlStatement> getFlattenedSelects()
public int doParseStatement(TCustomSqlStatement psql)
doParseStatement in class TCustomSqlStatementpsql - input query.public boolean isCombinedQuery()
public void accept(TParseTreeVisitor v)
TParseTreeNodeaccept in interface Visitableaccept in class TParseTreeNodev - visitor is a descendant class of TParseTreeVisitorpublic void acceptChildren(TParseTreeVisitor v)
acceptChildren in interface VisitableacceptChildren in class TParseTreeNodev - user defined visitor.public TOrderBy addOrderBy(String orderByStr)
orderByStr - new order by stringpublic TWhereClause addCondition(String condition)
condition - new conditionpublic TWhereClause addConditionOR(String condition)
public TWhereClause addWhereClause(String condition)
addWhereClause in class TCustomSqlStatementpublic TWhereClause addWhereClauseOR(String condition)
protected TWhereClause doAddWhereClause(String condition, boolean isAnd)
public TFromClause getFromClause()
getFromClause in class TCustomSqlStatementpublic TResultColumnList getResultColumnList()
TCustomSqlStatementgetResultColumnList in class TCustomSqlStatementpublic ArrayList<String> getColumnsInFromClause()
public void addColumnInSelectListToSQLEnv(TSQLTable sqlTable)
public boolean searchColumnInResultSet(TObjectName pColumn, boolean pMustIn)
pColumn - pMustIn -