laskoviymishka commented on code in PR #1505:
URL: https://github.com/apache/iceberg-go/pull/1505#discussion_r3648016604
##########
Makefile:
##########
@@ -67,7 +67,7 @@ integration-io:
go test -tags=integration -v ./io/...
integration-rest:
- go test -tags=integration -v -run="^TestRestIntegration$$"
./catalog/rest
+ RUN_INTEGRATION_TESTS=1 go test -tags=integration -v
-run="^TestRestIntegration$$" ./catalog/rest
Review Comment:
`integration-rest` is the main CI target for the whole REST suite, so
setting `RUN_INTEGRATION_TESTS=1` here opts every run into the Java
scan-planning tests — not just this one — and those depend on the new
pre-release image, table creation, parquet writes to MinIO, and credential
vending all lining up.
I'd pull the scan-planning tests into their own target
(`integration-rest-scan-planning`) and set the env var there, leaving
`integration-rest` on the stable path. wdyt?
##########
catalog/rest/scan_planning_integration_test.go:
##########
@@ -0,0 +1,321 @@
+// 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.
+
+//go:build integration
+
+package rest_test
+
+import (
+ "bytes"
+ "context"
+ "encoding/json"
+ "fmt"
+ stdio "io"
+ "net/http"
+ "net/url"
+ "os"
+ "strings"
+ "sync"
+ "time"
+
+ "github.com/apache/arrow-go/v18/arrow/array"
+ "github.com/apache/arrow-go/v18/arrow/memory"
+ "github.com/apache/arrow-go/v18/parquet/pqarrow"
+ "github.com/apache/iceberg-go"
+ "github.com/apache/iceberg-go/catalog"
+ "github.com/apache/iceberg-go/catalog/rest"
+ iceio "github.com/apache/iceberg-go/io"
+ "github.com/apache/iceberg-go/table"
+)
+
+const (
+ runIntegrationTestsEnv = "RUN_INTEGRATION_TESTS"
+ integrationAccessDelegation = "vended-credentials"
+ integrationAccessDelegationHeader = "X-Iceberg-Access-Delegation"
+ integrationGCSToken = "scan-planning-integration-token"
+ integrationGCSTokenKey = "gcs.oauth2.token"
+)
+
+func (s *RestIntegrationSuite)
TestScanPlanningJavaSynchronousInteroperability() {
+ s.requireScanPlanningIntegration()
+
+ transport := newScanPlanningCaptureTransport()
+ s.T().Cleanup(transport.CloseIdleConnections)
+ planningCatalog, err := rest.NewCatalog(s.ctx,
"scan-planning-java-wire", "http://localhost:8181",
+ rest.WithCustomTransport(transport))
+ s.Require().NoError(err)
+ s.T().Cleanup(func() { s.Require().NoError(planningCatalog.Close()) })
+ s.requireJavaScanPlanningCapabilities(planningCatalog)
+
+ ident := catalog.ToIdentifier(TestNamespaceIdent,
"scan-planning-java-wire")
+ tbl, dataPath := s.createScanPlanningTable(ident)
+
+ filter, err := json.Marshal(iceberg.EqualTo(iceberg.Reference("foo"),
"hello"))
+ s.Require().NoError(err)
+ snapshotID := tbl.CurrentSnapshot().SnapshotID
+ caseSensitive := true
+ useSnapshotSchema := false
+ minRowsRequested := int64(1)
+
+ response, err := planningCatalog.PlanTableScan(s.ctx, ident,
rest.PlanTableScanRequest{
+ AccessDelegation: stringPointer(integrationAccessDelegation),
+ SnapshotID: &snapshotID,
+ Select: []string{"foo", "bar"},
+ Filter: filter,
+ MinRowsRequested: &minRowsRequested,
+ CaseSensitive: &caseSensitive,
+ UseSnapshotSchema: &useSnapshotSchema,
+ StatsFields: []string{"foo", "bar"},
+ })
+ s.Require().NoError(err)
+ s.Require().Equal(rest.PlanStatusCompleted, response.Status)
+ s.Require().NotNil(response.PlanID)
+ s.Require().NotEmpty(*response.PlanID)
+ planID := *response.PlanID
+ planCancelled := false
+ s.T().Cleanup(func() {
+ if planCancelled {
+ return
+ }
+
+ _ = cancelPlanningWithTimeout(planningCatalog, ident, planID)
+ })
+ s.Empty(response.PlanTasks)
+ s.Require().Len(response.FileScanTasks, 1)
+ s.Empty(response.DeleteFiles)
+ s.assertJavaPlanningCredentials(response.StorageCredentials)
+
+ rawResponses := transport.PlanResponses()
+ s.Require().Len(rawResponses, 1)
+ requestHeaders := transport.PlanRequestHeaders()
+ s.Require().Len(requestHeaders, 1)
+ s.Equal(integrationAccessDelegation,
requestHeaders[0].Get(integrationAccessDelegationHeader))
+ raw := parseRawPlanningFixture(s.T(), string(rawResponses[0]))
+ s.Equal("completed", raw.Status)
+ s.Equal(*response.PlanID, raw.PlanID)
+ s.Empty(raw.PlanTasks)
+ s.Require().Len(raw.FileScanTasks, 1)
+ s.Empty(raw.DeleteFiles)
+
+ task := raw.FileScanTasks[0]
+ s.Equal("data", task.DataFile.Content)
+ s.Equal(dataPath, task.DataFile.FilePath)
+ s.Require().Len(task.DataFile.Partition, 1)
+ s.Equal("17", string(task.DataFile.Partition[0]),
+ "Java partitions must remain typed JSON values, not
binary-bound strings")
+ s.JSONEq(`{"type":"eq","term":"foo","value":"hello"}`,
string(task.ResidualFilter))
+ s.Empty(task.DeleteFileReferences)
+
+ lowerBounds := valueMapByFieldID(s, task.DataFile.LowerBounds)
+ upperBounds := valueMapByFieldID(s, task.DataFile.UpperBounds)
+ s.ElementsMatch([]int{1, 2}, task.DataFile.LowerBounds.Keys)
Review Comment:
These key checks are non-fatal, but the hex assertions right below them
index `lowerBounds[1]` and `lowerBounds[2]`. If Java ever returns different
field IDs, `ElementsMatch` fails, the test keeps running, and then
`s.Equal("68656C6C6F", lowerBounds[1])` compares against a zero-value `""` — so
the failure you actually see is about hex encoding when the real problem is the
field IDs.
I'd make these `s.Require().ElementsMatch` so the test stops at the true
cause.
##########
catalog/rest/scan_planning_integration_test.go:
##########
@@ -0,0 +1,321 @@
+// 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.
+
+//go:build integration
+
+package rest_test
+
+import (
+ "bytes"
+ "context"
+ "encoding/json"
+ "fmt"
+ stdio "io"
+ "net/http"
+ "net/url"
+ "os"
+ "strings"
+ "sync"
+ "time"
+
+ "github.com/apache/arrow-go/v18/arrow/array"
+ "github.com/apache/arrow-go/v18/arrow/memory"
+ "github.com/apache/arrow-go/v18/parquet/pqarrow"
+ "github.com/apache/iceberg-go"
+ "github.com/apache/iceberg-go/catalog"
+ "github.com/apache/iceberg-go/catalog/rest"
+ iceio "github.com/apache/iceberg-go/io"
+ "github.com/apache/iceberg-go/table"
+)
+
+const (
+ runIntegrationTestsEnv = "RUN_INTEGRATION_TESTS"
+ integrationAccessDelegation = "vended-credentials"
+ integrationAccessDelegationHeader = "X-Iceberg-Access-Delegation"
+ integrationGCSToken = "scan-planning-integration-token"
+ integrationGCSTokenKey = "gcs.oauth2.token"
+)
+
+func (s *RestIntegrationSuite)
TestScanPlanningJavaSynchronousInteroperability() {
+ s.requireScanPlanningIntegration()
+
+ transport := newScanPlanningCaptureTransport()
+ s.T().Cleanup(transport.CloseIdleConnections)
+ planningCatalog, err := rest.NewCatalog(s.ctx,
"scan-planning-java-wire", "http://localhost:8181",
+ rest.WithCustomTransport(transport))
+ s.Require().NoError(err)
+ s.T().Cleanup(func() { s.Require().NoError(planningCatalog.Close()) })
+ s.requireJavaScanPlanningCapabilities(planningCatalog)
+
+ ident := catalog.ToIdentifier(TestNamespaceIdent,
"scan-planning-java-wire")
+ tbl, dataPath := s.createScanPlanningTable(ident)
+
+ filter, err := json.Marshal(iceberg.EqualTo(iceberg.Reference("foo"),
"hello"))
+ s.Require().NoError(err)
+ snapshotID := tbl.CurrentSnapshot().SnapshotID
+ caseSensitive := true
+ useSnapshotSchema := false
+ minRowsRequested := int64(1)
+
+ response, err := planningCatalog.PlanTableScan(s.ctx, ident,
rest.PlanTableScanRequest{
+ AccessDelegation: stringPointer(integrationAccessDelegation),
+ SnapshotID: &snapshotID,
+ Select: []string{"foo", "bar"},
+ Filter: filter,
+ MinRowsRequested: &minRowsRequested,
+ CaseSensitive: &caseSensitive,
+ UseSnapshotSchema: &useSnapshotSchema,
+ StatsFields: []string{"foo", "bar"},
+ })
+ s.Require().NoError(err)
+ s.Require().Equal(rest.PlanStatusCompleted, response.Status)
+ s.Require().NotNil(response.PlanID)
+ s.Require().NotEmpty(*response.PlanID)
+ planID := *response.PlanID
+ planCancelled := false
+ s.T().Cleanup(func() {
+ if planCancelled {
+ return
+ }
+
+ _ = cancelPlanningWithTimeout(planningCatalog, ident, planID)
+ })
+ s.Empty(response.PlanTasks)
+ s.Require().Len(response.FileScanTasks, 1)
+ s.Empty(response.DeleteFiles)
+ s.assertJavaPlanningCredentials(response.StorageCredentials)
+
+ rawResponses := transport.PlanResponses()
+ s.Require().Len(rawResponses, 1)
+ requestHeaders := transport.PlanRequestHeaders()
+ s.Require().Len(requestHeaders, 1)
+ s.Equal(integrationAccessDelegation,
requestHeaders[0].Get(integrationAccessDelegationHeader))
+ raw := parseRawPlanningFixture(s.T(), string(rawResponses[0]))
+ s.Equal("completed", raw.Status)
+ s.Equal(*response.PlanID, raw.PlanID)
+ s.Empty(raw.PlanTasks)
+ s.Require().Len(raw.FileScanTasks, 1)
+ s.Empty(raw.DeleteFiles)
+
+ task := raw.FileScanTasks[0]
+ s.Equal("data", task.DataFile.Content)
+ s.Equal(dataPath, task.DataFile.FilePath)
+ s.Require().Len(task.DataFile.Partition, 1)
+ s.Equal("17", string(task.DataFile.Partition[0]),
+ "Java partitions must remain typed JSON values, not
binary-bound strings")
+ s.JSONEq(`{"type":"eq","term":"foo","value":"hello"}`,
string(task.ResidualFilter))
+ s.Empty(task.DeleteFileReferences)
+
+ lowerBounds := valueMapByFieldID(s, task.DataFile.LowerBounds)
+ upperBounds := valueMapByFieldID(s, task.DataFile.UpperBounds)
+ s.ElementsMatch([]int{1, 2}, task.DataFile.LowerBounds.Keys)
+ s.ElementsMatch([]int{1, 2}, task.DataFile.UpperBounds.Keys)
+ s.Equal("68656C6C6F", lowerBounds[1], "Java string lower bounds must be
uppercase hexadecimal")
+ s.Equal("68656C6C6F", upperBounds[1], "Java string upper bounds must be
uppercase hexadecimal")
+ s.Equal("11000000", lowerBounds[2], "Java int lower bounds must use
Iceberg little-endian binary")
+ s.Equal("11000000", upperBounds[2], "Java int upper bounds must use
Iceberg little-endian binary")
+
+ s.Require().Len(raw.StorageCredentials, 1)
+ s.Equal("gcp", raw.StorageCredentials[0].Prefix)
+ s.Equal(integrationGCSToken,
raw.StorageCredentials[0].Config[integrationGCSTokenKey])
+
+ // The reference fixture retains its synchronous plan state until the
client
+ // releases it, so this also verifies the advertised DELETE route end
to end.
+ s.Require().NoError(cancelPlanningWithTimeout(planningCatalog, ident,
planID))
+ planCancelled = true
+}
+
+func (s *RestIntegrationSuite) TestScanPlanningJavaErrorTypes() {
+ s.requireScanPlanningIntegration()
+ s.requireJavaScanPlanningCapabilities(s.cat)
+ s.ensureNamespace()
+ // The published fixture defaults to synchronous inline planning and
exposes
+ // no container setting for async planning or a smaller plan-task page
size.
+ // The not-found cases still exercise the live GET and POST routes and
their
+ // Java error models; deterministic successful polling/fanout remains
covered
+ // by planfake until the reference image exposes those controls.
+
+ missingTable := catalog.ToIdentifier(TestNamespaceIdent,
"missing-scan-planning-table")
+ _, err := s.cat.PlanTableScan(s.ctx, missingTable,
rest.PlanTableScanRequest{})
+ s.ErrorIs(err, catalog.ErrNoSuchTable)
+
+ ident := catalog.ToIdentifier(TestNamespaceIdent,
"scan-planning-java-errors")
+ tbl, err := s.cat.CreateTable(s.ctx, ident, tableSchemaSimple)
+ s.Require().NoError(err)
+ s.Require().NotNil(tbl)
+ s.T().Cleanup(func() { s.Require().NoError(s.cat.DropTable(s.ctx,
ident)) })
+
+ _, err = s.cat.FetchPlanningResult(s.ctx, ident, "missing-plan-id",
rest.FetchPlanningResultOptions{})
+ s.ErrorIs(err, rest.ErrPlanExpired)
+
+ _, err = s.cat.FetchScanTasks(s.ctx, ident,
rest.FetchScanTasksRequest{PlanTask: "missing-plan-task"})
+ s.ErrorIs(err, rest.ErrNoSuchPlanTask)
+}
+
+func (s *RestIntegrationSuite) requireScanPlanningIntegration() {
+ s.T().Helper()
+ if os.Getenv(runIntegrationTestsEnv) != "1" {
+ s.T().Skipf("set %s=1 to run Java REST scan-planning
integration tests", runIntegrationTestsEnv)
+ }
+}
+
+func (s *RestIntegrationSuite) requireJavaScanPlanningCapabilities(cat
*rest.Catalog) {
+ s.T().Helper()
+ s.Require().True(cat.SupportsPlanTableScan(), "Java fixture must
advertise planTableScan")
+ s.Require().True(cat.SupportsFullRemoteScanPlanning(),
+ "Java fixture must advertise plan, poll, cancel, and task-fetch
endpoints")
+}
+
+func cancelPlanningWithTimeout(cat *rest.Catalog, ident table.Identifier,
planID string) error {
+ ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)
+ defer cancel()
+
+ return cat.CancelPlanning(ctx, ident, planID)
+}
+
+func (s *RestIntegrationSuite) createScanPlanningTable(ident table.Identifier)
(*table.Table, string) {
+ s.T().Helper()
+ s.ensureNamespace()
+
+ spec := iceberg.NewPartitionSpec(iceberg.PartitionField{
+ SourceIDs: []int{2},
+ FieldID: 1000,
+ Name: "bar",
+ Transform: iceberg.IdentityTransform{},
+ })
+ tbl, err := s.cat.CreateTable(s.ctx, ident, tableSchemaSimple,
catalog.WithPartitionSpec(&spec))
+ s.Require().NoError(err)
+ s.Require().NotNil(tbl)
+ s.T().Cleanup(func() { s.Require().NoError(s.cat.DropTable(s.ctx,
ident)) })
+
+ arrowSchema, err := table.SchemaToArrowSchema(tableSchemaSimple, nil,
false, false)
+ s.Require().NoError(err)
+ arrowTable, err := array.TableFromJSON(memory.DefaultAllocator,
arrowSchema,
+ []string{`[{"foo":"hello","bar":17,"baz":true}]`})
+ s.Require().NoError(err)
+ defer arrowTable.Release()
+
+ dataPath, err := url.JoinPath(tbl.Location(), "data", "bar=17",
"data.parquet")
+ s.Require().NoError(err)
+ file, err := mustFS(s.T(), tbl).(iceio.WriteFileIO).Create(dataPath)
+ s.Require().NoError(err)
+ s.Require().NoError(pqarrow.WriteTable(arrowTable, file,
arrowTable.NumRows(),
+ nil, pqarrow.DefaultWriterProps()))
+ s.T().Cleanup(func() { s.Require().NoError(mustFS(s.T(),
tbl).Remove(dataPath)) })
+
+ txn := tbl.NewTransaction()
+ s.Require().NoError(txn.AddFiles(s.ctx, []string{dataPath}, nil, false))
+ updated, err := txn.Commit(s.ctx)
+ s.Require().NoError(err)
+ s.Require().NotNil(updated.CurrentSnapshot())
+
+ return updated, dataPath
+}
+
+func (s *RestIntegrationSuite) assertJavaPlanningCredentials(credentials
[]rest.StorageCredential) {
+ s.T().Helper()
+ s.Require().Len(credentials, 1)
+ s.Equal("gcp", credentials[0].Prefix)
+ s.Equal(integrationGCSToken,
credentials[0].Config[integrationGCSTokenKey])
+}
+
+func valueMapByFieldID(s *RestIntegrationSuite, valueMap rawValueMapFixture)
map[int]string {
Review Comment:
Small consistency thing: every other helper in this file is a method on
`*RestIntegrationSuite` (`assertJavaPlanningCredentials` right below is), but
this one takes the suite as its first arg. I'd make it a method — `func (s
*RestIntegrationSuite) valueMapByFieldID(valueMap rawValueMapFixture)
map[int]string` — so call sites read `s.valueMapByFieldID(...)`.
##########
internal/recipe/docker-compose.yml:
##########
@@ -46,7 +46,11 @@ services:
retries: 12
start_period: 30s
rest:
- image: apache/iceberg-rest-fixture:1.10.1
+ # 1.10.1 predates the fixture's scan-planning implementation. Pin the
+ # multi-platform image built from apache/iceberg@b0df3ca so the Java wire
+ # compatibility tests are reproducible even though the released tag is not
+ # available yet.
+ image:
apache/iceberg-rest-fixture:latest@sha256:db8de90b5b7693d4ac334c336f91d9bbe320d7b19f4f514d26de84cdfbcbfe8d
Review Comment:
This is the piece I'd most want to revisit: the shared `rest` service moves
from released 1.10.1 to a digest-pinned build off an unreleased
`apache/iceberg@b0df3ca`, so every existing REST integration test now runs
against a pre-release image. Two risks — a regression in that image shows up as
a failure in some unrelated test with no hint it was the bump, and a
`:latest@sha256` pin with no release tag keeping it alive could get GC'd on
Docker Hub and break CI looking like a flaky pull.
I'd run the scan-planning tests against a second scan-planning-capable
service on its own port and leave `rest` on the released tag. If that's too
heavy for now, at minimum a tracking issue to move to the release tag once
1.11.0 ships, plus a TODO here. wdyt?
##########
catalog/rest/scan_planning_integration_test.go:
##########
@@ -0,0 +1,321 @@
+// 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.
+
+//go:build integration
+
+package rest_test
+
+import (
+ "bytes"
+ "context"
+ "encoding/json"
+ "fmt"
+ stdio "io"
+ "net/http"
+ "net/url"
+ "os"
+ "strings"
+ "sync"
+ "time"
+
+ "github.com/apache/arrow-go/v18/arrow/array"
+ "github.com/apache/arrow-go/v18/arrow/memory"
+ "github.com/apache/arrow-go/v18/parquet/pqarrow"
+ "github.com/apache/iceberg-go"
+ "github.com/apache/iceberg-go/catalog"
+ "github.com/apache/iceberg-go/catalog/rest"
+ iceio "github.com/apache/iceberg-go/io"
+ "github.com/apache/iceberg-go/table"
+)
+
+const (
+ runIntegrationTestsEnv = "RUN_INTEGRATION_TESTS"
+ integrationAccessDelegation = "vended-credentials"
+ integrationAccessDelegationHeader = "X-Iceberg-Access-Delegation"
+ integrationGCSToken = "scan-planning-integration-token"
+ integrationGCSTokenKey = "gcs.oauth2.token"
+)
+
+func (s *RestIntegrationSuite)
TestScanPlanningJavaSynchronousInteroperability() {
+ s.requireScanPlanningIntegration()
+
+ transport := newScanPlanningCaptureTransport()
+ s.T().Cleanup(transport.CloseIdleConnections)
+ planningCatalog, err := rest.NewCatalog(s.ctx,
"scan-planning-java-wire", "http://localhost:8181",
+ rest.WithCustomTransport(transport))
+ s.Require().NoError(err)
+ s.T().Cleanup(func() { s.Require().NoError(planningCatalog.Close()) })
+ s.requireJavaScanPlanningCapabilities(planningCatalog)
+
+ ident := catalog.ToIdentifier(TestNamespaceIdent,
"scan-planning-java-wire")
+ tbl, dataPath := s.createScanPlanningTable(ident)
+
+ filter, err := json.Marshal(iceberg.EqualTo(iceberg.Reference("foo"),
"hello"))
+ s.Require().NoError(err)
+ snapshotID := tbl.CurrentSnapshot().SnapshotID
+ caseSensitive := true
+ useSnapshotSchema := false
+ minRowsRequested := int64(1)
+
+ response, err := planningCatalog.PlanTableScan(s.ctx, ident,
rest.PlanTableScanRequest{
+ AccessDelegation: stringPointer(integrationAccessDelegation),
+ SnapshotID: &snapshotID,
+ Select: []string{"foo", "bar"},
+ Filter: filter,
+ MinRowsRequested: &minRowsRequested,
+ CaseSensitive: &caseSensitive,
+ UseSnapshotSchema: &useSnapshotSchema,
+ StatsFields: []string{"foo", "bar"},
+ })
+ s.Require().NoError(err)
+ s.Require().Equal(rest.PlanStatusCompleted, response.Status)
+ s.Require().NotNil(response.PlanID)
+ s.Require().NotEmpty(*response.PlanID)
+ planID := *response.PlanID
+ planCancelled := false
+ s.T().Cleanup(func() {
+ if planCancelled {
+ return
+ }
+
+ _ = cancelPlanningWithTimeout(planningCatalog, ident, planID)
+ })
+ s.Empty(response.PlanTasks)
+ s.Require().Len(response.FileScanTasks, 1)
+ s.Empty(response.DeleteFiles)
+ s.assertJavaPlanningCredentials(response.StorageCredentials)
+
+ rawResponses := transport.PlanResponses()
+ s.Require().Len(rawResponses, 1)
+ requestHeaders := transport.PlanRequestHeaders()
+ s.Require().Len(requestHeaders, 1)
+ s.Equal(integrationAccessDelegation,
requestHeaders[0].Get(integrationAccessDelegationHeader))
+ raw := parseRawPlanningFixture(s.T(), string(rawResponses[0]))
+ s.Equal("completed", raw.Status)
+ s.Equal(*response.PlanID, raw.PlanID)
+ s.Empty(raw.PlanTasks)
+ s.Require().Len(raw.FileScanTasks, 1)
+ s.Empty(raw.DeleteFiles)
+
+ task := raw.FileScanTasks[0]
+ s.Equal("data", task.DataFile.Content)
+ s.Equal(dataPath, task.DataFile.FilePath)
+ s.Require().Len(task.DataFile.Partition, 1)
+ s.Equal("17", string(task.DataFile.Partition[0]),
+ "Java partitions must remain typed JSON values, not
binary-bound strings")
+ s.JSONEq(`{"type":"eq","term":"foo","value":"hello"}`,
string(task.ResidualFilter))
+ s.Empty(task.DeleteFileReferences)
+
+ lowerBounds := valueMapByFieldID(s, task.DataFile.LowerBounds)
+ upperBounds := valueMapByFieldID(s, task.DataFile.UpperBounds)
+ s.ElementsMatch([]int{1, 2}, task.DataFile.LowerBounds.Keys)
+ s.ElementsMatch([]int{1, 2}, task.DataFile.UpperBounds.Keys)
+ s.Equal("68656C6C6F", lowerBounds[1], "Java string lower bounds must be
uppercase hexadecimal")
+ s.Equal("68656C6C6F", upperBounds[1], "Java string upper bounds must be
uppercase hexadecimal")
+ s.Equal("11000000", lowerBounds[2], "Java int lower bounds must use
Iceberg little-endian binary")
+ s.Equal("11000000", upperBounds[2], "Java int upper bounds must use
Iceberg little-endian binary")
+
+ s.Require().Len(raw.StorageCredentials, 1)
+ s.Equal("gcp", raw.StorageCredentials[0].Prefix)
+ s.Equal(integrationGCSToken,
raw.StorageCredentials[0].Config[integrationGCSTokenKey])
+
+ // The reference fixture retains its synchronous plan state until the
client
+ // releases it, so this also verifies the advertised DELETE route end
to end.
+ s.Require().NoError(cancelPlanningWithTimeout(planningCatalog, ident,
planID))
+ planCancelled = true
+}
+
+func (s *RestIntegrationSuite) TestScanPlanningJavaErrorTypes() {
+ s.requireScanPlanningIntegration()
+ s.requireJavaScanPlanningCapabilities(s.cat)
+ s.ensureNamespace()
+ // The published fixture defaults to synchronous inline planning and
exposes
+ // no container setting for async planning or a smaller plan-task page
size.
+ // The not-found cases still exercise the live GET and POST routes and
their
+ // Java error models; deterministic successful polling/fanout remains
covered
+ // by planfake until the reference image exposes those controls.
+
+ missingTable := catalog.ToIdentifier(TestNamespaceIdent,
"missing-scan-planning-table")
+ _, err := s.cat.PlanTableScan(s.ctx, missingTable,
rest.PlanTableScanRequest{})
+ s.ErrorIs(err, catalog.ErrNoSuchTable)
+
+ ident := catalog.ToIdentifier(TestNamespaceIdent,
"scan-planning-java-errors")
+ tbl, err := s.cat.CreateTable(s.ctx, ident, tableSchemaSimple)
+ s.Require().NoError(err)
+ s.Require().NotNil(tbl)
+ s.T().Cleanup(func() { s.Require().NoError(s.cat.DropTable(s.ctx,
ident)) })
+
+ _, err = s.cat.FetchPlanningResult(s.ctx, ident, "missing-plan-id",
rest.FetchPlanningResultOptions{})
+ s.ErrorIs(err, rest.ErrPlanExpired)
+
+ _, err = s.cat.FetchScanTasks(s.ctx, ident,
rest.FetchScanTasksRequest{PlanTask: "missing-plan-task"})
+ s.ErrorIs(err, rest.ErrNoSuchPlanTask)
+}
+
+func (s *RestIntegrationSuite) requireScanPlanningIntegration() {
+ s.T().Helper()
+ if os.Getenv(runIntegrationTestsEnv) != "1" {
+ s.T().Skipf("set %s=1 to run Java REST scan-planning
integration tests", runIntegrationTestsEnv)
+ }
+}
+
+func (s *RestIntegrationSuite) requireJavaScanPlanningCapabilities(cat
*rest.Catalog) {
+ s.T().Helper()
+ s.Require().True(cat.SupportsPlanTableScan(), "Java fixture must
advertise planTableScan")
Review Comment:
If someone opts in with `RUN_INTEGRATION_TESTS=1` but happens to have the
old released image up, this `s.Require().True` fails hard instead of skipping —
which reads as a broken test rather than "wrong image".
`requireScanPlanningIntegration` already skips cleanly; I'd have this one
`Skipf` too when the server doesn't advertise the endpoints, so the two guards
behave consistently.
##########
catalog/rest/scan_planning_integration_test.go:
##########
@@ -0,0 +1,321 @@
+// 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.
+
+//go:build integration
+
+package rest_test
+
+import (
+ "bytes"
+ "context"
+ "encoding/json"
+ "fmt"
+ stdio "io"
+ "net/http"
+ "net/url"
+ "os"
+ "strings"
+ "sync"
+ "time"
+
+ "github.com/apache/arrow-go/v18/arrow/array"
+ "github.com/apache/arrow-go/v18/arrow/memory"
+ "github.com/apache/arrow-go/v18/parquet/pqarrow"
+ "github.com/apache/iceberg-go"
+ "github.com/apache/iceberg-go/catalog"
+ "github.com/apache/iceberg-go/catalog/rest"
+ iceio "github.com/apache/iceberg-go/io"
+ "github.com/apache/iceberg-go/table"
+)
+
+const (
+ runIntegrationTestsEnv = "RUN_INTEGRATION_TESTS"
+ integrationAccessDelegation = "vended-credentials"
+ integrationAccessDelegationHeader = "X-Iceberg-Access-Delegation"
+ integrationGCSToken = "scan-planning-integration-token"
+ integrationGCSTokenKey = "gcs.oauth2.token"
+)
+
+func (s *RestIntegrationSuite)
TestScanPlanningJavaSynchronousInteroperability() {
+ s.requireScanPlanningIntegration()
+
+ transport := newScanPlanningCaptureTransport()
+ s.T().Cleanup(transport.CloseIdleConnections)
+ planningCatalog, err := rest.NewCatalog(s.ctx,
"scan-planning-java-wire", "http://localhost:8181",
+ rest.WithCustomTransport(transport))
+ s.Require().NoError(err)
+ s.T().Cleanup(func() { s.Require().NoError(planningCatalog.Close()) })
+ s.requireJavaScanPlanningCapabilities(planningCatalog)
+
+ ident := catalog.ToIdentifier(TestNamespaceIdent,
"scan-planning-java-wire")
+ tbl, dataPath := s.createScanPlanningTable(ident)
+
+ filter, err := json.Marshal(iceberg.EqualTo(iceberg.Reference("foo"),
"hello"))
+ s.Require().NoError(err)
+ snapshotID := tbl.CurrentSnapshot().SnapshotID
+ caseSensitive := true
+ useSnapshotSchema := false
+ minRowsRequested := int64(1)
+
+ response, err := planningCatalog.PlanTableScan(s.ctx, ident,
rest.PlanTableScanRequest{
+ AccessDelegation: stringPointer(integrationAccessDelegation),
+ SnapshotID: &snapshotID,
+ Select: []string{"foo", "bar"},
+ Filter: filter,
+ MinRowsRequested: &minRowsRequested,
+ CaseSensitive: &caseSensitive,
+ UseSnapshotSchema: &useSnapshotSchema,
+ StatsFields: []string{"foo", "bar"},
+ })
+ s.Require().NoError(err)
+ s.Require().Equal(rest.PlanStatusCompleted, response.Status)
+ s.Require().NotNil(response.PlanID)
+ s.Require().NotEmpty(*response.PlanID)
+ planID := *response.PlanID
+ planCancelled := false
+ s.T().Cleanup(func() {
+ if planCancelled {
+ return
+ }
+
+ _ = cancelPlanningWithTimeout(planningCatalog, ident, planID)
+ })
+ s.Empty(response.PlanTasks)
+ s.Require().Len(response.FileScanTasks, 1)
+ s.Empty(response.DeleteFiles)
+ s.assertJavaPlanningCredentials(response.StorageCredentials)
+
+ rawResponses := transport.PlanResponses()
+ s.Require().Len(rawResponses, 1)
+ requestHeaders := transport.PlanRequestHeaders()
+ s.Require().Len(requestHeaders, 1)
+ s.Equal(integrationAccessDelegation,
requestHeaders[0].Get(integrationAccessDelegationHeader))
+ raw := parseRawPlanningFixture(s.T(), string(rawResponses[0]))
+ s.Equal("completed", raw.Status)
+ s.Equal(*response.PlanID, raw.PlanID)
+ s.Empty(raw.PlanTasks)
+ s.Require().Len(raw.FileScanTasks, 1)
+ s.Empty(raw.DeleteFiles)
+
+ task := raw.FileScanTasks[0]
+ s.Equal("data", task.DataFile.Content)
+ s.Equal(dataPath, task.DataFile.FilePath)
+ s.Require().Len(task.DataFile.Partition, 1)
+ s.Equal("17", string(task.DataFile.Partition[0]),
+ "Java partitions must remain typed JSON values, not
binary-bound strings")
+ s.JSONEq(`{"type":"eq","term":"foo","value":"hello"}`,
string(task.ResidualFilter))
+ s.Empty(task.DeleteFileReferences)
+
+ lowerBounds := valueMapByFieldID(s, task.DataFile.LowerBounds)
+ upperBounds := valueMapByFieldID(s, task.DataFile.UpperBounds)
+ s.ElementsMatch([]int{1, 2}, task.DataFile.LowerBounds.Keys)
+ s.ElementsMatch([]int{1, 2}, task.DataFile.UpperBounds.Keys)
+ s.Equal("68656C6C6F", lowerBounds[1], "Java string lower bounds must be
uppercase hexadecimal")
+ s.Equal("68656C6C6F", upperBounds[1], "Java string upper bounds must be
uppercase hexadecimal")
+ s.Equal("11000000", lowerBounds[2], "Java int lower bounds must use
Iceberg little-endian binary")
+ s.Equal("11000000", upperBounds[2], "Java int upper bounds must use
Iceberg little-endian binary")
+
+ s.Require().Len(raw.StorageCredentials, 1)
+ s.Equal("gcp", raw.StorageCredentials[0].Prefix)
Review Comment:
Worth a one-line comment here: the fixture vends these creds under prefix
`"gcp"`, but GCSFileIO (Java and Go alike) only matches prefixes starting with
`"gs"`, so these creds wouldn't actually resolve for a real `gs://` path today.
That's a known fixture quirk, not something this PR introduces — pinning
`"gcp"` is fine as a canary that'll trip when the fixture is fixed, but a
comment saves the next reader from reading it as a bug and "correcting" it to
`"gs"`.
##########
catalog/rest/scan_planning_integration_test.go:
##########
@@ -0,0 +1,321 @@
+// 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.
+
+//go:build integration
+
+package rest_test
+
+import (
+ "bytes"
+ "context"
+ "encoding/json"
+ "fmt"
+ stdio "io"
+ "net/http"
+ "net/url"
+ "os"
+ "strings"
+ "sync"
+ "time"
+
+ "github.com/apache/arrow-go/v18/arrow/array"
+ "github.com/apache/arrow-go/v18/arrow/memory"
+ "github.com/apache/arrow-go/v18/parquet/pqarrow"
+ "github.com/apache/iceberg-go"
+ "github.com/apache/iceberg-go/catalog"
+ "github.com/apache/iceberg-go/catalog/rest"
+ iceio "github.com/apache/iceberg-go/io"
+ "github.com/apache/iceberg-go/table"
+)
+
+const (
+ runIntegrationTestsEnv = "RUN_INTEGRATION_TESTS"
+ integrationAccessDelegation = "vended-credentials"
+ integrationAccessDelegationHeader = "X-Iceberg-Access-Delegation"
+ integrationGCSToken = "scan-planning-integration-token"
+ integrationGCSTokenKey = "gcs.oauth2.token"
+)
+
+func (s *RestIntegrationSuite)
TestScanPlanningJavaSynchronousInteroperability() {
+ s.requireScanPlanningIntegration()
+
+ transport := newScanPlanningCaptureTransport()
+ s.T().Cleanup(transport.CloseIdleConnections)
+ planningCatalog, err := rest.NewCatalog(s.ctx,
"scan-planning-java-wire", "http://localhost:8181",
+ rest.WithCustomTransport(transport))
+ s.Require().NoError(err)
+ s.T().Cleanup(func() { s.Require().NoError(planningCatalog.Close()) })
+ s.requireJavaScanPlanningCapabilities(planningCatalog)
+
+ ident := catalog.ToIdentifier(TestNamespaceIdent,
"scan-planning-java-wire")
+ tbl, dataPath := s.createScanPlanningTable(ident)
+
+ filter, err := json.Marshal(iceberg.EqualTo(iceberg.Reference("foo"),
"hello"))
+ s.Require().NoError(err)
+ snapshotID := tbl.CurrentSnapshot().SnapshotID
+ caseSensitive := true
+ useSnapshotSchema := false
+ minRowsRequested := int64(1)
+
+ response, err := planningCatalog.PlanTableScan(s.ctx, ident,
rest.PlanTableScanRequest{
+ AccessDelegation: stringPointer(integrationAccessDelegation),
+ SnapshotID: &snapshotID,
+ Select: []string{"foo", "bar"},
+ Filter: filter,
+ MinRowsRequested: &minRowsRequested,
+ CaseSensitive: &caseSensitive,
+ UseSnapshotSchema: &useSnapshotSchema,
+ StatsFields: []string{"foo", "bar"},
+ })
+ s.Require().NoError(err)
+ s.Require().Equal(rest.PlanStatusCompleted, response.Status)
+ s.Require().NotNil(response.PlanID)
+ s.Require().NotEmpty(*response.PlanID)
+ planID := *response.PlanID
+ planCancelled := false
+ s.T().Cleanup(func() {
+ if planCancelled {
+ return
+ }
+
+ _ = cancelPlanningWithTimeout(planningCatalog, ident, planID)
+ })
+ s.Empty(response.PlanTasks)
+ s.Require().Len(response.FileScanTasks, 1)
+ s.Empty(response.DeleteFiles)
+ s.assertJavaPlanningCredentials(response.StorageCredentials)
+
+ rawResponses := transport.PlanResponses()
+ s.Require().Len(rawResponses, 1)
+ requestHeaders := transport.PlanRequestHeaders()
+ s.Require().Len(requestHeaders, 1)
+ s.Equal(integrationAccessDelegation,
requestHeaders[0].Get(integrationAccessDelegationHeader))
+ raw := parseRawPlanningFixture(s.T(), string(rawResponses[0]))
+ s.Equal("completed", raw.Status)
+ s.Equal(*response.PlanID, raw.PlanID)
+ s.Empty(raw.PlanTasks)
+ s.Require().Len(raw.FileScanTasks, 1)
+ s.Empty(raw.DeleteFiles)
+
+ task := raw.FileScanTasks[0]
+ s.Equal("data", task.DataFile.Content)
+ s.Equal(dataPath, task.DataFile.FilePath)
+ s.Require().Len(task.DataFile.Partition, 1)
+ s.Equal("17", string(task.DataFile.Partition[0]),
+ "Java partitions must remain typed JSON values, not
binary-bound strings")
+ s.JSONEq(`{"type":"eq","term":"foo","value":"hello"}`,
string(task.ResidualFilter))
+ s.Empty(task.DeleteFileReferences)
+
+ lowerBounds := valueMapByFieldID(s, task.DataFile.LowerBounds)
+ upperBounds := valueMapByFieldID(s, task.DataFile.UpperBounds)
+ s.ElementsMatch([]int{1, 2}, task.DataFile.LowerBounds.Keys)
+ s.ElementsMatch([]int{1, 2}, task.DataFile.UpperBounds.Keys)
+ s.Equal("68656C6C6F", lowerBounds[1], "Java string lower bounds must be
uppercase hexadecimal")
+ s.Equal("68656C6C6F", upperBounds[1], "Java string upper bounds must be
uppercase hexadecimal")
+ s.Equal("11000000", lowerBounds[2], "Java int lower bounds must use
Iceberg little-endian binary")
+ s.Equal("11000000", upperBounds[2], "Java int upper bounds must use
Iceberg little-endian binary")
+
+ s.Require().Len(raw.StorageCredentials, 1)
+ s.Equal("gcp", raw.StorageCredentials[0].Prefix)
+ s.Equal(integrationGCSToken,
raw.StorageCredentials[0].Config[integrationGCSTokenKey])
+
+ // The reference fixture retains its synchronous plan state until the
client
+ // releases it, so this also verifies the advertised DELETE route end
to end.
+ s.Require().NoError(cancelPlanningWithTimeout(planningCatalog, ident,
planID))
+ planCancelled = true
+}
+
+func (s *RestIntegrationSuite) TestScanPlanningJavaErrorTypes() {
+ s.requireScanPlanningIntegration()
+ s.requireJavaScanPlanningCapabilities(s.cat)
+ s.ensureNamespace()
+ // The published fixture defaults to synchronous inline planning and
exposes
+ // no container setting for async planning or a smaller plan-task page
size.
+ // The not-found cases still exercise the live GET and POST routes and
their
+ // Java error models; deterministic successful polling/fanout remains
covered
+ // by planfake until the reference image exposes those controls.
+
+ missingTable := catalog.ToIdentifier(TestNamespaceIdent,
"missing-scan-planning-table")
+ _, err := s.cat.PlanTableScan(s.ctx, missingTable,
rest.PlanTableScanRequest{})
+ s.ErrorIs(err, catalog.ErrNoSuchTable)
+
+ ident := catalog.ToIdentifier(TestNamespaceIdent,
"scan-planning-java-errors")
+ tbl, err := s.cat.CreateTable(s.ctx, ident, tableSchemaSimple)
+ s.Require().NoError(err)
+ s.Require().NotNil(tbl)
+ s.T().Cleanup(func() { s.Require().NoError(s.cat.DropTable(s.ctx,
ident)) })
+
+ _, err = s.cat.FetchPlanningResult(s.ctx, ident, "missing-plan-id",
rest.FetchPlanningResultOptions{})
+ s.ErrorIs(err, rest.ErrPlanExpired)
+
+ _, err = s.cat.FetchScanTasks(s.ctx, ident,
rest.FetchScanTasksRequest{PlanTask: "missing-plan-task"})
+ s.ErrorIs(err, rest.ErrNoSuchPlanTask)
+}
+
+func (s *RestIntegrationSuite) requireScanPlanningIntegration() {
+ s.T().Helper()
+ if os.Getenv(runIntegrationTestsEnv) != "1" {
+ s.T().Skipf("set %s=1 to run Java REST scan-planning
integration tests", runIntegrationTestsEnv)
+ }
+}
+
+func (s *RestIntegrationSuite) requireJavaScanPlanningCapabilities(cat
*rest.Catalog) {
+ s.T().Helper()
+ s.Require().True(cat.SupportsPlanTableScan(), "Java fixture must
advertise planTableScan")
+ s.Require().True(cat.SupportsFullRemoteScanPlanning(),
+ "Java fixture must advertise plan, poll, cancel, and task-fetch
endpoints")
+}
+
+func cancelPlanningWithTimeout(cat *rest.Catalog, ident table.Identifier,
planID string) error {
+ ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)
+ defer cancel()
+
+ return cat.CancelPlanning(ctx, ident, planID)
+}
+
+func (s *RestIntegrationSuite) createScanPlanningTable(ident table.Identifier)
(*table.Table, string) {
+ s.T().Helper()
+ s.ensureNamespace()
+
+ spec := iceberg.NewPartitionSpec(iceberg.PartitionField{
+ SourceIDs: []int{2},
+ FieldID: 1000,
+ Name: "bar",
+ Transform: iceberg.IdentityTransform{},
+ })
+ tbl, err := s.cat.CreateTable(s.ctx, ident, tableSchemaSimple,
catalog.WithPartitionSpec(&spec))
+ s.Require().NoError(err)
+ s.Require().NotNil(tbl)
+ s.T().Cleanup(func() { s.Require().NoError(s.cat.DropTable(s.ctx,
ident)) })
+
+ arrowSchema, err := table.SchemaToArrowSchema(tableSchemaSimple, nil,
false, false)
+ s.Require().NoError(err)
+ arrowTable, err := array.TableFromJSON(memory.DefaultAllocator,
arrowSchema,
+ []string{`[{"foo":"hello","bar":17,"baz":true}]`})
+ s.Require().NoError(err)
+ defer arrowTable.Release()
+
+ dataPath, err := url.JoinPath(tbl.Location(), "data", "bar=17",
"data.parquet")
+ s.Require().NoError(err)
+ file, err := mustFS(s.T(), tbl).(iceio.WriteFileIO).Create(dataPath)
+ s.Require().NoError(err)
+ s.Require().NoError(pqarrow.WriteTable(arrowTable, file,
arrowTable.NumRows(),
+ nil, pqarrow.DefaultWriterProps()))
+ s.T().Cleanup(func() { s.Require().NoError(mustFS(s.T(),
tbl).Remove(dataPath)) })
+
+ txn := tbl.NewTransaction()
+ s.Require().NoError(txn.AddFiles(s.ctx, []string{dataPath}, nil, false))
+ updated, err := txn.Commit(s.ctx)
+ s.Require().NoError(err)
+ s.Require().NotNil(updated.CurrentSnapshot())
+
+ return updated, dataPath
+}
+
+func (s *RestIntegrationSuite) assertJavaPlanningCredentials(credentials
[]rest.StorageCredential) {
+ s.T().Helper()
+ s.Require().Len(credentials, 1)
+ s.Equal("gcp", credentials[0].Prefix)
+ s.Equal(integrationGCSToken,
credentials[0].Config[integrationGCSTokenKey])
+}
+
+func valueMapByFieldID(s *RestIntegrationSuite, valueMap rawValueMapFixture)
map[int]string {
+ s.T().Helper()
+ s.Require().Len(valueMap.Values, len(valueMap.Keys))
+
+ values := make(map[int]string, len(valueMap.Keys))
+ for i, fieldID := range valueMap.Keys {
+ values[fieldID] = valueMap.Values[i]
+ }
+
+ return values
+}
+
+func stringPointer(value string) *string {
+ return &value
+}
+
+type scanPlanningCaptureTransport struct {
+ base *http.Transport
+
+ mu sync.Mutex
+ planRequests []http.Header
+ planResponses [][]byte
+}
+
+func newScanPlanningCaptureTransport() *scanPlanningCaptureTransport {
+ return &scanPlanningCaptureTransport{base:
http.DefaultTransport.(*http.Transport).Clone()}
Review Comment:
`http.DefaultTransport.(*http.Transport)` is unguarded — if anything in the
test binary has swapped `DefaultTransport` for a non-`*http.Transport`, this
panics with no test-failure record and takes the whole binary down with it.
Since this constructor doesn't have `s`/`t` handy, the cleanest fix is to
build a fresh `&http.Transport{}` instead of cloning the default — you sidestep
the assertion entirely, and the capture transport doesn't really need
`DefaultTransport`'s config.
##########
internal/recipe/docker-compose.yml:
##########
@@ -59,6 +63,10 @@ services:
- CATALOG_WAREHOUSE=s3://warehouse/
- CATALOG_IO__IMPL=org.apache.iceberg.aws.s3.S3FileIO
- CATALOG_S3_ENDPOINT=http://minio:9000
+ - CATALOG_INCLUDE__CREDENTIALS=true
Review Comment:
With include-credentials on, the fixture now injects `gcs.oauth2.token` into
every `LoadTableResult`, so the shared fixture state isn't minimal anymore. Go
ignores the property today, but any future test asserting an exact table-config
map would trip on it. This is the same thread as isolating the scan-planning
fixture above — if that service gets split out, this setting rides along with
it and stops touching the shared tests.
--
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]