apache / apache/datafusion-python

Queries on tables via `register_dataset()` much slower than `register_parquet()`

未關閉
#584 2 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視
bug
主要語言
Python
星號
604
分支
174
平均合併
2 天 22 小時
30 天內合併 PR
5

描述

**Describe the bug**
Queries against tables registered with `register_dataset()` perform around 80x slower than those registered with `register_parquet()`.

**To Reproduce**
```
import datafusion
import pyarrow.dataset as ds
from pathlib import Path

ctx = datafusion.SessionContext()
ctx.register_parquet("mytable", "*.parquet")
ctx.register_dataset("mytable2", ds.dataset(list(Path(".").glob("*.parquet"))))
```
Fast:
```
%time ctx.sql('select file_date, sum("Price" * "Volume") from mytable group by file_date order by file_date').to_arrow_table()
CPU times: user 2min 41s, sys: 3.35 s, total: 2min 45s
Wall time: 2.49 s
```
Slow:
```
%time ctx.sql('select file_date, sum("Price" * "Volume") from mytable2 group by file_date order by file_date').to_arrow_table()
CPU times: user 10min 51s, sys: 5min 40s, total: 16min 31s
Wall time: 3min 18s
```

**Expected behavior**
I'd expect these to be similar performance.

**Additional context**
The reason I'm using `ds.dataset` is because the actual files I'm interesting in accessing are not conveniently globbable (they're across multiple directories). So ideally I'd be able to provide a list of files to `ctx.register_parquet()` instead of a simple glob.

貢獻指南

這個儲存庫沒有索引到貢獻指南

研究方向

首先執行重現,使用分組查詢比較 ctx.register_parquet() 和 ctx.register_dataset(),然後追蹤 Python bindings 中的兩個註冊入口。完成標準是相同的 parquet 檔案具有可比較的查詢效能,並且 register_parquet() 可以依要求接受檔案清單。

由索引模型根據 Issue 內容生成。

評估

技術堆疊
python
領域
data-engineering, performance
Issue 類型
缺陷
難度
4/5
預估耗時
3-5 天
活躍度
停滯
描述清晰度
基本清楚
新手友好度
35/100

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。