Skip to content

Conversation

@shangxinli
Copy link
Contributor

Add iceberg/data subdirectory with FileWriter base interface that defines common operations for writing Iceberg data files, including data files, equality delete files, and position delete files.

Add iceberg/data subdirectory with FileWriter base interface that defines
common operations for writing Iceberg data files, including data files,
equality delete files, and position delete files.

- Add FileWriter interface with Write, Length, Close, and Metadata methods
- Add WriteResult struct to hold metadata for produced files
- Add comprehensive unit tests with MockFileWriter implementation
- Update build system to include new data subdirectory

Related to apache#441 task 1
- Use default member initializers in MockFileWriter
- Fix include ordering per clang-format
- Fix line wrapping in comments and assertions

add_iceberg_test(roaring_test SOURCES roaring_test.cc)

add_iceberg_test(data_writer_test SOURCES data_writer_test.cc)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

namespace iceberg {

// Mock implementation of FileWriter for testing
class MockFileWriter : public FileWriter {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment on lines +49 to +53
///
/// \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.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
///
/// \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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants