rdblue commented on a change in pull request #139: ORC support integration for Spark 2.4.0 URL: https://github.com/apache/incubator-iceberg/pull/139#discussion_r281835193
########## File path: orc/src/main/java/org/apache/iceberg/orc/OrcValueReader.java ########## @@ -0,0 +1,32 @@ +/* + * 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. + */ + +package org.apache.iceberg.orc; + +/** + * Used for implementing ORC value readers. + */ +public interface OrcValueReader<T> { + + /** + * Reads a value in row. + */ + T read(Object reuse, int row); Review comment: I don't think this does quite the same thing that the other interfaces do. For Avro, a similar interface allows reusing container objects. So a value reader that returns a `Record` can also accept a `Record` instance that it will fill with data. The `reuse` object here is always a `VectorizedRowBatch` and this returns an `InternalRow`. So the equivalent would be this: ```java InternalRow read(VectorizedRowBatch batch, int rowNum, Object rowToReuse); ``` The rows could be swapped out for some other in-memory container, like Iceberg's `GenericRecord`. Unless this is doing something similar to what Avro does, I don't think this is a good change to include in this PR. Maybe we should keep it simple and go with the original code that didn't use a generic interface here. ---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: [email protected] With regards, Apache Git Services --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
