Hi, do window functions and joins work in a single...
# general
g
Hi, do window functions and joins work in a single query with the new distributed engine on Ray, with the join pieces falling back to old Ray distributed engine? I know if I toggle the new distribution engine off, I get a not implemented error
daft.exceptions.DaftCoreException: Not Yet Implemented: Window functions are currently only supported on the native runner.
A small test with new engine on seems to work, but want to make sure there are not any caveats.
Tested with:
Copy code
import daft
import daft.context
import ray
from daft.functions import row_number


ray.init(num_cpus=4)
daft.context.set_runner_ray(noop_if_initialized=True)
daft.set_execution_config(use_experimental_distributed_engine=False)


df = daft.from_pydict(
    {
        "id": [1, 2, 3, 4],
        "grp": ["grp1", "grp1", "grp2", "grp2"],
        "value": ["a", "b", "c", "d"],
    }
)

df2 = df.with_column(
    "rn",
    row_number()
    .over(daft.Window().partition_by("grp").order_by("value"))
    .alias("row_num"),
)

df2.join(df2, on="id").show()
c
Window functions don't work at all on the old engine, but they do on the new one. One thing to note though is if there is no
partition_by
, all the data will be coalesced to a single machine. We will be working on optimizing this soon
Regarding what works / doesn't work on the new engine: if there is a single part of the query that cannot be executed on the new engine, it will fallback entirely to the old one. You can check out our current roadmap here: https://github.com/Eventual-Inc/Daft/discussions/4724
g
nvm
oh, you support hash join already in latest version? so the above query would not fallback? and I think I saw that it logs a message that it is falling back.
c
yeah hash joins should be supported in the latest version
🙌 1