zeroshade commented on code in PR #2404:
URL: https://github.com/apache/iceberg-go/pull/2404#discussion_r4470268093
##########
table/snapshot_manifest_cache.go:
##########
@@ -361,6 +361,17 @@ func (p ManifestProvider) Manifests(ctx context.Context,
snapshot Snapshot) (ite
return slices.Values(set.borrowAllManifests()), nil
}
+// UniqueManifests yields the distinct manifest descriptors referenced by the
+// given snapshots, in first-seen order. It reads manifest lists but not the
+// manifest Avro files themselves. The caller must not modify snapshots during
+// iteration. It shares this provider's bounded cache and FileIO, with bounded
+// concurrent prefetch of historical lists. An error ends the sequence.
+func (p ManifestProvider) UniqueManifests(ctx context.Context, snapshots
[]Snapshot) iter.Seq2[iceberg.ManifestFile, error] {
Review Comment:
The only caller today is the in-package inspector. Consider keeping this
unexported and exporting it in the PR that creates the inspect package (#2083),
so the public shape follows that package's design.
##########
table/manifest_provider_external_test.go:
##########
@@ -0,0 +1,53 @@
+// 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.
+
+package table_test
+
+import (
+ "testing"
+
+ "github.com/apache/iceberg-go/table"
+ "github.com/stretchr/testify/require"
+)
+
+func TestManifestProviderUniqueManifestsFromAnotherPackage(t *testing.T) {
Review Comment:
This mainly shows the method can be called from another package. The
comparison with a `Manifests`-based dedup is already covered by
`TestManifestProviderUniqueManifestsPreservesOrderAndDeduplicates`, so this
file can be dropped.
--
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]