jaychia commented on issue #208: URL: https://github.com/apache/iceberg-python/issues/208#issuecomment-2085981955
> Idea from @Fokko - support day/month/year transforms first You can also try using the transforms that Daft has already implemented. Full list of transforms: * [Expression.partitioning.days]( https://www.getdaft.io/projects/docs/en/latest/api_docs/doc_gen/expression_methods/daft.Expression.partitioning.days.html) * [Expression.partitioning.hours]( https://www.getdaft.io/projects/docs/en/latest/api_docs/doc_gen/expression_methods/daft.Expression.partitioning.hours.html) * [Expression.partitioning.months]( https://www.getdaft.io/projects/docs/en/latest/api_docs/doc_gen/expression_methods/daft.Expression.partitioning.months.html) * [Expression.partitioning.year]( https://www.getdaft.io/projects/docs/en/latest/api_docs/doc_gen/expression_methods/daft.Expression.partitioning.year.html) * [Expression.partitioning.iceberg_truncate]( https://www.getdaft.io/projects/docs/en/latest/api_docs/doc_gen/expression_methods/daft.Expression.partitioning.iceberg_truncate.html) * [Expression.partitioning.iceberg_bucket]( https://www.getdaft.io/projects/docs/en/latest/api_docs/doc_gen/expression_methods/daft.Expression.partitioning.iceberg_bucket.html) Should be zero-copy conversions between arrow and Daft as well (cheap!): ``` import pyarrow as pa from daft import Series pyarrow_array = pa.array(list(range(10000))) # Should be very cheap! Under the hood just uses the same arrow buffers daft_series = Series.from_arrow(pa.array(list(range(10000)))) print(daft_series) ╭──────────────╮ │ arrow_series │ │ --- │ │ Int64 │ ╞══════════════╡ │ 0 │ ├╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤ │ 1 │ ├╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤ │ 2 │ ├╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤ │ 3 │ ├╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤ │ 4 │ ├╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤ │ … │ ├╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤ │ 9995 │ ├╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤ │ 9996 │ ├╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤ │ 9997 │ ├╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤ │ 9998 │ ├╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤ │ 9999 │ ╰──────────────╯ partitioned = daft_series.partitioning.iceberg_bucket(32) print(partitioned) ╭─────────────────────╮ │ arrow_series_bucket │ │ --- │ │ Int32 │ ╞═════════════════════╡ │ 28 │ ├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤ │ 4 │ ├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤ │ 20 │ ├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤ │ 19 │ ├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤ │ 6 │ ├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤ │ … │ ├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤ │ 10 │ ├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤ │ 28 │ ├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤ │ 7 │ ├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤ │ 13 │ ├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤ │ 28 │ ╰─────────────────────╯ ``` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
