Package gudusoft.gsqlparser.nodes
Class TPivotClause
Object
gudusoft.gsqlparser.nodes.TParseTreeNode
gudusoft.gsqlparser.nodes.TNodeWithAliasClause
gudusoft.gsqlparser.nodes.TPivotClause
- All Implemented Interfaces:
IRelation,Visitable,Iterator<TSourceToken>
use the PIVOT and UNPIVOT relational operators to change a table-valued expression into another table.
-
Field Summary
FieldsFields inherited from class gudusoft.gsqlparser.nodes.TParseTreeNode
dbvendor, doubleLinkedTokenListToString, nodeActionAppend, nodeActionInsert, nodeActionRemove, nodeActionUnknown, nodeActionUpdate, nodeActionUpdateText, nodeChangeEndToken, nodeChangeStartToken -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAccept a visitorvoidAccept a visitor to iterate this class and sub-nodes of this classvoiddoParse(TCustomSqlStatement psql, ESqlClause plocation) Analyze the sub-nodes inside this node.每个 relation 包含的 attributes 当它为 base table 时,这些 attributes 的来源有三种可能 1.Deprecated.Deprecated.since 1.7.1.1 , usegetPivotColumnList()instead.intgetType()Deprecated.since 1.7.1.1, usegetValueColumnList()instead.voidvoidvoidvoidsetAggregation_function(TFunctionCall aggregation_function) voidsetAggregation_function_list(TResultColumnList aggregation_function_list) voidsetColumnList(TObjectNameList columnList) voidsetPivotColumnList(TObjectNameList pivotColumnList) voidsetPivotInClause(TPivotInClause pivotInClause) voidsetType(int type) voidsetUnpivotInClause(TUnpivotInClause unpivotInClause) voidsetValueColumnList(TObjectNameList valueColumnList) intsize()Methods inherited from class gudusoft.gsqlparser.nodes.TNodeWithAliasClause
getAliasClause, setAliasClause, toStringMethods inherited from class gudusoft.gsqlparser.nodes.TParseTreeNode
addAllMyTokensToTokenList, addToTokenChain, appendNewNode, calculateTokenCount, doAppendNewNode, fastSetString, getAnchorNode, getColumnNo, getCommentAfterNode, getCommentBeforeNode, getCompactString, getDummyTag, getEndToken, getEvaluateDatatype, getEvalValue, getGsqlparser, getLineNo, getLocation, getMd5, getNodeStatus, getNodeType, getParentObjectName, getPlainText, getStartToken, getTokenCount, hasNext, 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, toScript, toString2Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.Iterator
forEachRemaining
-
Field Details
-
pivot
- See Also:
-
unpivot
- See Also:
-
-
Constructor Details
-
TPivotClause
public TPivotClause()
-
-
Method Details
-
getAttributes
Description copied from interface:IRelation每个 relation 包含的 attributes 当它为 base table 时,这些 attributes 的来源有三种可能 1. 来自数据库的 metadata,第一次 resolve 时就可以获取,来自 sqlenv 2. 来自 create table ddl,第一次 resolve 时就可以获取,来自 sqlenv 3. 来自 sql script,第二次 resolve 时,来自relation的 referenceAttribute 属性。 第一、二中来源是可靠的来源,attributes应该是完整的,第三种推断自 sql script,attributes很可能是不完整的。- Specified by:
getAttributesin interfaceIRelation- Returns:
-
size
-
getRelationName
- Specified by:
getRelationNamein interfaceIRelation
-
getDisplayName
-
initAttributes
-
getPivotTable
-
getPivotInClause
-
getUnpivotInClause
-
getPivotColumnList
-
getIn_result_list
Deprecated.since 1.7.1.1, usegetPivotInClause()instead- Returns:
- result column list
-
getAggregation_function_list
-
setType
-
getType
-
getValueColumnList
-
getAggregation_function
- Returns:
- Is a system or user-defined aggregate function that accepts one or more inputs.
-
getColumnList
- Returns:
- In the PIVOT clause, lists the values in the pivot_column that will become the column names of the output table. The list cannot specify any column names that already exist in the input table_source that is being pivoted. In the UNPIVOT clause, lists the columns in table_source that will be narrowed into a single pivot_column.
-
getPivotColumn
Deprecated.since 1.7.1.1 , usegetPivotColumnList()instead.- Returns:
- Is the pivot column of the PIVOT operator.
-
getValueColumn
Deprecated.since 1.7.1.1, usegetValueColumnList()instead.- Returns:
- Is the value column of the PIVOT operator. When used with UNPIVOT, value_column cannot be the name of an existing column in the input table_source.
-
init
- Overrides:
initin classTParseTreeNode
-
init
- Overrides:
initin classTParseTreeNode
-
doParse
Description copied from class:TParseTreeNodeAnalyze the sub-nodes inside this node. Such as build the relationship between table and column.- Overrides:
doParsein classTParseTreeNode- Parameters:
psql- SQL statement this node belongs toplocation- SQL clause this node belongs to
-
accept
Description copied from class:TParseTreeNodeAccept a visitor- Specified by:
acceptin interfaceVisitable- Overrides:
acceptin classTParseTreeNode- Parameters:
v- visitor is a descendant class ofTParseTreeVisitor
-
acceptChildren
Description copied from class:TParseTreeNodeAccept a visitor to iterate this class and sub-nodes of this class- Specified by:
acceptChildrenin interfaceVisitable- Overrides:
acceptChildrenin classTParseTreeNode- Parameters:
v- visitor is a descendant class ofTParseTreeVisitor
-
setPivotInClause
-
setUnpivotInClause
-
setAggregation_function_list
-
setPivotColumnList
-
setAggregation_function
-
setValueColumnList
-
setColumnList
-
getPivotInClause()instead