wgtmac commented on code in PR #446:
URL: https://github.com/apache/iceberg-cpp/pull/446#discussion_r2650541542


##########
src/iceberg/test/CMakeLists.txt:
##########
@@ -113,6 +113,8 @@ add_iceberg_test(util_test
 
 add_iceberg_test(roaring_test SOURCES roaring_test.cc)
 
+add_iceberg_test(data_writer_test SOURCES data_writer_test.cc)

Review Comment:
   I think we need to move it to the `if(ICEBERG_BUILD_BUNDLE)` block below 
since it depends on Avro and Parquet libraries.



##########
src/iceberg/test/data_writer_test.cc:
##########
@@ -0,0 +1,218 @@
+/*
+ * 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.
+ */
+
+#include <memory>
+#include <vector>
+
+#include <gmock/gmock.h>
+#include <gtest/gtest.h>
+
+#include "iceberg/arrow_c_data.h"
+#include "iceberg/data/writer.h"
+#include "iceberg/manifest/manifest_entry.h"
+#include "iceberg/result.h"
+#include "iceberg/test/matchers.h"
+
+namespace iceberg {
+
+// Mock implementation of FileWriter for testing
+class MockFileWriter : public FileWriter {

Review Comment:
   IMHO, we don't need to add test cases for a pure interface classes. We can 
keep it for now and then remove all these cases once we have implemented 
`DataWriter`.



##########
src/iceberg/data/writer.h:
##########
@@ -0,0 +1,91 @@
+/*
+ * 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
+
+/// \file iceberg/data/writer.h
+/// Base interface for Iceberg data file writers.
+
+#include <cstdint>
+#include <memory>
+#include <vector>
+
+#include "iceberg/arrow_c_data.h"
+#include "iceberg/iceberg_export.h"
+#include "iceberg/manifest/manifest_entry.h"
+#include "iceberg/result.h"
+
+namespace iceberg {
+
+/// \brief Base interface for data file writers.
+///
+/// This interface defines the common operations for writing Iceberg data 
files,
+/// including data files, equality delete files, and position delete files.
+///
+/// Typical usage:
+/// 1. Create a writer instance (via concrete implementation)
+/// 2. Call Write() one or more times to write data
+/// 3. Call Close() to finalize the file
+/// 4. Call Metadata() to get file metadata (only valid after Close())
+///
+/// \note This interface is not thread-safe. Concurrent calls to Write()
+/// from multiple threads on the same instance are not supported.
+///
+/// \note This interface uses PascalCase method naming (Write, Length, Close, 
Metadata)
+/// to distinguish it from the lower-level iceberg/file_writer.h::Writer 
interface which
+/// uses lowercase naming. FileWriter is the Iceberg-specific data file writer
+/// abstraction, while Writer is the file format-level abstraction.

Review Comment:
   ```suggestion
   ```



-- 
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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to