Expose Python UDF inlining as a public, reusable extension codec
まだ誰も着手していません。
評価
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 初心者へのやさしさ
- 48/100
- issue の種類
- 機能追加
- 明瞭さ
- おおむね明確
- 活発さ
- 活発
調査の方向性
crates/core/src/codec.rs と、PythonLogicalCodec、PythonPhysicalCodec、SessionContext.with_python_udf_inlining のエントリポイントから始めてください。公開 codec をチェーンにどのように組み込むべきかを判断する前に、依存関係 #1703 と #1678 の codec 合成の変更を読んでください。外部の Rust コンシューマーが公開 codec を追加し、ペイロードのフレーミングを再実装せずに既存の Python UDF ワイヤーフォーマットを維持できれば完了です。
索引モデルが issue の本文から書いたものです。
説明
Is your feature request related to a problem or challenge? Please describe what you are trying to do.
datafusion-python can serialize a Python scalar UDF inline, by cloudpickling the function together with its schemas and volatility, so a plan referencing a Python UDF round-trips into a process that does not have that function registered. This is what SessionContext.with_python_udf_inlining turns on.
That capability is not reachable from outside the crate. PythonFunctionScalarUDF is pub(crate), and encode_python_scalar_udf / decode_python_scalar_udf in crates/core/src/codec.rs are private; only the try_encode_python_scalar_udf / try_decode_python_scalar_udf wrappers are pub(crate), and they are called from the two codecs this crate installs on every session. A Rust project that already has its own physical extension codec, and wants Python UDFs to travel through it, has to reimplement the cloudpickle framing to stay wire-compatible. Requested in https://github.com/apache/datafusion-python/pull/1678#pullrequestreview-5100366976.
Describe the solution you'd like
Extract the inlining behavior into its own LogicalExtensionCodec / PhysicalExtensionCodec implementation and make that type public, rather than exporting two free functions and a struct. Since #1678 made codecs compose, with_python_udf_inlining can then install that codec into the chain instead of being a flag consulted inside PythonLogicalCodec and PythonPhysicalCodec, and an outside consumer can put the same type in its own chain and get the same wire format for free. Suggested independently in https://github.com/apache/datafusion-python/pull/1678#discussion_r3918287124.
A public codec is a better thing to commit to than the current internals. It hides the payload layout, which is versioned and should stay free to change, and it exposes the behavior at the granularity DataFusion already understands.
Describe alternatives you've considered
Marking the existing functions and PythonFunctionScalarUDF pub as they stand. Smaller, but it publishes the payload layout as API, and it does not compose with anything — a caller still has to decide where in its own codec to call them.
Additional context
Depends on #1703, gating pyo3/extension-module, since the crate cannot currently be linked as a plain Rust dependency. Follow-up from #1678.
- 主要言語
- Python
- スター
- 605
- フォーク
- 176
- 平均マージ
- 1日 23時間
- マージ済み PR(30日)
- 8
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
apache/datafusion-python のほかの issue
-
documentation
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
apache/datafusion-python#1726 ·
-
難易度 2/5 半日 初心者へのやさしさ 88/100
apache/datafusion-python#1691 ·
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
apache/datafusion-python#1644 ·
-
enhancement
難易度 5/5 1週間以上 初心者へのやさしさ 30/100
apache/datafusion-python#1737 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 76/100
apache/datafusion-python#1735 · コメント 1 件 ·
apache/datafusion-python の issue をすべて見る
似ている issue
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
use-agent-os/agent-os#3314 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
BasedHardware/omi#15662 · コメント 1 件 ·
-
documentation help wanted
難易度 2/5 1〜3時間 初心者へのやさしさ 90/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
AiursoftWeb/AnduinOS-2#19 ·