Open HectorPascual opened 1 month ago
Thanks. Will be looking at joins shortly (to add support for the new inequality join types), so will dig in to this. (Updated the given example so it can run as-is).
Thanks for the fast reply.
If I move the filter to the WHERE clause, would the execution plan / performance be similar? Thanks!
Also I realized it also breaks in the following case (when applying a function to a column in the join) :
import polars as pl
df1 = pl.DataFrame({"c1": ["aaa", "hello", "xxx"],"c2":["1","0","0"]})
df2 = pl.DataFrame({"c1": ["bbb", "hello", "xxx"], "c2":[1,0,0]})
pl.sql("""
SELECT * FROM df1
LEFT JOIN df2
ON df1.c1 = df2.c1 AND df1.c2 = CAST(df1.c2 as STRING)
""").collect()
If I move the filter to the WHERE clause, would the execution plan / performance be similar? Thanks!
Should be identical ;)
Checks
Reproducible example
Log output
JOIN clauses support '=' constraints on identifiers; found lhs=CompoundIdentifier([Ident...
Issue description
Hello,
I am apparently unable to run filters while joining, a possible workaround is to bring the filter down to a WHERE clause.
I can append AND clauses to the JOIN statement only if a column is involved in both sides (i.e : AND col1=col2 AND col3=col4) but if attempting to filter with a value it fails with the following error :
JOIN clauses support '=' constraints on identifiers; found lhs=CompoundIdentifier([Ident
Expected behavior
I would expect to be able to LEFT JOIN ON col1=col2 AND col1="hello".
Installed versions