pola-rs / tpch

MIT License
64 stars 36 forks source link

Non-idiomatic usage in q7 #42

Closed jbrockmendel closed 1 year ago

jbrockmendel commented 1 year ago

In both the pandas and modin queries:

lineitem_filtered["l_year"] = lineitem_filtered["l_shipdate"].apply(
    lambda x: x.year
)

should be

lineitem_filtered["l_year"] = lineitem_filtered["l_shipdate"].dt.year

The polars_queries version uses the analogous idiom. This made a pretty big difference locally.

ritchie46 commented 1 year ago

Thanks, the implementations were forked from bodo.ai .I assumed they would be optimized.. Could you make a PR? I can do rerun.