Skip to content

Commit

Permalink
Add materialzed layer to the list of supported layers for fast limit …
Browse files Browse the repository at this point in the history
…codepath
  • Loading branch information
ayushdg committed Oct 5, 2022
1 parent 607eccf commit f34536f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion dask_sql/physical/rel/logical/limit.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import dask.dataframe as dd
from dask import config as dask_config
from dask.blockwise import Blockwise
from dask.highlevelgraph import MaterializedLayer
from dask.layers import DataFrameIOLayer

from dask_sql.datacontainer import DataContainer
Expand Down Expand Up @@ -59,7 +60,9 @@ def _apply_limit(self, df: dd.DataFrame, limit: int, offset: int) -> dd.DataFram
dask_config.get("sql.limit.check-first-partition")
and all(
[
isinstance(layer, (DataFrameIOLayer, Blockwise))
isinstance(
layer, (DataFrameIOLayer, Blockwise, MaterializedLayer)
)
for layer in df.dask.layers.values()
]
)
Expand Down

0 comments on commit f34536f

Please sign in to comment.