GCP: Avoid redundant namespace existence check in removeProperties
- Dominant language
- Java
- Stars
- 9.2k
- Forks
- 3.5k
- Avg merge
- 2d 11h
- Merged PRs (30d)
- 132
Description
**Apache Iceberg version**
main @ 035fc1e40
**Query engine**
N/A — catalog-level, engine-agnostic
**Please describe the bug**
`BigQueryMetastoreCatalog.removeProperties()` sends two BigQuery API GET requests where one suffices. It calls `namespaceExists()` (`bigquery/src/main/java/org/apache/iceberg/gcp/bigquery/BigQueryMetastoreCatalog.java` line 270, via `loadNamespaceMetadata()` → `client.load()`) before delegating to `client.removeParameters()`, but `BigQueryMetastoreClientImpl.removeParameters()` (`BigQueryMetastoreClientImpl.java` line 266) already performs the same existence check internally with its own `load()` call. The sibling method `setProperties()` (line 265) calls `client.setParameters()` only, with a single internal `load()`. `GlueCatalog.removeProperties()` and `HiveCatalog.removeProperties()` both check existence exactly once, matching their own `setProperties()`. Only the BigQuery implementation performs the redundant round trip.
**Steps to reproduce**
Call `catalog.removeProperties(existingNamespace, properties)` on a `BigQueryMetastoreCatalog` and observe two `client.load()`/GET calls, versus one for `setProperties()` with the same namespace.
**Additional context**
Fix: drop the `namespaceExists()` pre-check; `client.removeParameters()`'s internal check already covers it.
Contributor guide
Research direction
Start in bigquery/src/main/java/org/apache/iceberg/gcp/bigquery/BigQueryMetastoreCatalog.java at removeProperties(), then inspect BigQueryMetastoreClientImpl.java at removeParameters() and compare setProperties(). Remove the redundant pre-check so removing properties from an existing namespace makes one client.load()/GET call, matching setProperties() and the sibling catalog behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- gcp, java
- Domain
- databases
- Issue type
- Bug
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 88/100