-
Notifications
You must be signed in to change notification settings - Fork 281
test: Add Iceberg API stability tests #3240
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Add documentation detailing all Comet classes and methods that form the public API used by Apache Iceberg. This helps contributors understand which APIs may affect Iceberg integration and need backward compatibility considerations. The documentation covers: - org.apache.comet.parquet: FileReader, RowGroupReader, ReadOptions, ParquetColumnSpec, column readers, BatchReader, Native JNI methods - org.apache.comet: CometSchemaImporter - org.apache.comet.vector: CometVector - org.apache.comet.shaded.arrow: RootAllocator, ValueVector Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add a custom Java annotation @IcebergApi to mark all classes, methods, constructors, and fields that form the public API used by Apache Iceberg. This makes it easy to identify which APIs need backward compatibility considerations when making changes. The annotation is applied to: - org.apache.comet.parquet: FileReader, RowGroupReader, ReadOptions, WrappedInputFile, ParquetColumnSpec, AbstractColumnReader, ColumnReader, BatchReader, MetadataColumnReader, ConstantColumnReader, Native, TypeUtil, Utils - org.apache.comet: CometSchemaImporter - org.apache.comet.vector: CometVector Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add annotations to: - AbstractColumnReader.nativeHandle (protected field accessed by Iceberg subclasses) - AbstractCometSchemaImporter.close() (called by Iceberg) Also update documentation to include these APIs. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add a new Maven module containing dedicated unit tests for all @IcebergApi annotated classes, ensuring the public API contract with Apache Iceberg remains stable and tested. Key changes: - Add iceberg-public-api module with 169 tests covering all @IcebergApi classes - Fix CometVector constructor visibility (protected -> public) to match API annotation - Add IcebergApiVerificationTest for reflection-based API verification - Add tests for FileReader, BatchReader, ColumnReader, Native, TypeUtil, Utils - Add tests for CometVector, CometSchemaImporter, WrappedInputFile Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add a dedicated workflow that runs the iceberg-public-api module tests when changes are made to the common module or the API test module itself. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Use local `root_op` variable instead of unwrapping `exec_context.root_op` - Replace `is_some()` + `unwrap()` pattern with `if let Some(...)` Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The CometVector constructor should remain protected since it's an abstract class meant to be subclassed (by Iceberg). The @IcebergApi annotation is kept since the constructor is part of the API contract for subclasses. Updated IcebergApiVerificationTest to allow protected constructors for abstract classes, as this is a valid pattern for inheritance-based APIs. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Shorter, cleaner module name. The module can potentially hold both API source code and tests in the future. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
iceberg-api module with API stability tests [iceberg]
|
This would require an update in iceberg which would require a comet release. In the meantime, we have apache/iceberg#13786 open. |
iceberg-api module with API stability tests [iceberg]…dule The iceberg-api module tests could not access AbstractCometSchemaImporter because the shade plugin relocates org.apache.arrow.* classes. Moving the tests to the common module allows them to run before shading occurs. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add a new "iceberg" test suite containing the Iceberg API verification tests that were moved to the common module. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This reverts commit 6a467f1.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3240 +/- ##
============================================
+ Coverage 56.12% 60.85% +4.72%
- Complexity 976 1464 +488
============================================
Files 119 170 +51
Lines 11743 15774 +4031
Branches 2251 2606 +355
============================================
+ Hits 6591 9599 +3008
- Misses 4012 4849 +837
- Partials 1140 1326 +186 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
I am closing this PR for now and will revisit this if/when #3237 gets merged |
Rationale
The goal of this PR is to add dedicated tests for the public API that Iceberg currently depends on (based on the latest Iceberg main branch). All of the tests were generated with AI. They may not be perfect, but it is a start. We can always add more tests.
Important
Note that these tests only check that the API is stable. They do not currently test the functionality, but there are existing Comet integration tests that verify it via the
native_cometscan. In the future, we will add functional tests to the newiceberg-apimodule because thenative_cometscan is deprecated in Comet and will eventually be removed, along with all of its dedicated tests. See #2177 for more details about this.The rest of this PR description was written by AI.
Summary
@IcebergApiannotated classesTest Coverage (169 tests)
IcebergApiVerificationTestFileReaderApiTest,RowGroupReaderApiTestColumnReaderApiTest,BatchReaderApiTest, etc.NativeApiTestTypeUtilApiTest,UtilsApiTestCometVectorApiTestCometSchemaImporterApiTestWrappedInputFileApiTestTest plan
mvn test -DwildcardSuites="org.apache.comet.iceberg.api"🤖 Generated with Claude Code