Tabrez Mohammed
12/06/2024, 7:31 PMcol = "foo" # both c.foo and p.foo are all nulls
df.where(df[f"c.{col}"] == df[f"p.{col}"]).show()
returns 0 rowsTabrez Mohammed
12/06/2024, 7:36 PMdf.where(df[f"c.{col}"] != df[f"p.{col}"]).show()
also returns 0 rowsjay
12/06/2024, 7:47 PMnull if either LHS/RHS is a null I believe.
We should check what postgres behavior is and follow that
cc @Kevin WangTabrez Mohammed
12/06/2024, 7:49 PMdf.where(
(col(f"p.{col_name}").is_null() & col(f"c.{col_name}").is_null())
| (col(f"p.{col_name}").not_null() & col(f"c.{col_name}").not_null())
| (col(f"p.{col_name}") == col(f"c.{col_name}"))
).show()Tabrez Mohammed
12/06/2024, 7:51 PM==), I get all rows as expected, but the inclusion of the 3rd part reverts it to 0 rows, which seems brokenKevin Wang
12/06/2024, 7:58 PMKevin Wang
12/06/2024, 7:59 PMTabrez Mohammed
12/06/2024, 8:00 PMKevin Wang
12/06/2024, 8:03 PMKevin Wang
12/06/2024, 8:03 PMKevin Wang
12/06/2024, 8:12 PMTabrez Mohammed
12/06/2024, 8:45 PMfill_null? Not giving an error filling an int64 col with strings or vice versajay
12/06/2024, 8:48 PMjay
12/06/2024, 8:49 PMTabrez Mohammed
12/07/2024, 3:38 AMDaftCoreException: DaftError::External Unable to create logical plan node.
Due to: DaftError::TypeError Expected expr and fill_value arguments for fill_null to be castable to the same supertype, but received amount#Decimal(precision=10, scale=0) and literal#Decimal(precision=1, scale=0)
df[f"c.{col}.amount"].fill_null(Decimal(-1.0)) != df[f"p.{col}.amount"].fill_null(Decimal(-1.0))
EDIT: nvm, realized what precision vs scale are. Need a 10 digit number and it works.