wgtmac commented on code in PR #105: URL: https://github.com/apache/iceberg-cpp/pull/105#discussion_r2097311477
########## src/iceberg/CMakeLists.txt: ########## @@ -79,8 +79,12 @@ install(FILES ${CMAKE_CURRENT_BINARY_DIR}/iceberg_export.h DESTINATION ${ICEBERG_INSTALL_INCLUDEDIR}/iceberg) if(ICEBERG_BUILD_BUNDLE) - set(ICEBERG_BUNDLE_SOURCES arrow/demo_arrow.cc arrow/arrow_fs_file_io.cc - avro/demo_avro.cc avro/avro_schema_util.cc) + set(ICEBERG_BUNDLE_SOURCES + arrow/demo_arrow.cc + arrow/arrow_fs_file_io.cc + avro/demo_avro.cc + avro/avro_schema_util.cc + avro/avro_stream.cpp) Review Comment: Rename it to avro_stream.cc ########## test/avro_test.cc: ########## @@ -44,7 +64,40 @@ TEST(AVROTest, TestDemoAvro) { EXPECT_EQ(avro.print(), expected); } -TEST(AVROTest, TestDemoAvroReader) { +TEST_F(AVROTest, TestAvroBasicStream) { Review Comment: What about adding a separate `avro_stream_test.cc` file with more test cases? ########## src/iceberg/avro/avro_stream.h: ########## @@ -0,0 +1,118 @@ +/* + * 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. + */ + +#pragma once + +#include <arrow/io/interfaces.h> +#include <avro/Stream.hh> + +namespace iceberg::avro { + +class AvroInputStream : public ::avro::SeekableInputStream { + public: + explicit AvroInputStream(std::shared_ptr<::arrow::io::RandomAccessFile> input_stream, + int64_t buffer_size); + + ~AvroInputStream() override; + + /** + * Returns some of available data. + * + * Returns true if some data is available, false if no more data is + * available or an error has occurred. + */ Review Comment: ```suggestion /// \brief Returns some of available data. /// /// Returns true if some data is available, false if no more data is /// available or an error has occurred. ``` Let's keep the comment style consistent with this repo. -- 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: issues-unsubscr...@iceberg.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org For additional commands, e-mail: issues-h...@iceberg.apache.org