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
tree = parse_one("select a from b")
for n in tree.dsf():
print(n, type(n))
outputs
SELECT a FROM b <class 'sqlglot.expressions.Select'>
a <class 'sqlglot.expressions.Column'>
a <class 'sqlglot.expressions.Identifier'>
FROM b <class 'sqlglot.expressions.From'>
b <class 'sqlglot.expressions.Table'>
b <class 'sqlglot.expressions.Identifier'>
There are 2 clear issues here:
the tree itself comes as the first element while it should come last
Identifier should always come before Column or Table because it is deeper in the tree (i.e. the order is wrong)
The text was updated successfully, but these errors were encountered:
This code:
outputs
There are 2 clear issues here:
The text was updated successfully, but these errors were encountered: