Closed l1t1 closed 9 months ago
Could you make a minimal reproducible example, e.g. without reading parquet files? I tried reproducing this on the latest Polars main branch from Python but am unable to do so:
import polars as pl
df1 = pl.DataFrame({"a": [1, 1], "b": [3, 4]})
df2 = pl.DataFrame({"a": [1, 2], "c": [5, 6]})
result = df1.join(df2, how="cross")
print(result)
sql = pl.SQLContext({"df1": df1, "df2": df2})
result = sql.execute("select * from df1 cross join df2;", eager=True)
print(result) # same result
use your example, see the result of duckdb
>>> result = sql.execute("select * from df1, df2;", eager=True)
>>> print(result)
shape: (2, 2)
┌─────┬─────┐
│ a ┆ b │
│ --- ┆ --- │
│ i64 ┆ i64 │
╞═════╪═════╡
│ 1 ┆ 3 │
│ 1 ┆ 4 │
└─────┴─────┘
>>> import pandas as pd
>>> import duckdb as dd
>>> dd.sql("select * from df1, df2;")
┌───────┬───────┬───────┬───────┐
│ a │ b │ a │ c │
│ int64 │ int64 │ int64 │ int64 │
├───────┼───────┼───────┼───────┤
│ 1 │ 3 │ 1 │ 5 │
│ 1 │ 3 │ 2 │ 6 │
│ 1 │ 4 │ 1 │ 5 │
│ 1 │ 4 │ 2 │ 6 │
└───────┴───────┴───────┴───────┘
Right, closing as a duplicate then.
still returns wrong result in version 10. 20.31
Checks
[X] I have checked that this issue has not already been reported.
[X] I have confirmed this bug exists on the latest version of the Polars CLI.
Reproducible example