Joseph-Rance commented on code in PR #4773: URL: https://github.com/apache/arrow-rs/pull/4773#discussion_r1329812048
########## parquet/src/record/record_reader.rs: ########## @@ -0,0 +1,27 @@ +// 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. + +use super::super::errors::ParquetError; +use super::super::file::reader::RowGroupReader; + +pub trait RecordReader<T> { Review Comment: I added the `T` because it was included in `RecordWriter`, but removing it gives the following error: ``` error[E0117]: only traits defined in the current crate can be implemented for arbitrary types --> parquet_derive_test/src/lib.rs:52:42 | 52 | #[derive(PartialEq, ParquetRecordWriter, ParquetRecordReader, Debug)] | ^^^^^^^^^^^^^^^^^^^ | | | impl doesn't use only types from inside the current crate | this is not defined in the current crate because slices are always foreign | = note: define and implement a trait or new type instead = note: this error originates in the derive macro `ParquetRecordReader` (in Nightly builds, run with -Z macro-backtrace for more info) ``` Where the generated code with the generic included is: ``` impl ::parquet::record::RecordReader<APartiallyCompleteRecord> for &mut [APartiallyCompleteRecord] ``` I don't entirely understand why the type parameter solves this issue, but I do get the feeling it is more specific to the implementation than the trait itself. I would struggle to explain why `T` is necessary without referring directly to this macro. I'm honesty a little lost here. Do you think there is a better solution / do you know why the type parameter actually solves the error? -- 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]
