You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
However, if the tables used in a query are aliased then the resolvedColumnRef.getColumn().getTableName() results to the alias name instead of the actual table name.
You can re-create this scenario by analyzing a simple query that utilizes subqueries and make sure the tables inside subqueries are aliased, or you can also try it using with statements, then run the usual steps below. From the resolvedStatements which was returned by Analyzer.analyzeStatement, you can visit any node like the example above.
I am trying to extract the source table name from a resolved column, for example
However, if the tables used in a query are aliased then the
resolvedColumnRef.getColumn().getTableName()
results to the alias name instead of the actual table name.You can re-create this scenario by analyzing a simple query that utilizes subqueries and make sure the tables inside subqueries are aliased, or you can also try it using
with statements
, then run the usual steps below. From the resolvedStatements which was returned byAnalyzer.analyzeStatement
, you can visit any node like the example above.SimpleCatalog simpleCatalog = RegisterCatalog.register(simpleTableList);
Analyzer.analyzeStatement(query, analyzerOptions, simpleCatalog);
does someone know how can we extract the origin and actual table names of a particular resolved column despite being aliased in queries?
Thank you in advance.
The text was updated successfully, but these errors were encountered: