Revanth14 commented on code in PR #1213: URL: https://github.com/apache/iceberg-go/pull/1213#discussion_r3449143531
########## catalog/rest/scan_planning.go: ########## @@ -0,0 +1,211 @@ +// 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. + +// This file is a PROPOSED public API surface for REST server-side scan +// planning (apache/iceberg-go#1178). The bodies are intentionally +// unimplemented; the file exists so the REST surface can be reviewed as Go. +// Endpoint capability discovery (Endpoint, SupportsEndpoint) lands separately +// in the Phase 0 PR and is intentionally not redeclared here. + +package rest + +import ( + "context" + "encoding/json" + "fmt" + "time" + + "github.com/apache/iceberg-go/table" +) + +// Compile-time proof that the REST catalog satisfies the table planner seam. +var _ table.ScanPlanner = (*Catalog)(nil) Review Comment: Agreed. It’s wired concretely now. I went with a third option, lighter than the two listed: `table.New` type-asserts the catalog it already receives to `ScanPlanner` and stores it in an unexported `Table.planner`. `rest.tableFromResponse` passes the `*Catalog`, and `*Catalog` satisfies `ScanPlanner` per the compile-time assertion here, so REST tables get a planner while non-REST catalogs leave it nil and keep local planning. That avoids a `table.New` signature change and avoids adding a `ScanPlanner()` accessor to the catalog/IO seam. The catalog already is the planner, so the type assertion is enough. This PR is still behavior-preserving because nothing reads `planner` until scanner delegation lands. The remaining scanner-delegation work is `Scan.PlanFiles` resolving `planningMode` and deciding whether to call `planner.PlanFiles` or stay local. -- 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]
