public class ModelFactory extends Object
| Constructor and Description |
|---|
ModelFactory(ModelBindingManager modelManager) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
appendTableColumns(Table tableModel) |
void |
bindVariableUnderIdentityScope(Procedure procedure,
String variableName,
Variable variable)
B1 (routine-summary-scc-design §3): additionally index a declared
formal's Variable under its routine's overload pool (its frozen scope
and declaration identity).
|
Alias |
createAlias(TAliasClause aliasClause) |
ResultColumn |
createAndBindingSelectSetResultColumn(ResultSet resultSet,
TResultColumn resultColumn,
int index) |
Table |
createArrayRelationTable(TTable table,
String name)
Plan section 4.3: the table of a relation a table-generating construct adds to a SELECT, a Hive-family
LATERAL VIEW here, keyed by its parse node and published under name. |
CallRelationship |
createCallRelation() |
Table |
createCatalogNamedTable(String tableName)
The model of a table named by the catalog rather than by the SQL (the base table of a catalog synonym): the
table the analysis holds under that name, else a new one, bound like any table.
|
Table |
createConstantsTable(String sqlHash) |
Table |
createConstantsTable(TCustomSqlStatement stmt) |
CrudRelationship |
createCrudRelation() |
Variable |
createCursor(TCursorDeclStmt stmt) |
Variable |
createCursor(TForStmt stmt) |
Variable |
createCursor(TLoopStmt stmt) |
Variable |
createCursor(TMssqlDeclare stmt) |
Variable |
createCursor(TOpenforStmt stmt) |
Database |
createDatabase(TObjectName databaseName) |
DataFlowRelationship |
createDataFlowRelation() |
Table |
createDataSource(TObjectName dataSourceName) |
TableColumn |
createDeclaredFieldPath(TableColumn declared,
List<StructuredPathSegment> segments,
TObjectName position)
createFieldPath(gudusoft.gsqlparser.dlineage.dataflow.model.TableColumn, java.util.List<gudusoft.gsqlparser.common.structured.StructuredPathSegment>, gudusoft.gsqlparser.nodes.TObjectName) for the DDL that declares the path: a node is made even where the declaration in force
would refuse it, because this statement is the new declaration (plan rule R10). |
ResultColumn |
createDeterminedResultColumn(ResultSet resultSet,
TObjectName resultColumn) |
ERRelationship |
createERRelation() |
TableColumn |
createFieldPath(TableColumn declared,
List<StructuredPathSegment> segments,
TObjectName position)
The field path node of
declared at segments, with every node above it: customer,
customer.address, customer.address.city. |
TableColumn |
createFileUri(Table table,
TObjectName fileUri) |
TableColumn |
createFileUriFieldPath(TableColumn fileColumn,
List<StructuredPathSegment> segments)
The field path node at
segments below fileColumn, a column of the files of a LOCATION
(createFileUri(gudusoft.gsqlparser.dlineage.dataflow.model.Table, gudusoft.gsqlparser.nodes.TObjectName)), made as needed. |
Function |
createFunction(TCaseExpression caseExpression) |
Function |
createFunction(TFunctionCall functionCall) |
Function |
createFunction(TObjectName functionName) |
FunctionResultColumn |
createFunctionResultColumn(Function function,
TObjectName functionName) |
FunctionResultColumn |
createFunctionResultColumn(Function function,
TWhenClauseItemList caseFunction) |
ImpactRelationship |
createImpactRelation() |
IndirectImpactRelationship |
createIndirectImpactRelation() |
TableColumn |
createInsertTableColumn(Table tableModel,
ResultColumn source)
Preserve the producer's identity when materializing a projected column.
|
TableColumn |
createInsertTableColumn(Table tableModel,
String columnName) |
TableColumn |
createInsertTableColumn(Table tableModel,
TConstant column,
int columnIndex) |
TableColumn |
createInsertTableColumn(Table tableModel,
TExpression column,
int columnIndex) |
TableColumn |
createInsertTableColumn(Table tableModel,
TObjectName column) |
JoinRelationship |
createJoinRelation() |
Table |
createJsonTable(TTable table) |
TableColumn |
createJsonTableColumn(Table table,
TObjectName column) |
Table |
createJsonVariable(TObjectName jsonVariable)
The relation of a declared JSON variable OPENJSON reads: the variable already declared in the declaration's own
scope, else a new relation there.
|
ResultColumn |
createMergeResultColumn(ResultSet resultSet,
TObjectName resultColumn) |
OraclePackage |
createOraclePackage(TPlsqlCreatePackage stmt) |
Table |
createPathModel(String name,
Object identity)
The path node named
name that identity identifies, made as needed. |
PivotedTable |
createPivotdTable(TPivotClause pivotedTable) |
Procedure |
createProcedure(TStoredProcedureSqlStatement stmt) |
Argument |
createProcedureArgument(OraclePackage oraclePackage,
TParameterDeclaration parameter,
int index) |
Argument |
createProcedureArgument(Procedure procedure,
TParameterDeclaration parameter,
int index) |
Procedure |
createProcedureByName(TObjectName procedureName,
int argumentSize) |
Procedure |
createProcedureFromFunctionCall(TFunctionCall function) |
Process |
createProcess(TCustomSqlStatement processStmt) |
Process |
createProcess(TFunctionCall functionCall) |
QueryTable |
createQueryTable(TTable table) |
RecordSetRelationship |
createRecordSetRelation() |
Variable |
createReferencedVariable(String variableName,
boolean create)
The variable a reference names (see
createReferencedVariable(TObjectName)); when create is
false, only a declaration visible from the reference. |
Variable |
createReferencedVariable(TObjectName variableName)
The variable a reference names: the declaration visible from the reference (its routine, the enclosing
routines, then its package), else a new variable in the reference's scope.
|
ResultColumn |
createResultColumn(QueryTable queryTableModel,
TResultColumn resultColumn) |
ResultColumn |
createResultColumn(ResultSet resultSet,
TExpression expression) |
ResultColumn |
createResultColumn(ResultSet resultSet,
TObjectName resultColumn) |
ResultColumn |
createResultColumn(ResultSet resultSet,
TObjectName resultColumn,
boolean forceCreate) |
ResultColumn |
createResultColumn(ResultSet resultSet,
TResultColumn resultColumn) |
ResultSet |
createResultSet(TParseTreeNode gspObject,
boolean isTarget) |
ResultSet |
createResultSet(TSelectSqlStatement select,
boolean isTarget) |
Table |
createRowTypeAnchor(String anchorName)
The relation a
%ROWTYPE anchor names: a cursor, a record or a table. |
Schema |
createSchema(TObjectName schemaName) |
ResultColumn |
createSelectSetResultColumn(ResultSet resultSet,
ResultColumn resultColumn) |
ResultColumn |
createSelectSetResultColumn(ResultSet resultSet,
TResultColumn resultColumn,
int index) |
SelectSetResultSet |
createSelectSetResultSet(TSelectSqlStatement stmt) |
Table |
createStage(TObjectName stageName) |
TableColumn |
createStageLocation(Table table,
TObjectName location) |
ResultColumn |
createStarResultColumn(ResultSet resultSetModel,
TResultColumn resultColumn,
String refColumnName) |
ResultColumn |
createStarResultColumn(ResultSet resultSetModel,
TResultColumn resultColumn,
String refColumnName,
Column source) |
ResultColumn |
createStarResultColumn(SelectResultSet resultSet,
Pair<TResultColumn,TObjectName> starColumnPair) |
Table |
createStream(TObjectName streamName) |
ResultColumn |
createStructFieldResultColumn(ResultSet resultSet,
TResultColumn resultColumn,
String field)
STRUCT tree: the result column of one field of
customer.* when the fields of customer are known,
named after the field. |
ResultColumn |
createStructStarResultColumn(ResultSet resultSet,
TResultColumn resultColumn) |
TableColumn |
createStructStarViewColumn(Table viewModel,
TObjectName column,
int index,
boolean determined)
STRUCT tree: the view column of a select item
customer.* whose fields are unknown, one column standing for
every field of customer like its result column (createStructStarResultColumn(gudusoft.gsqlparser.dlineage.dataflow.model.ResultSet, gudusoft.gsqlparser.nodes.TResultColumn)), not a wildcard
over a relation (Mantis 4827). |
Table |
createTable(TTable table) |
Table |
createTable(TTable table,
TObjectName tableBinding) |
Table |
createTableByName(String tableName,
boolean create) |
Table |
createTableByName(TObjectName tableName) |
Table |
createTableByName(TObjectName tableName,
boolean create) |
TableColumn |
createTableColumn(Table table,
String columnName) |
TableColumn |
createTableColumn(Table table,
TConstant constant) |
TableColumn |
createTableColumn(Table table,
TFunctionCall constantFunction) |
TableColumn |
createTableColumn(Table table,
TObjectName column,
boolean fromCreateTable) |
TableColumn |
createTableColumn(Table table,
TResultColumn column) |
Table |
createTableFromCreateDDL(TTable table,
boolean fromDDL) |
Table |
createTableFromCreateDDL(TTable table,
boolean fromDDL,
String tableName) |
Table |
createTriggerOnTable(TTable table) |
Table |
createTypeAnchor(TObjectName qualifier)
The relation a
%TYPE anchor's qualifier names (rec.field%TYPE, tab.col%TYPE): a one-part
qualifier may be a record or cursor declared in scope, which answers before a table of the same name, as PL/SQL
scoping does. |
ResultColumn |
createUpdateResultColumn(ResultSet resultSet,
TObjectName resultColumn) |
Variable |
createVariable(Procedure procedure,
String variableName,
boolean create)
The variable
variableName of procedure as a caller binds an argument to it: the routine's formal
(or local), in the routine's frozen scope, whatever the session's defaults are when the call is analyzed; created
there when create. |
Variable |
createVariable(String variableName) |
Variable |
createVariable(String variableName,
boolean create)
The variable a declaration declares (see
createVariable(TObjectName)); when create is false,
only one already declared in the current scope. |
Variable |
createVariable(TObjectName variableName)
The variable a declaration declares: the one already declared in the declaration's own scope, else a new one
there.
|
TableColumn |
createVariableProperty(Table variableTable,
TDeclareVariable variable) |
Table |
createView(TCustomSqlStatement viewStmt,
TObjectName viewName) |
Table |
createView(TCustomSqlStatement viewStmt,
TObjectName viewName,
boolean fromCreateView) |
TableColumn |
createViewColumn(Table viewModel,
TObjectName column,
int index,
boolean fromCreateView) |
Table |
createXmlTable(TTable table) |
Variable |
findFormalVariable(Procedure procedure,
String variableName)
The formal-argument variable of
procedure named
variableName, WITHOUT the pool stage's complex-typed refusal
(#695). |
protected static String |
getDefaultDatabase() |
protected static String |
getDefaultSchema() |
static String |
getQualifiedTableName(Table table) |
static RoutineAliasKey[] |
packageAliasKeys(TStoredProcedureSqlStatement stmt)
A package statement's name as written with each of its three alias suffixes (types, count, input count), as
createOraclePackage binds them; null when the statement has no name. |
void |
popIdentityScope() |
void |
pushIdentityScope(String identityScopeKey)
Deprecated.
a pool is keyed by its routine: use
pushIdentityScope(String, Procedure). |
void |
pushIdentityScope(String identityScopeKey,
Procedure procedure)
Enters a routine body's overload pool: the routine model it belongs to (its legacy identity text is kept as
metadata only).
|
public ModelFactory(ModelBindingManager modelManager)
public ResultSet createResultSet(TSelectSqlStatement select, boolean isTarget)
public ResultSet createResultSet(TParseTreeNode gspObject, boolean isTarget)
public ResultColumn createResultColumn(ResultSet resultSet, TResultColumn resultColumn)
public TableColumn createStructStarViewColumn(Table viewModel, TObjectName column, int index, boolean determined)
customer.* whose fields are unknown, one column standing for
every field of customer like its result column (createStructStarResultColumn(gudusoft.gsqlparser.dlineage.dataflow.model.ResultSet, gudusoft.gsqlparser.nodes.TResultColumn)), not a wildcard
over a relation (Mantis 4827).public ResultColumn createStructStarResultColumn(ResultSet resultSet, TResultColumn resultColumn)
public ResultColumn createStructFieldResultColumn(ResultSet resultSet, TResultColumn resultColumn, String field)
customer.* when the fields of customer are known,
named after the field. Like createStructStarResultColumn(gudusoft.gsqlparser.dlineage.dataflow.model.ResultSet, gudusoft.gsqlparser.nodes.TResultColumn), it is not a wildcard over a relation.public ResultColumn createStarResultColumn(ResultSet resultSetModel, TResultColumn resultColumn, String refColumnName, Column source)
public ResultColumn createStarResultColumn(ResultSet resultSetModel, TResultColumn resultColumn, String refColumnName)
public ResultColumn createSelectSetResultColumn(ResultSet resultSet, ResultColumn resultColumn)
public ResultColumn createSelectSetResultColumn(ResultSet resultSet, TResultColumn resultColumn, int index)
public ResultColumn createAndBindingSelectSetResultColumn(ResultSet resultSet, TResultColumn resultColumn, int index)
public ResultColumn createResultColumn(ResultSet resultSet, TObjectName resultColumn)
public ResultColumn createDeterminedResultColumn(ResultSet resultSet, TObjectName resultColumn)
public ResultColumn createResultColumn(ResultSet resultSet, TExpression expression)
public ResultColumn createResultColumn(ResultSet resultSet, TObjectName resultColumn, boolean forceCreate)
public FunctionResultColumn createFunctionResultColumn(Function function, TObjectName functionName)
public FunctionResultColumn createFunctionResultColumn(Function function, TWhenClauseItemList caseFunction)
public ResultColumn createMergeResultColumn(ResultSet resultSet, TObjectName resultColumn)
public ResultColumn createUpdateResultColumn(ResultSet resultSet, TObjectName resultColumn)
public ResultColumn createResultColumn(QueryTable queryTableModel, TResultColumn resultColumn)
public Table createTableFromCreateDDL(TTable table, boolean fromDDL, String tableName)
public Table createArrayRelationTable(TTable table, String name)
LATERAL VIEW here, keyed by its parse node and published under name. It is never looked up by
that name nor bound to it, so a table of the script with the same name stays a table of its own (Mantis 4890);
the output never merges the two (xml.table.isArrayRelation).public Table createTableFromCreateDDL(TTable table, boolean fromDDL)
public Table createJsonTable(TTable table)
public Table createXmlTable(TTable table)
public Table createTable(TTable table, TObjectName tableBinding)
public Table createTable(TTable table)
protected void appendTableColumns(Table tableModel)
public Table createTriggerOnTable(TTable table)
public Table createTableByName(TObjectName tableName)
public Table createTypeAnchor(TObjectName qualifier)
%TYPE anchor's qualifier names (rec.field%TYPE, tab.col%TYPE): a one-part
qualifier may be a record or cursor declared in scope, which answers before a table of the same name, as PL/SQL
scoping does.public Table createTableByName(TObjectName tableName, boolean create)
public Table createRowTypeAnchor(String anchorName)
%ROWTYPE anchor names: a cursor, a record or a table. The visible local answers before a
table of the same name, as PL/SQL scoping does.public Table createTableByName(String tableName, boolean create)
public Table createPathModel(String name, Object identity)
name that identity identifies, made as needed. A file a BULK INSERT names
by the same text in two contexts -- under two external data sources, or built by a runtime template -- is two
files, so its node is bound by that identity, not by its name (Mantis 4962).public Table createCatalogNamedTable(String tableName)
public Table createStage(TObjectName stageName)
public Table createDataSource(TObjectName dataSourceName)
public Table createStream(TObjectName streamName)
public Table createConstantsTable(TCustomSqlStatement stmt)
public Table createConstantsTable(String sqlHash)
public Table createJsonVariable(TObjectName jsonVariable)
public Alias createAlias(TAliasClause aliasClause)
public Function createFunction(TFunctionCall functionCall)
public Function createFunction(TObjectName functionName)
public Function createFunction(TCaseExpression caseExpression)
public QueryTable createQueryTable(TTable table)
public TableColumn createFieldPath(TableColumn declared, List<StructuredPathSegment> segments, TObjectName position)
declared at segments, with every node above it: customer,
customer.address, customer.address.city. Existing nodes are found by their structure, the parent
node and the segment, each field name compared by the analysis's identifier rules; missing ones are created with
the position of position.declared - the declared column the path belongs tosegments - the path under itposition - the name whose position created nodes reportdeclared itself for an empty pathpublic TableColumn createDeclaredFieldPath(TableColumn declared, List<StructuredPathSegment> segments, TObjectName position)
createFieldPath(gudusoft.gsqlparser.dlineage.dataflow.model.TableColumn, java.util.List<gudusoft.gsqlparser.common.structured.StructuredPathSegment>, gudusoft.gsqlparser.nodes.TObjectName) for the DDL that declares the path: a node is made even where the declaration in force
would refuse it, because this statement is the new declaration (plan rule R10).public TableColumn createTableColumn(Table table, TObjectName column, boolean fromCreateTable)
public static String getQualifiedTableName(Table table)
protected static String getDefaultSchema()
protected static String getDefaultDatabase()
public TableColumn createStageLocation(Table table, TObjectName location)
public TableColumn createFileUri(Table table, TObjectName fileUri)
public TableColumn createFileUriFieldPath(TableColumn fileColumn, List<StructuredPathSegment> segments)
segments below fileColumn, a column of the files of a LOCATION
(createFileUri(gudusoft.gsqlparser.dlineage.dataflow.model.Table, gudusoft.gsqlparser.nodes.TObjectName)), made as needed. Like the files' column, it has no place in the SQL text.public TableColumn createVariableProperty(Table variableTable, TDeclareVariable variable)
public TableColumn createJsonTableColumn(Table table, TObjectName column)
public DataFlowRelationship createDataFlowRelation()
public CallRelationship createCallRelation()
public CrudRelationship createCrudRelation()
public ERRelationship createERRelation()
public TableColumn createTableColumn(Table table, TResultColumn column)
public TableColumn createTableColumn(Table table, TConstant constant)
public TableColumn createTableColumn(Table table, TFunctionCall constantFunction)
public TableColumn createTableColumn(Table table, String columnName)
public RecordSetRelationship createRecordSetRelation()
public ImpactRelationship createImpactRelation()
public IndirectImpactRelationship createIndirectImpactRelation()
public JoinRelationship createJoinRelation()
public Table createView(TCustomSqlStatement viewStmt, TObjectName viewName)
public Table createView(TCustomSqlStatement viewStmt, TObjectName viewName, boolean fromCreateView)
public Process createProcess(TCustomSqlStatement processStmt)
public Process createProcess(TFunctionCall functionCall)
public TableColumn createViewColumn(Table viewModel, TObjectName column, int index, boolean fromCreateView)
public TableColumn createInsertTableColumn(Table tableModel, String columnName)
public TableColumn createInsertTableColumn(Table tableModel, ResultColumn source)
public TableColumn createInsertTableColumn(Table tableModel, TObjectName column)
public TableColumn createInsertTableColumn(Table tableModel, TExpression column, int columnIndex)
public TableColumn createInsertTableColumn(Table tableModel, TConstant column, int columnIndex)
public SelectSetResultSet createSelectSetResultSet(TSelectSqlStatement stmt)
public ResultColumn createStarResultColumn(SelectResultSet resultSet, Pair<TResultColumn,TObjectName> starColumnPair)
public Variable createCursor(TCursorDeclStmt stmt)
public Variable createCursor(TMssqlDeclare stmt)
public Variable createCursor(TLoopStmt stmt)
public Variable createCursor(TForStmt stmt)
public Variable createCursor(TOpenforStmt stmt)
public void bindVariableUnderIdentityScope(Procedure procedure, String variableName, Variable variable)
@Deprecated public void pushIdentityScope(String identityScopeKey)
pushIdentityScope(String, Procedure).public void pushIdentityScope(String identityScopeKey, Procedure procedure)
popIdentityScope().public void popIdentityScope()
public Variable createVariable(TObjectName variableName)
public Variable createReferencedVariable(TObjectName variableName)
public Variable createVariable(String variableName)
public Variable createVariable(String variableName, boolean create)
createVariable(TObjectName)); when create is false,
only one already declared in the current scope.public Variable createReferencedVariable(String variableName, boolean create)
createReferencedVariable(TObjectName)); when create is
false, only a declaration visible from the reference.public Variable createVariable(Procedure procedure, String variableName, boolean create)
variableName of procedure as a caller binds an argument to it: the routine's formal
(or local), in the routine's frozen scope, whatever the session's defaults are when the call is analyzed; created
there when create.public Variable findFormalVariable(Procedure procedure, String variableName)
procedure named
variableName, WITHOUT the pool stage's complex-typed refusal
(#695). The refusal exists because binding a whole record onto its
single wildcard column was noise; a caller that first materializes the
formal's fields from its declared type binds exactly, so it needs the
variable the refusal hides. Lookup only — never creates.public Database createDatabase(TObjectName databaseName)
public Schema createSchema(TObjectName schemaName)
public PivotedTable createPivotdTable(TPivotClause pivotedTable)
public Procedure createProcedure(TStoredProcedureSqlStatement stmt)
public OraclePackage createOraclePackage(TPlsqlCreatePackage stmt)
public static RoutineAliasKey[] packageAliasKeys(TStoredProcedureSqlStatement stmt)
createOraclePackage binds them; null when the statement has no name.public Procedure createProcedureFromFunctionCall(TFunctionCall function)
public Procedure createProcedureByName(TObjectName procedureName, int argumentSize)
public Argument createProcedureArgument(Procedure procedure, TParameterDeclaration parameter, int index)
public Argument createProcedureArgument(OraclePackage oraclePackage, TParameterDeclaration parameter, int index)