public class DataFlowAnalyzer extends Object implements IDataFlowAnalyzer
| Constructor and Description |
|---|
DataFlowAnalyzer(File[] sqlFiles,
EDbVendor dbVendor,
boolean simpleOutput) |
DataFlowAnalyzer(File[] sqlFiles,
Option option) |
DataFlowAnalyzer(File sqlFile,
EDbVendor dbVendor,
boolean simpleOutput) |
DataFlowAnalyzer(File sqlFile,
Option option) |
DataFlowAnalyzer(SqlInfo[] sqlInfos,
EDbVendor dbVendor,
boolean simpleOutput) |
DataFlowAnalyzer(SqlInfo[] sqlInfos,
Option option) |
DataFlowAnalyzer(String[] sqlContents,
EDbVendor dbVendor,
boolean simpleOutput) |
DataFlowAnalyzer(String[] sqlContents,
EDbVendor dbVendor,
boolean simpleOutput,
String defaultServer,
String defaultDatabase,
String defaltSchema) |
DataFlowAnalyzer(String[] sqlContents,
Option option) |
DataFlowAnalyzer(String sqlContent,
EDbVendor dbVendor,
boolean simpleOutput) |
DataFlowAnalyzer(String sqlContent,
EDbVendor dbVendor,
boolean simpleOutput,
String defaultServer,
String defaultDatabase,
String defaltSchema) |
DataFlowAnalyzer(String sqlContent,
Option option) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
analyzeResultColumnExpressionRelation(Object resultColumn,
TExpression expression) |
protected void |
analyzeTableSubquery(TTable table) |
String |
chechSyntax() |
protected List<SqlInfo> |
convertSQL(EDbVendor vendor,
String json) |
void |
dispose() |
protected void |
flattenStructColumns(boolean hasDefinition,
Table tableModel,
TColumnDefinition column,
Stack<TColumnDefinition> columnPaths,
int index) |
String |
generateDataFlow() |
String |
generateDataFlow(boolean withExtraInfo) |
String |
generateSqlInfos() |
dataflow |
getDataFlow() |
Map |
getDynamicSQLMap() |
List<DynamicSqlSite> |
getDynamicSqlSites()
Every dynamic-SQL execution site (T-SQL
EXEC(...) / sp_executesql) the analyzer
encountered, with whether it was statically resolved. |
List<ErrorInfo> |
getErrorMessages() |
Map |
getHashSQLMap() |
protected String |
getIdentifiedFunctionName(Function function) |
Option |
getOption() |
static String |
getReleaseDate() |
DbObjectPosition |
getSelectedDbObjectInfo(Coordinate start,
Coordinate end)
Deprecated.
please use SqlInfoHelper.getSelectedDbObjectInfo
|
dataflow |
getSimpleDataflow(dataflow instance,
boolean simpleOutput) |
dataflow |
getSimpleDataflow(dataflow instance,
boolean simpleOutput,
List<String> types) |
static Dataflow |
getSqlflowJSONModel(dataflow dataflow)
Deprecated.
|
static Dataflow |
getSqlflowJSONModel(dataflow dataflow,
EDbVendor vendor) |
static Dataflow |
getSqlflowJSONModel(EDbVendor vendor,
dataflow dataflow,
boolean normalizeIdentifier) |
Map<String,List<SqlInfo>> |
getSqlInfos() |
protected TObjectNameList |
getTableLinkedColumns(TTable table) |
static String |
getVersion() |
boolean |
isAggregateFunction(TFunctionCall func) |
boolean |
isBuiltInFunctionName(String functionName) |
boolean |
isBuiltInFunctionName(TObjectName object) |
boolean |
isConstant(TObjectName object) |
boolean |
isIgnoreCoordinate() |
boolean |
isIgnoreRecordSet() |
boolean |
isIgnoreTemporaryTable() |
boolean |
isKeyword(String objectName) |
boolean |
isKeyword(TObjectName object) |
boolean |
isLinkOrphanColumnToFirstTable() |
boolean |
isShowCallRelation() |
boolean |
isShowConstantTable() |
boolean |
isShowCountTableColumn() |
boolean |
isShowImplicitSchema() |
boolean |
isShowJoin() |
boolean |
isSimpleShowFunction() |
boolean |
isSimpleShowTopSelectResultSet() |
protected boolean |
isStructColumn(TObjectName columnName) |
protected boolean |
isTopResultSet(TSelectSqlStatement stmt) |
boolean |
isTransform() |
boolean |
isTransformCoordinate() |
static void |
main(String[] args) |
static dataflow |
mergeTables(dataflow dataflow,
Long startId) |
static dataflow |
mergeTables(dataflow dataflow,
Long startId,
Option option) |
DynamicLineageResult |
resolveDynamicSqlLineage(TCustomSqlStatement procAst,
EDbVendor vendor,
TSQLEnv sqlEnv,
String currentDatabase,
String defaultSchema,
Map<String,SqlValue> bindings,
DynamicLineageOptions options)
Resolve dynamic-SQL object names by abstractly evaluating a stored procedure
with a set of parameter bindings.
|
void |
setHandleListener(DataFlowHandleListener listener) |
void |
setIgnoreCoordinate(boolean ignoreCoordinate) |
void |
setIgnoreRecordSet(boolean ignoreRecordSet) |
void |
setIgnoreTemporaryTable(boolean ignoreTemporaryTable) |
void |
setLinkOrphanColumnToFirstTable(boolean linkOrphanColumnToFirstTable) |
void |
setOption(Option option) |
void |
setShowCallRelation(boolean showCallRelation) |
void |
setShowConstantTable(boolean showConstantTable) |
void |
setShowCountTableColumn(boolean showCountTableColumn) |
void |
setShowImplicitSchema(boolean showImplicitSchema) |
void |
setShowJoin(boolean showJoin) |
void |
setSimpleShowFunction(boolean simpleShowFunction) |
void |
setSimpleShowTopSelectResultSet(boolean simpleShowTopSelectResultSet) |
void |
setSqlEnv(TSQLEnv sqlenv) |
void |
setTextFormat(boolean textFormat) |
void |
setTransform(boolean transform) |
void |
setTransformCoordinate(boolean transformCoordinate) |
String |
traceView() |
public DataFlowAnalyzer(String sqlContent, Option option)
public DataFlowAnalyzer(String sqlContent, EDbVendor dbVendor, boolean simpleOutput, String defaultServer, String defaultDatabase, String defaltSchema)
public DataFlowAnalyzer(String sqlContent, EDbVendor dbVendor, boolean simpleOutput)
public DataFlowAnalyzer(String[] sqlContents, Option option)
public DataFlowAnalyzer(String[] sqlContents, EDbVendor dbVendor, boolean simpleOutput, String defaultServer, String defaultDatabase, String defaltSchema)
public DataFlowAnalyzer(String[] sqlContents, EDbVendor dbVendor, boolean simpleOutput)
public DataFlowAnalyzer(SqlInfo[] sqlInfos, Option option)
public DataFlowAnalyzer(SqlInfo[] sqlInfos, EDbVendor dbVendor, boolean simpleOutput)
public DataFlowAnalyzer(File[] sqlFiles, Option option)
public DataFlowAnalyzer(File[] sqlFiles, EDbVendor dbVendor, boolean simpleOutput)
public DataFlowAnalyzer(File sqlFile, Option option)
public DataFlowAnalyzer(File sqlFile, EDbVendor dbVendor, boolean simpleOutput)
public boolean isIgnoreRecordSet()
isIgnoreRecordSet in interface IDataFlowAnalyzerpublic void setIgnoreRecordSet(boolean ignoreRecordSet)
setIgnoreRecordSet in interface IDataFlowAnalyzerpublic boolean isSimpleShowTopSelectResultSet()
isSimpleShowTopSelectResultSet in interface IDataFlowAnalyzerpublic void setSimpleShowTopSelectResultSet(boolean simpleShowTopSelectResultSet)
setSimpleShowTopSelectResultSet in interface IDataFlowAnalyzerpublic boolean isSimpleShowFunction()
isSimpleShowFunction in interface IDataFlowAnalyzerpublic void setSimpleShowFunction(boolean simpleShowFunction)
setSimpleShowFunction in interface IDataFlowAnalyzerpublic boolean isShowJoin()
isShowJoin in interface IDataFlowAnalyzerpublic void setShowJoin(boolean showJoin)
setShowJoin in interface IDataFlowAnalyzerpublic void setShowCallRelation(boolean showCallRelation)
public boolean isShowCallRelation()
public boolean isShowImplicitSchema()
isShowImplicitSchema in interface IDataFlowAnalyzerpublic void setShowImplicitSchema(boolean showImplicitSchema)
setShowImplicitSchema in interface IDataFlowAnalyzerpublic boolean isShowConstantTable()
isShowConstantTable in interface IDataFlowAnalyzerpublic void setShowConstantTable(boolean showConstantTable)
setShowConstantTable in interface IDataFlowAnalyzerpublic boolean isShowCountTableColumn()
isShowCountTableColumn in interface IDataFlowAnalyzerpublic void setShowCountTableColumn(boolean showCountTableColumn)
setShowCountTableColumn in interface IDataFlowAnalyzerpublic boolean isTransform()
isTransform in interface IDataFlowAnalyzerpublic void setTransform(boolean transform)
setTransform in interface IDataFlowAnalyzerpublic boolean isTransformCoordinate()
isTransformCoordinate in interface IDataFlowAnalyzerpublic void setTransformCoordinate(boolean transformCoordinate)
setTransformCoordinate in interface IDataFlowAnalyzerpublic boolean isLinkOrphanColumnToFirstTable()
isLinkOrphanColumnToFirstTable in interface IDataFlowAnalyzerpublic void setLinkOrphanColumnToFirstTable(boolean linkOrphanColumnToFirstTable)
setLinkOrphanColumnToFirstTable in interface IDataFlowAnalyzerpublic boolean isIgnoreTemporaryTable()
public void setIgnoreTemporaryTable(boolean ignoreTemporaryTable)
public boolean isIgnoreCoordinate()
isIgnoreCoordinate in interface IDataFlowAnalyzerpublic void setIgnoreCoordinate(boolean ignoreCoordinate)
setIgnoreCoordinate in interface IDataFlowAnalyzerpublic void setHandleListener(DataFlowHandleListener listener)
setHandleListener in interface IDataFlowAnalyzerpublic void setSqlEnv(TSQLEnv sqlenv)
setSqlEnv in interface IDataFlowAnalyzerpublic void setOption(Option option)
setOption in interface IDataFlowAnalyzerpublic Option getOption()
getOption in interface IDataFlowAnalyzerpublic String chechSyntax()
public String generateDataFlow(boolean withExtraInfo)
generateDataFlow in interface IDataFlowAnalyzerpublic String generateDataFlow()
generateDataFlow in interface IDataFlowAnalyzerpublic String generateSqlInfos()
generateSqlInfos in interface IDataFlowAnalyzerpublic Map<String,List<SqlInfo>> getSqlInfos()
getSqlInfos in interface IDataFlowAnalyzerpublic Map getHashSQLMap()
getHashSQLMap in interface IDataFlowAnalyzerpublic Map getDynamicSQLMap()
public DbObjectPosition getSelectedDbObjectInfo(Coordinate start, Coordinate end)
getSelectedDbObjectInfo in interface IDataFlowAnalyzerpublic static dataflow mergeTables(dataflow dataflow, Long startId)
public static dataflow mergeTables(dataflow dataflow, Long startId, Option option)
public dataflow getDataFlow()
getDataFlow in interface IDataFlowAnalyzerpublic dataflow getSimpleDataflow(dataflow instance, boolean simpleOutput) throws Exception
Exceptionpublic dataflow getSimpleDataflow(dataflow instance, boolean simpleOutput, List<String> types) throws Exception
Exceptionprotected void analyzeResultColumnExpressionRelation(Object resultColumn, TExpression expression)
protected void flattenStructColumns(boolean hasDefinition, Table tableModel, TColumnDefinition column, Stack<TColumnDefinition> columnPaths, int index)
protected TObjectNameList getTableLinkedColumns(TTable table)
protected boolean isTopResultSet(TSelectSqlStatement stmt)
protected void analyzeTableSubquery(TTable table)
protected boolean isStructColumn(TObjectName columnName)
protected String getIdentifiedFunctionName(Function function)
public void dispose()
dispose in interface IDataFlowAnalyzer@Deprecated public static Dataflow getSqlflowJSONModel(dataflow dataflow)
public static Dataflow getSqlflowJSONModel(dataflow dataflow, EDbVendor vendor)
public static Dataflow getSqlflowJSONModel(EDbVendor vendor, dataflow dataflow, boolean normalizeIdentifier)
public static String getVersion()
public static String getReleaseDate()
public List<ErrorInfo> getErrorMessages()
getErrorMessages in interface IDataFlowAnalyzerpublic List<DynamicSqlSite> getDynamicSqlSites()
EXEC(...) / sp_executesql) the analyzer
encountered, with whether it was statically resolved. Diagnostic only; not consumed by lineage.
Read-only snapshot; see DynamicSqlSite.public DynamicLineageResult resolveDynamicSqlLineage(TCustomSqlStatement procAst, EDbVendor vendor, TSQLEnv sqlEnv, String currentDatabase, String defaultSchema, Map<String,SqlValue> bindings, DynamicLineageOptions options)
Given a T-SQL CREATE PROC parse tree and the values its parameters
actually had at a call site (e.g. @SourceDB='QSP',
@STG_AEG='STG_AEG'), this evaluates the procedure's dynamic-SQL string
building (assignment + concatenation + name-building functions), materializes
the concrete SQL each EXEC / sp_executesql site runs, analyzes
it with ordinary dlineage, and returns the lineage edges tagged with dynamic
provenance (origin=DYNAMIC_RESOLVED, source proc, stable dynamic-site
id, binding hash). Sites that cannot be reduced are reported as honest
UNRESOLVED diagnostics — never guessed.
This is abstract string evaluation, NOT execution: no table reads, no cursors, no data-dependent control flow. It is purely additive — it builds throwaway analyzers for the materialized strings and does not change the default dlineage output of this analyzer.
procAst - the CREATE PROC parse tree (currently T-SQL)vendor - the SQL dialect (dbvmssql)sqlEnv - catalog env for the resolved analysis (may be null)currentDatabase - the proc's database (resolves unqualified names)defaultSchema - the proc's default schema (e.g. dbo)bindings - parameter name → concrete valueoptions - resource bounds (may be null for defaults)protected List<SqlInfo> convertSQL(EDbVendor vendor, String json)
public void setTextFormat(boolean textFormat)
public boolean isBuiltInFunctionName(TObjectName object)
public boolean isBuiltInFunctionName(String functionName)
public boolean isKeyword(TObjectName object)
public boolean isAggregateFunction(TFunctionCall func)
public boolean isConstant(TObjectName object)