thswlsqls opened a new pull request, #17061:
URL: https://github.com/apache/iceberg/pull/17061

   
   Closes #17059
   
   ## Summary
   
   - `BigQueryMetastoreCatalog.removeProperties()` checked namespace existence 
via `namespaceExists()` (`client.load()`) before calling 
`client.removeParameters()`, which already performs the same existence check 
internally — doubling the BigQuery API GET requests.
   - Removes the redundant pre-check; `removeProperties()` now delegates 
directly to `client.removeParameters()`, matching `setProperties()` and the 
parity pattern in `GlueCatalog`/`HiveCatalog`, both of which check existence 
exactly once.
   - Behavior change: calling `removeProperties()` with an empty `properties` 
set on a namespace that does not exist now returns `false` instead of throwing 
`NoSuchNamespaceException`, because the `isEmpty()` check now runs before any 
existence check. `SupportsNamespaces.removeProperties()` documents this 
exception as optional, so this is not a contract violation.
   
   ## Testing done
   
   - Added 
`TestBigQueryMetastoreCatalog#removePropertiesChecksNamespaceExistenceOnlyOnce` 
verifying `client.load()` is called exactly once (via a Mockito spy on 
`FakeBigQueryMetastoreClient`).
   - Added 
`TestBigQueryMetastoreCatalog#removePropertiesPropagatesNoSuchNamespaceException`
 verifying the exception thrown by `client.removeParameters()` still propagates.
   - Added 
`TestBigQueryMetastoreCatalog#removePropertiesReturnsFalseForEmptyPropertiesWithoutCallingClient`
 covering the documented behavior change.
   - `./gradlew :iceberg-bigquery:check` — 126 tests passed (3 new + 123 
existing), 0 failures.
   
   
   


-- 
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]

Reply via email to