etseidl commented on code in PR #11262: URL: https://github.com/apache/arrow-rs/pull/11262#discussion_r4223278696
########## parquet/src/column/reader/legacy_fixed_len_byte_array.rs: ########## @@ -0,0 +1,466 @@ +// 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. + +//! Temporary reader mitigation for [arrow-rs #11261], fixed by #11262. +//! These historical layouts are not additional Parquet encodings. +//! +//! [arrow-rs #11261]: https://github.com/apache/arrow-rs/issues/11261 +//! +//! The ordinary decoder checks canonical PLAIN sizes before selecting a repair. +//! A bounded prefix probe can rule out the historical layout, but a match never +//! authorizes repair without an independent physical count. Repairs happen once +//! per page; normal value decoding does not need to know the historical layout. +//! Producer strings and embedded Arrow metadata never select a repair. +//! +//! Canonical PLAIN has `N * W` bytes; the historical representation has exactly +//! `N * (W + 4)` bytes with every little-endian length prefix equal to `W`. These +//! sizes are disjoint for nonempty pages with the same independently established +//! `N`. Without that count, the representations can overlap. +//! +//! To retire the mitigation, remove this module, the compatibility hook in +//! `decoder::prepare_v1_fixed_len_byte_array`, and the repair calls in the two +//! normalization helpers there. Replace noncanonical PLAIN repair with a length +//! error and reject FLBA/DELTA_LENGTH_BYTE_ARRAY instead of normalizing it. +//! No changes to the column reader's page setup, read/skip loops, byte-budget +//! validation or canonical tests are required. Keep physical-value validation: +//! it detects corruption independently of legacy support. Remove legacy fixture +//! tests separately. Review Comment: Thank you for leaving instructions ❤️ -- 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]
