-
Notifications
You must be signed in to change notification settings - Fork 273
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
Draft
andygrove
wants to merge
15
commits into
apache:main
Choose a base branch
from
andygrove:iceberg-public-api-tests
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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>
4 tasks
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]
Contributor
|
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:
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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