Class TObjectName
- All Implemented Interfaces:
Visitable,Cloneable,Iterator<TSourceToken>
The general syntax of database object in Oracle: [schema.]object[.part][@dblink]
The general syntax of database object in SQL Server: [server.][database.][schema.]object
The meaning of getObjectToken() and getPartToken() depends on the getDbObjectType().
If this database object is a schema object such as table, index, then the objectToken represents this
database object and partToken is null.
If this TObjectName represents a column, the partToken represents the column name, the objectToken is table/view
name of this column if this column is qualified like table.column, otherwise, the objectToken is
null.
schemaToken, databaseToken, serverToken is the qualified part of a database object name.
If this objectName represents a database name in the create database statement like this
CREATE DATABASE menagerie, then, the objectToken is menagerie and databaseToken is null.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionintInternal use onlystatic final intDeprecated.static final intDeprecated.replaced byEDbObjectType.static final intDeprecated.replaced byEDbObjectType.static final intDeprecated.replaced byEDbObjectType.method.static final intDeprecated.replaced byEDbObjectType.constraint.static final intDeprecated.replaced byEDbObjectType.static final intDeprecated.replaced byEDbObjectType.static final intDeprecated.replaced byEDbObjectType.static final intDeprecated.replaced byEDbObjectType.static final intDeprecated.replaced byEDbObjectType.static final intDeprecated.replaced byEDbObjectType.static final intDeprecated.replaced byEDbObjectType.static final intDeprecated.replaced byEDbObjectType.static final intDeprecated.replaced byEDbObjectType.static final intDeprecated.replaced byEDbObjectType.Fields 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 classvoidappendObjectName(TObjectName objectName) voidattributesToPropertyToken(TObjectNameList attributes) used in Oracle and teradata SQL syntaxclone()voidThe X and Y position of this objectName in the SQLstatic TObjectNamecreateObjectName(EDbVendor dbVendor, EDbObjectType dbObjectType) static TObjectNamecreateObjectName(EDbVendor dbVendor, EDbObjectType dbObjectType, TSourceToken token1) static TObjectNamecreateObjectName(EDbVendor dbVendor, EDbObjectType dbObjectType, TSourceToken token1, TSourceToken token2) static TObjectNamecreateObjectName(EDbVendor dbVendor, EDbObjectType dbObjectType, TSourceToken token1, TSourceToken token2, TSourceToken token3) static TObjectNamecreateObjectName(EDbVendor dbVendor, EDbObjectType dbObjectType, TSourceToken token1, TSourceToken token2, TSourceToken token3, TSourceToken token4) static TObjectNamecreateObjectName(EDbVendor dbVendor, EDbObjectType dbObjectType, String str) If a table name is not qualified with a database name, but GSP detect the database for this table in the metadata then, this method will return this detected database name.In this SQL: select * from part1.part2, In Hive, MySQL and Teradata, part1 will be treated as a database name, returned in getDatabaseString(), while getSchemaString() return empty string.这个属性只有当 column 为 * 时有效 当 column 为 * 时, 本属性包含该 * 展开后对应的 attributeNode 列表,来源是 FROM CLAUSE中的 tables, 在 resolve star column 时给本属性赋值, TStmtScope.resolve(TObjectName objectName) 当 table 有metadata或DDL给出了明确的字段时,每table个展开的 attributeNode 包含明确的字段名,such as t.c 当 table 没有 metadata 和 DDL 时,每table个只展开的 一个 attributeNode,内容为 t.*非 star column 使用该属性存放可能包含该 column 的 attributeNode star column 使用getAttributeNodesDerivedFromFromClause()Get DDL verification status for all candidate tables.Get all candidate tables (for ambiguous columns)The data type of this column is structured UDT, this method returns the column's attributes.Returns only the column name if it's prefixed with a table namelongThe column position of this objectName in the SQLif this is a star column(column name is *), and the value of this star column is derived from a subquery, then, this field points to the select list in the subqueryConvenience method: get column source (most common access pattern)String text of the database nameThe database part of this objectName: [server.][database.][schema.]objectThe database link partremoreserverin this objectName: scott.emp@remoreserverThe database object type of this objectName such as table, view, column for example.intgetDdlVerificationStatus(TTable table) Check DDL verification status for a candidate table.This is the schema fetched from the SQLEnv.Array element of this objectNamelongThe line number of this objectName in SQLThe column definition in create/alter table statement that include this column name object.gudusoft.gsqlparser.compiler.TVariableThe Couchbase namespace before keyspaceGet normalized column string with caching (Phase 5 optimization).Get normalized database string with caching (Phase 5 optimization).Get normalized schema string with caching (Phase 5 optimization).Get normalized server string with caching (Phase 5 optimization).Get normalized table string with caching (Phase 5 optimization).intList the number of parts made up this objectNameString text of the object nameThe object part of this objectName such as table name, view name.intDeprecated.usegetDbObjectType()instead.String text of the package name.Oracle package nameString text of the part nameThe column name of this objectName ifgetDbObjectType()isEDbObjectType.column.getPath()stage pathTell whether this is a quoted objectName.Get resolution result from new resolverintString text of schema name in a qualified name of a schema object.The schema name of this objectName.String text of the server nameThe server part of this objectName: [server.][database.][schema.]objectDeprecated.Since 3.4.0.5.The result column which include this columnGet the immediate source table where this column is visible in the current scope.source table list for star column,
select * from emp,dept
* column will be list to both emp and dept table.String text of the table nameThe table name of this objectName, it's the same value asgetObjectToken()ifgetDbObjectType()isEDbObjectType.tableintvoidinit(EDbObjectType dbObjectType, Object arg1, Object arg2, Object arg3) voidInitialize a query tree node.voidvoidvoidvoidvoidbooleanCheck if this column reference is ambiguousbooleanisAttributeNameInObjectName(TSourceToken leftparen, TSourceToken rightparen) booleanReturns true if candidate tables came from UNION/CTE branch propagation, false if they came from ambiguity (e.g., unqualified column in multi-table query).booleanbooleanbooleanbooleanbooleanCheck whether a column is prefixed by a table like this:table.columnbooleanbooleanCheck if this column reference has been resolved (by new resolver)booleanPostgreSQL column with array typesbooleanSometime, a non-qualified column can't be linked to a table without additional metadata from database.booleanisValidColumnName(EDbVendor pDBVendor) Check whether a column name is syntax valid in a specific database vendor.voidmergeObjectName(TObjectName objectName) Used internally in hive .y file to merge two objectNamesvoidmergeObjectName(TObjectName objectName, TObjectName objectName2) booleanresolveWithThisTable(TTable pTable) This column must be in this syntax: table.column, otherwise, this method always return false.protected TSQLSchemavoidsetAtsign(TSourceToken atsign) voidsetColumnAttributes(TObjectNameList columnAttributes) voidsetColumnsLinkedToStar(TResultColumnList columnsLinkedToStar) voidsetCommentString(TSourceToken commentString) voidsetDatabaseToken(TSourceToken databaseToken) voidsetDatabaseToken(TSourceToken databaseToken, boolean implicit) voidsetDblink(TObjectName dblink) voidsetDblink(TObjectName dblink, boolean linkToDB) voidsetDbObjectType(EDbObjectType dbObjectType) Set object type of this objectNamevoidsetDbObjectType(EDbVendor dbVendor, EDbObjectType dbObjectType) voidsetDbObjectTypeDirectly(EDbObjectType dbObjectType) voidsetExceptReplaceClause(TExceptReplaceClause exceptReplaceClause) voidsetExclamationmark(TSourceToken exclamationmark) voidsetImplictDatabaseName(String implictDatabaseName) voidsetImplictSchemaName(String implictSchemaName) voidsetIndirection(TIndirection indirection) voidsetLinkedColumnDef(TColumnDefinition linkedColumnDef) voidsetLinkedVariable(gudusoft.gsqlparser.compiler.TVariable linkedVariable) voidsetMethodToken(TSourceToken methodToken) voidsetNamespace(TObjectName namespace) voidsetObjectToken(TSourceToken objectToken) voidsetObjectType(int objectType) Deprecated.voidsetOrphanColumn(boolean orphanColumn) voidsetOwnStmt(TCustomSqlStatement ownStmt) voidsetPackageToken(TSourceToken packageToken) voidsetParentObjectName(TObjectName parentObjectName) voidsetPartToken(TSourceToken partToken) voidsetPath(TPathSqlNode path) voidsetPropertyToken(TSourceToken propertyToken) voidsetQuoteType(EQuoteType quoteType) voidsetResolution(ResolutionResult resolution) Set resolution result (called by resolver2.NameResolver)voidsetResolveStatus(int resolveStatus) voidsetSchemaToken(TSourceToken schemaToken) voidsetSchemaToken(TSourceToken schemaToken, boolean implicit) voidsetServerToken(TSourceToken serverToken) voidsetSourceAttributeNode(TAttributeNode sourceAttributeNode) Deprecated.Since 3.4.0.5.voidsetSourceColumn(TResultColumn sourceColumn) Set the result column which include this column name.voidsetSourceColumnOnly(TResultColumn sourceColumn) Set the source column without changing dbObjectType.voidsetSourceTable(TTable sourceTable) Set the table this column belongs to.voidsetSourceTableBySQLResolver(TCustomSqlStatement sqlStatement, TAttributeNode attributeNode, TTable newSourceTable) voidvoidsetTableDetermined(boolean tableDetermined) voidsetTableKind(ETableKind tableKind) voidsetValidate_column_status(int validate_column_status) voidvoidtoString()返回该对象名的字符串表示(中文说明):Methods inherited from class gudusoft.gsqlparser.nodes.TParseTreeNode
addAllMyTokensToTokenList, addToTokenChain, appendNewNode, calculateTokenCount, doAppendNewNode, doParse, fastSetString, getAnchorNode, getCommentAfterNode, getCommentBeforeNode, getCompactString, getDummyTag, getEndToken, getEvaluateDatatype, getEvalValue, getGsqlparser, getLocation, getMd5, getNodeStatus, getNodeType, getPlainText, getStartToken, getTokenCount, hasNext, 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
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.Iterator
forEachRemaining
-
Field Details
-
searchLevel
Internal use only -
ttobjNotAObject
Deprecated.replaced byEDbObjectType. this is not an object, like sysdate function in oracle database- See Also:
-
ttobjUnknown
Deprecated.replaced byEDbObjectType. object type can't be determined.- See Also:
-
ttobjColumn
Deprecated.replaced byEDbObjectType. column in table, objectToken is table if specified, and partToken is column name.- See Also:
-
ttobjColumnAlias
Deprecated.replaced byEDbObjectType. column alias in objectToken.- See Also:
-
ttobjTable
Deprecated.replaced byEDbObjectType. table name in objectToken.- See Also:
-
ttobjParameter
Deprecated.replaced byEDbObjectType. parameter name in objectToken.- See Also:
-
ttobjVariable
Deprecated.replaced byEDbObjectType. variable name in objectToken.- See Also:
-
ttobjColumnMethod
Deprecated.replaced byEDbObjectType.method. column method like SetXY below, column method inmethodToken, and colomn name inpartToken.UPDATE Cities
SET Location.SetXY(23.5, 23.5)
- See Also:
-
ttobjFunctionName
Deprecated.replaced byEDbObjectType. function name inobjectToken- See Also:
-
ttobjConstraintName
Deprecated.replaced byEDbObjectType.constraint. constraint name inobjectToken- See Also:
-
ttobjStringConstant
Deprecated.replaced byEDbObjectType. string constant inobjectToken- See Also:
-
ttobjAttribute
Deprecated.replaced byEDbObjectType. attribute name is inpartToken- See Also:
-
ttobjDatatype
Deprecated.replaced byEDbObjectType. datatype was not represented by a TObjectName object, this constant was used in source tokens that consist of TTypeName.- See Also:
-
ttobjSchemaName
Deprecated.replaced byEDbObjectType. schema name inschemaToken- See Also:
-
ttobjPositionalParameters
Deprecated.replaced byEDbObjectType. postgresql Positional Parameters, $1, $1[1], $1[1,10] parameter name is inpartTokenof $1, and parameter name is inobjectTokenof $1.columnName, and column name is inpartToken- See Also:
-
-
Constructor Details
-
TObjectName
public TObjectName()
-
-
Method Details
-
setOwnStmt
-
getOwnStmt
-
getExceptReplaceClause
-
setExceptReplaceClause
-
setTableKind
-
getTableKind
-
setLinkedVariable
-
getLinkedVariable
-
setSourceAttributeNode
Deprecated.Since 3.4.0.5. Use TSQLResolver2 withsetResolution(gudusoft.gsqlparser.resolver2.model.ResolutionResult)instead.Sets the source attribute node for this object name.This method is used only by the legacy TSQLResolver (RESOLVER). It is not used when using TSQLResolver2 (RESOLVER2) for name resolution. For RESOLVER2, use
setResolution(gudusoft.gsqlparser.resolver2.model.ResolutionResult)instead.- Parameters:
sourceAttributeNode- the attribute node representing the resolved source
-
getSourceAttributeNode
Deprecated.Since 3.4.0.5. Use TSQLResolver2 withgetResolution()instead.Returns the source attribute node for this object name.This method is used only by the legacy TSQLResolver (RESOLVER). It is not used when using TSQLResolver2 (RESOLVER2) for name resolution. For RESOLVER2, use
getResolution()instead.- Returns:
- the attribute node representing the resolved source, or null if not resolved
-
setResolution
Set resolution result (called by resolver2.NameResolver) -
getResolution
Get resolution result from new resolver -
getColumnSource
Convenience method: get column source (most common access pattern) -
isAmbiguous
Check if this column reference is ambiguous -
isResolved
Check if this column reference has been resolved (by new resolver) -
getCandidateTables2
Get all candidate tables (for ambiguous columns) -
clone
-
setParentObjectName
-
getParentObjectName
- Overrides:
getParentObjectNamein classTParseTreeNode
-
setPath
-
getPath
stage path- Returns:
-
getSourceTableList
source table list for star column,
select * from emp,dept
* column will be list to both emp and dept table.- Returns:
-
isImplicitSchema
-
isImplicitDatabase
-
getAttributeNodesDerivedFromFromClause
这个属性只有当 column 为 * 时有效 当 column 为 * 时, 本属性包含该 * 展开后对应的 attributeNode 列表,来源是 FROM CLAUSE中的 tables, 在 resolve star column 时给本属性赋值, TStmtScope.resolve(TObjectName objectName) 当 table 有metadata或DDL给出了明确的字段时,每table个展开的 attributeNode 包含明确的字段名,such as t.c 当 table 没有 metadata 和 DDL 时,每table个只展开的 一个 attributeNode,内容为 t.*- Returns:
-
getCandidateAttributeNodes
非 star column 使用该属性存放可能包含该 column 的 attributeNode star column 使用getAttributeNodesDerivedFromFromClause()- Returns:
-
getCandidateTables
-
isCandidatesFromUnion
Returns true if candidate tables came from UNION/CTE branch propagation, false if they came from ambiguity (e.g., unqualified column in multi-table query). When true, the formatter should output all candidates instead of marking as "missed". -
getDdlVerificationStatus
Check DDL verification status for a candidate table.Returns a tri-state result:
- 1 = Column exists in table's DDL
- 0 = Column NOT found in table's DDL (DDL available but column missing)
- -1 = Cannot verify (no DDL available for this table)
- Parameters:
table- The candidate table to check- Returns:
- DDL verification status: 1 (exists), 0 (not found), -1 (no DDL)
-
getCandidateTableDdlStatus
Get DDL verification status for all candidate tables.Returns a map from each candidate table to its DDL verification status:
- 1 = Column exists in table's DDL
- 0 = Column NOT found in table's DDL
- -1 = Cannot verify (no DDL available)
- Returns:
- Map of candidate tables to their DDL verification status, or empty map if no candidates
-
setOrphanColumn
-
isOrphanColumn
-
isReservedKeyword
-
setLinkedColumnDef
-
getLinkedColumnDef
The column definition in create/alter table statement that include this column name object.CREATE TABLE table_name ( column1 datatype, column2 datatype );In above SQL,column1 datatypeis the column definition whilecolumn1is this object name.- Returns:
- column definition in create/alter table statement
-
setNamespace
-
getNamespace
The Couchbase namespace before keyspace- Returns:
- the namespace
-
toString
返回该对象名的字符串表示(中文说明):1) 优先调用父类
Object.toString()获取已构造好的整体标识文本; 若父类返回非空,则: - 对于 Snowflake,当文本以IDENTIFIER(...)形式出现时,仅提取并返回其中的 字面量部分(去除引号),以符合 Snowflake 标识符解析规则; - 其他情况直接返回父类结果。2) 若父类返回为空(尚未生成整体文本),则回退到更细粒度的 token: - 若存在
part级 token,返回其字符串; - 否则若存在object级 token,返回其字符串; - 若仍不存在,返回 null。目的:统一并优先复用已构造的字符串表示,同时兼容特定数据库(如 Snowflake)的 标识符语义,从而在不同厂商 SQL 中提供稳定、符合预期的对象名输出。
- Overrides:
toStringin classTParseTreeNode- Returns:
- 节点对应的SQL字符串。
-
setQuoteType
-
getQuoteType
Tell whether this is a quoted objectName.- Returns:
- EQuoteType.squareBracket or EQuoteType.doubleQuote if this objectName is quoted.
-
isContinueToSearch
-
setSourceColumn
Set the result column which include this column name. Used by parser internally.- Parameters:
sourceColumn- the result column includes this column name
-
setSourceColumnOnly
Set the source column without changing dbObjectType. Used by resolver2 for legacy API compatibility when the column is already properly typed (e.g., star-inferred columns).- Parameters:
sourceColumn- the result column includes this column name
-
getSourceColumn
The result column which include this columnselect salary + 1000 from empIn the above SQL,salary + 1000is the result column whilesalaryis this column name.- Returns:
- the result column includes this column name
-
resolveWithThisTable
This column must be in this syntax: table.column, otherwise, this method always return false. Match tableToken with the input pTable, compare the alias of pTable to tableToken at first, If not the same, then compare the table name directly. This method can handle quoted name correctly. This method is used by parser internally.- Parameters:
pTable- table used to matchgetTableToken()of this column object- Returns:
- true if input table is matched with tableToken of this column object
-
isQualified
Check whether a column is prefixed by a table like this:table.column- Returns:
- true if this column is in syntax like this:
table.column
-
getValidate_column_status
-
setValidate_column_status
-
isValidColumnName
Check whether a column name is syntax valid in a specific database vendor. For example, in Oracle,rowidis not a valid column name.- Parameters:
pDBVendor- in which the database vendor the syntax of this column is checked- Returns:
- true if this objectName can be used as a column name in the specified database
-
getColumnsLinkedToStarColumn
-
setColumnsLinkedToStar
-
getColumnsLinkedToStar
if this is a star column(column name is *), and the value of this star column is derived from a subquery, then, this field points to the select list in the subquery- Returns:
- the select list in the subquery
-
setSourceTable
Set the table this column belongs to. Used by parser internally.- Parameters:
sourceTable- table contains this column
-
setSourceTableBySQLResolver
public void setSourceTableBySQLResolver(TCustomSqlStatement sqlStatement, TAttributeNode attributeNode, TTable newSourceTable) -
getSourceTable
Get the immediate source table where this column is visible in the current scope.This returns the table/subquery/CTE that directly exposes this column in the FROM clause, NOT the final physical table after tracing through subqueries or CTEs.
To get the final physical table (after tracing through all layers), use:
getResolution().getColumnSource().getFinalTable()Example
SELECT title FROM (SELECT * FROM books) sub For the 'title' column in outer SELECT: - getSourceTable() → TTable for subquery 'sub' (tableType=subquery) - resolution.getFinalTable() → TTable for 'books' (the physical table)- Returns:
- The immediate source table, or null if not resolved
- See Also:
-
sourceTableColumnSource.getFinalTable()
-
setResolveStatus
-
getResolveStatus
-
TObjectName
-
isSubscripts
PostgreSQL column with array typesCREATE TABLE sal_emp ( name text, pay_by_quarter integer[], schedule text[][] );In the above SQL, this method returns true forpay_by_quartercolumn.- Returns:
- true if this objectName is array type
-
setIndirection
-
getIndirection
Array element of this objectNameselect arraycolumn[4] from t;In the above SQL, this method returns[4]of this objectName.- Returns:
- array element of this objectName
- See Also:
-
setPropertyToken
-
getAtsign
-
getMethodToken
-
getPropertyToken
-
getServerToken
The server part of this objectName: [server.][database.][schema.]object- Returns:
- server part of the objectName
-
getExclamationmark
-
getDblink
The database link partremoreserverin this objectName: scott.emp@remoreserver- Returns:
- database link
-
getDatabaseToken
The database part of this objectName: [server.][database.][schema.]object- Returns:
- database part of the objectName
-
setTableDetermined
-
isTableDetermined
Sometime, a non-qualified column can't be linked to a table without additional metadata from database.select name from emp, deptIn the above SQL, thenamecolumn can't be determined which table it belongs to. Below is a more complicated SQL that shows the relationship between column and table.select s2.s2t1a1, s3.s3t1a1 from ( select * from subselect2table1 s2t1 ) s2, ( select * from subselect3table1, subselect3table2 ) s3column s2t1a1 was linked to subselect2table1,isTableDetermined()returns true for this column.
column s3t1a1 was linked to both subselect3table1 and subselect3table2 due to lack of meta information from database,isTableDetermined()returns false for this column.Provide database metadata will help GSP links the column to the table correctly.
- Returns:
- true if this column can be linked to a table without doubt.
- See Also:
-
attributesToPropertyToken
used in Oracle and teradata SQL syntaxteradata:
column.attribute()
column.attribute().attribute()
- Parameters:
attributes-
-
setColumnAttributes
-
getColumnAttributes
The data type of this column is structured UDT, this method returns the column's attributes. Below is the sample SQL from teradata.CREATE TYPE school_record AS ( school_name VARCHAR(20), GPA FLOAT); CREATE TYPE college_record AS ( school school_record, major VARCHAR(20), minor VARCHAR(20)); CREATE TABLE student_record ( student_id INTEGER, Last_name VARCHAR(20), First_name VARCHAR(20), high_school school_record, college college_record); SELECT student_id, last_name, first_name, high_school.school_name(), high_school.GPA(), college.school().school_name(), college.school().GPA(), college.major(), college.minor() FROM student_record; SELECT *.ALL FROM student_record; SELECT student_record.*.ALL;Take this columncollege.school().school_name()for example, the partToken of this objectName should becollege, and the value returned by this method should beschool().school_name()PLEASE NOTE THAT CURRENT VERSION CAN'T HANDLE THE ABOVE SQL CORRECTLY.
- Returns:
- attributes of this structured UDT column
-
setObjectType
Deprecated.Used internally.- Parameters:
objectType- object type of this objectName
-
setDbObjectType
-
setDbObjectTypeDirectly
-
setDbObjectType
Set object type of this objectName- Parameters:
dbObjectType- database object type
-
getDbObjectType
The database object type of this objectName such as table, view, column for example. If object type isEDbObjectType.column,getPartToken()represents the column name, for all other object type, the name of this database object is stored ingetObjectToken()- Returns:
- database object type
-
getObjectType
Deprecated.usegetDbObjectType()instead.- Returns:
- the type of database object or variable this objectName represents for.
-
setAtsign
-
setDblink
-
setDblink
-
setServerToken
-
setDatabaseToken
-
setDatabaseToken
-
setObjectToken
-
setPartToken
-
setMethodToken
-
setSchemaToken
-
setSchemaToken
-
setPackageToken
-
getPackageToken
Oracle package name- Returns:
- the source token of Oracle package name.
-
getObjectToken
The object part of this objectName such as table name, view name.- Returns:
- object part of this objectName
-
getPartToken
The column name of this objectName ifgetDbObjectType()isEDbObjectType.column.getColumnToken()returns the same value.- Returns:
- the column name
-
getSchemaToken
The schema name of this objectName.- Returns:
- schema name
-
getPackageString
String text of the package name.- Returns:
- string of the package name,return null if empty.
-
getServerString
String text of the server name- Returns:
- string of the server name,return null if empty.
-
getDatabaseString
String text of the database name- Returns:
- string of the database name,return null if empty.
-
getSchemaString
String text of schema name in a qualified name of a schema object.- Returns:
- string of schema name, return null if empty.
-
setSqlEnv
-
getImplictSchemaString
This is the schema fetched from the SQLEnv. Not the direct qualified schema name of this object search this table in the current default database and schema. If this is a qualified schema object, then returngetSchemaString()This method is only valid when thedbObjectTypeis a schema object.- Returns:
- schema name fetched from the SQLEnv
-
setImplictDatabaseName
-
setImplictSchemaName
-
getImplictDatabaseString
-
searchImplicitSchema
-
getTableToken
The table name of this objectName, it's the same value asgetObjectToken()ifgetDbObjectType()isEDbObjectType.table- Returns:
- table name
-
getTableString
String text of the table name- Returns:
- string of the table name, return null if empty.
-
getObjectString
String text of the object name- Returns:
- string of the object name, return null if empty.
-
getPartString
String text of the part name- Returns:
- string of the part name, return null if empty.
-
getNormalizedDatabaseString
Get normalized database string with caching (Phase 5 optimization).This method caches the normalized database name to avoid repeated normalize() calls. The cache is invalidated automatically when the IdentifierProfile changes (e.g., vendor switch).
- Returns:
- normalized database name, or empty string if not available
-
getNormalizedSchemaString
Get normalized schema string with caching (Phase 5 optimization).This method caches the normalized schema name to avoid repeated normalize() calls. The cache is invalidated automatically when the IdentifierProfile changes.
- Returns:
- normalized schema name, or empty string if not available
-
getNormalizedTableString
Get normalized table string with caching (Phase 5 optimization).This method caches the normalized table name to avoid repeated normalize() calls. The cache is invalidated automatically when the IdentifierProfile changes.
- Returns:
- normalized table name, or empty string if not available
-
getNormalizedColumnString
Get normalized column string with caching (Phase 5 optimization).This method caches the normalized column name (from partToken) to avoid repeated normalize() calls. The cache is invalidated automatically when the IdentifierProfile changes.
- Returns:
- normalized column name, or empty string if not available
-
getNormalizedServerString
Get normalized server string with caching (Phase 5 optimization).This method caches the normalized server name to avoid repeated normalize() calls. The cache is invalidated automatically when the IdentifierProfile changes.
- Returns:
- normalized server name, or empty string if not available
-
setExclamationmark
-
getAnsiSchemaName
In this SQL: select * from part1.part2, In Hive, MySQL and Teradata, part1 will be treated as a database name, returned in getDatabaseString(), while getSchemaString() return empty string. However, TObjectName.getAnsiSchemaName() will return part1, which means it's a schema name. If a table name is not qualified with a schema name, but GSP detect the schema for this table in the metadata then, this method will return this detected schema name.- Returns:
- schema name
-
getAnsiCatalogName
If a table name is not qualified with a database name, but GSP detect the database for this table in the metadata then, this method will return this detected database name.- Returns:
-
getNumberOfPart
List the number of parts made up this objectName- Returns:
- the number of parts that made up this objectName
-
createObjectName
-
createObjectName
public static TObjectName createObjectName(EDbVendor dbVendor, EDbObjectType dbObjectType, TSourceToken token1) -
createObjectName
public static TObjectName createObjectName(EDbVendor dbVendor, EDbObjectType dbObjectType, String str) -
createObjectName
public static TObjectName createObjectName(EDbVendor dbVendor, EDbObjectType dbObjectType, TSourceToken token1, TSourceToken token2) -
createObjectName
public static TObjectName createObjectName(EDbVendor dbVendor, EDbObjectType dbObjectType, TSourceToken token1, TSourceToken token2, TSourceToken token3) -
createObjectName
public static TObjectName createObjectName(EDbVendor dbVendor, EDbObjectType dbObjectType, TSourceToken token1, TSourceToken token2, TSourceToken token3, TSourceToken token4) -
splitNameInQuotedIdentifier
-
init
Description copied from class:TParseTreeNodeInitialize a query tree node. Used internally- Overrides:
initin classTParseTreeNode- Parameters:
arg1- first argument
-
init
- Overrides:
initin classTParseTreeNode
-
init
-
init
- Overrides:
initin classTParseTreeNode
-
init
- Overrides:
initin classTParseTreeNode
-
init
- Overrides:
initin classTParseTreeNode
-
init
- Overrides:
initin classTParseTreeNode
-
getColumnNo
The column position of this objectName in the SQL- Overrides:
getColumnNoin classTParseTreeNode- Returns:
- column position
-
getLineNo
The line number of this objectName in SQL- Overrides:
getLineNoin classTParseTreeNode- Returns:
- the line number
-
getReferencedObjects
-
getColumnNameOnly
Returns only the column name if it's prefixed with a table name- Returns:
- only the column name if it's prefixed with a table name
-
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
-
getColumnToken
- Returns:
- source token that represents column, return null if this objectName is not type of column
-
isAttributeNameInObjectName
-
mergeObjectName
Used internally in hive .y file to merge two objectNames -
mergeObjectName
-
columnToProperty
-
appendObjectName
-
setCommentString
-
getCommentString
-
coordinate
The X and Y position of this objectName in the SQL- Returns:
- coordinate in string text
-
EDbObjectType.