XiaoHongbo-Hope commented on code in PR #8523: URL: https://github.com/apache/paimon/pull/8523#discussion_r3551967261
########## paimon-python/pypaimon/read/rust_plan.py: ########## @@ -0,0 +1,78 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +"""Bridge pypaimon_rust scan planning to the pypaimon reader. + +Manifest planning (``new_scan().plan()``) is a serial, driver-side step and the +plan bottleneck. ``pypaimon_rust`` can do it much faster; this module turns each +Rust ``Split.serialize()`` (the cross-language ``SplitSerializer`` v1 binary) +into a pypaimon :class:`DataSplit` so the normal pypaimon reader can read the +files -- planning in Rust, reading in pypaimon. + +``pypaimon_rust`` is an optional dependency; only :func:`rust_plan` imports it. +""" + +from typing import List, Optional + +from pypaimon.read.split import Split +from pypaimon.read.split_serializer import deserialize_split_v1 + + +def _partition_fields(table): + """Ordered partition DataFields, used to decode the split partition bytes.""" + schema = table.table_schema + by_name = {f.name: f for f in schema.fields} + return [by_name[name] for name in schema.partition_keys] + + +def rust_plan(table, table_identifier: str, catalog_options: dict, *, Review Comment: > This is not called, can this PR not be introduced Removed -- 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]
