Replies: 2 comments 1 reply
-
Greetings, please have a look at JSQLTranspiler which can retrieve full column lineage. |
Beta Was this translation helpful? Give feedback.
1 reply
-
As always I depends :-D
Conclusion: Or in other words: |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm developing an application that needs to identify columns used in equality predicates. This is working fine for predicates that are not inside parens. For example consider this query and AST:
SELECT w_tax
FROM
warehouse
WHERE
w_id
= 4;SQL Text
└─Statements: statement.select.PlainSelect
├─selectItems: statement.select.SelectItem
│ └─Column: w_tax
├─Table:
warehouse
└─where: expression.operators.relational.EqualsTo
├─Column:
w_id
└─LongValue: 4
However, if the where clause is in parens, the AST is very different, and the column name and value are not visible explicitly in the AST. How to identify them if they exist?
Here is the same query with the predicates in parens:
SELECT w_tax
FROM
warehouse
WHERE (
w_id
= 4 );Here is the AST:
SQL Text
└─Statements: statement.select.PlainSelect
├─selectItems: statement.select.SelectItem
│ └─Column: w_tax
├─Table:
warehouse
└─ParenthesedExpressionList: (
w_id
= 4)Thanks for your help.
Beta Was this translation helpful? Give feedback.
All reactions