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
Table aliases can not be used with joined tables in SQL expressions.
To Reproduce
df1=daft.from_pydict({"idx":[1,2],"val":[10,20]})
df2=daft.from_pydict({"idx":[1,2],"score":[0.1,0.2]})
df_sql=daft.sql("select * from df1 join df2 on (df1.idx=df2.idx) where df1.val>10").show()
df_sql=daft.sql("select * from df1 join df2 on (df1.idx=df2.idx) where df2.score>0.1").show()
The first sql works and one can use df1.val the second fails with Table not found: df2
In this case you can use just score but this is not ideal when you have duplicate columns and use of table aliases is normal in SQL expressions to correctly identify the column. I see the core docs discuss duplicate cols after a join are prepended with right. but this would not be ideal or realistic in SQL usage which would not be valid SQL.
Expected behavior
All joined table aliases should be available to be used in the WHERE clause of an SQL expression.
Component(s)
SQL
Additional context
Version 0.3.8
The text was updated successfully, but these errors were encountered:
Describe the bug
Table aliases can not be used with joined tables in SQL expressions.
To Reproduce
The first sql works and one can use
df1.val
the second fails withTable not found: df2
In this case you can use just
score
but this is not ideal when you have duplicate columns and use of table aliases is normal in SQL expressions to correctly identify the column. I see the core docs discuss duplicate cols after a join are prepended withright.
but this would not be ideal or realistic in SQL usage which would not be valid SQL.Expected behavior
All joined table aliases should be available to be used in the WHERE clause of an SQL expression.
Component(s)
SQL
Additional context
Version
0.3.8
The text was updated successfully, but these errors were encountered: