You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by "rexminnis (via GitHub)" <gi...@apache.org> on 2026/04/17 07:31:30 UTC
[PR] OpenAPI: Support CATALOG_NAME env var in REST fixture [iceberg]
rexminnis opened a new pull request, #16007:
URL: https://github.com/apache/iceberg/pull/16007
## What changes are included in this PR?
Adds `CATALOG_NAME` environment variable support to the REST catalog test
fixture, allowing users to override the backend catalog name without the
unintuitive `CATALOG_CATALOG_NAME=...` form required by the existing
`CATALOG_*` prefix translation.
- `RESTCatalogServer` resolves `CATALOG_NAME` explicitly before the standard
property lookup, using `putIfAbsent` so any caller-provided `catalog.name`
property still wins.
- `docker/iceberg-rest-fixture/README.md` gains a Configuration section
documenting `CATALOG_NAME` and the general `CATALOG_*` env-var scheme.
- New `RESTCatalogServerTest` exercises the helper with 4 cases: env set,
property-wins-over-env, env missing, env empty.
Closes #14972.
## Are these changes tested?
Yes — new `RESTCatalogServerTest` runs as part of `:iceberg-open-api:test`.
## Are there any user-facing changes?
No behavior change when `CATALOG_NAME` is unset — default remains
`rest_backend`. Users can now set `-e CATALOG_NAME=mycatalog` on the
`apache/iceberg-rest-fixture` container to change the catalog name served
by the fixture.
--
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: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
Re: [PR] Docs: Document CATALOG_* env vars in iceberg-rest-fixture README [iceberg]
Posted by "kevinjqliu (via GitHub)" <gi...@apache.org>.
kevinjqliu merged PR #16007:
URL: https://github.com/apache/iceberg/pull/16007
--
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: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
Re: [PR] OpenAPI: Support CATALOG_NAME env var in REST fixture [iceberg]
Posted by "rexminnis (via GitHub)" <gi...@apache.org>.
rexminnis commented on PR #16007:
URL: https://github.com/apache/iceberg/pull/16007#issuecomment-4287656111
Gentle bump — CI is green across all 13 checks and the diff is small (3 files, +116/-0). Closes #14972.
Summary for anyone picking this up cold:
- `RESTCatalogServer` resolves `CATALOG_NAME` explicitly before the existing `CATALOG_*` prefix translation, using `putIfAbsent` so any caller-supplied `catalog.name` still wins.
- Lets users set the backend catalog name via an intuitive `CATALOG_NAME=foo` rather than the current double-prefixed `CATALOG_CATALOG_NAME=foo`.
- README updated; test fixture unchanged in shape.
@nastra @danielcweeks — you've both touched this file recently; would appreciate a review when you have a moment.
--
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: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
Re: [PR] OpenAPI: Support CATALOG_NAME env var in REST fixture [iceberg]
Posted by "kevinjqliu (via GitHub)" <gi...@apache.org>.
kevinjqliu commented on PR #16007:
URL: https://github.com/apache/iceberg/pull/16007#issuecomment-4411046486
I closed the upstream issue #14972, `CATALOG_CATALOG_NAME=mywarehouse` works to override the `catalog.name`.
I dont think we need `CATALOG_WAREHOUSE` since it just extra complexity.
I do think we can do a better job documenting the env vars; I like the changes in `docker/iceberg-rest-fixture/README.md`
I get a feeling that this pr is agent-assisted, if so please check out our guidelines for such contributions, https://iceberg.apache.org/contribute/#guidelines-for-ai-assisted-contributions
--
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: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
Re: [PR] OpenAPI: Support CATALOG_NAME env var in REST fixture [iceberg]
Posted by "rexminnis (via GitHub)" <gi...@apache.org>.
rexminnis commented on code in PR #16007:
URL: https://github.com/apache/iceberg/pull/16007#discussion_r3098789177
##########
open-api/src/testFixtures/java/org/apache/iceberg/rest/RESTCatalogServer.java:
##########
@@ -98,6 +103,8 @@ private CatalogContext initializeBackendCatalog() throws IOException {
LOG.info("No warehouse location set. Defaulting to temp location: {}", warehouseLocation);
}
+ resolveCatalogNameFromEnv(catalogProperties, System.getenv());
Review Comment:
Thanks for the review, @ebyhr.
`environmentCatalogConfig()` turns `CATALOG_NAME` into the property key `name`, not `catalog.name`:
```
CATALOG_NAME
→ strip "CATALOG_" prefix → "NAME"
→ "__" → "-" → "NAME"
→ "_" → "." → "NAME" (no underscores left)
→ lowerCase → "name"
```
But `RESTCatalogServer` reads property `catalog.name` (`CATALOG_NAME` constant on line 48 = `"catalog.name"`). So env `CATALOG_NAME=foo` ends up as property `name`, which is ignored, and the backend catalog stays `rest_backend`.
To set `catalog.name` via the existing scheme, a user has to set `CATALOG_CATALOG_NAME=foo` — which #14972 calls out as unintuitive. This PR adds the shorter `CATALOG_NAME` env var that users naturally try first.
Happy to rework if you'd prefer a different shape — e.g., just documenting `CATALOG_CATALOG_NAME` without a new code path — but the reporter explicitly asked for a simpler env var.
--
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: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
Re: [PR] OpenAPI: Support CATALOG_NAME env var in REST fixture [iceberg]
Posted by "ebyhr (via GitHub)" <gi...@apache.org>.
ebyhr commented on code in PR #16007:
URL: https://github.com/apache/iceberg/pull/16007#discussion_r3098753344
##########
open-api/src/testFixtures/java/org/apache/iceberg/rest/RESTCatalogServer.java:
##########
@@ -98,6 +103,8 @@ private CatalogContext initializeBackendCatalog() throws IOException {
LOG.info("No warehouse location set. Defaulting to temp location: {}", warehouseLocation);
}
+ resolveCatalogNameFromEnv(catalogProperties, System.getenv());
Review Comment:
Why do we need this change? The `catalogProperties` comes from [RCKUtils.environmentCatalogConfig()](https://github.com/apache/iceberg/blob/dde712ec9ed6c9d28183ee4615d50f97b246af5d/open-api/src/testFixtures/java/org/apache/iceberg/rest/RCKUtils.java#L64). I expect it contains `CATALOG_NAME` environment variable.
--
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: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
Re: [PR] Docs: Document CATALOG_* env vars in iceberg-rest-fixture README [iceberg]
Posted by "rexminnis (via GitHub)" <gi...@apache.org>.
rexminnis commented on PR #16007:
URL: https://github.com/apache/iceberg/pull/16007#issuecomment-4411951651
@ebyhr — circling back on your earlier "why do we need this change?" question. With #14972 closed and the code path dropped, this PR is now docs-only: it documents the existing `CATALOG_*` translation behavior so it's discoverable without reading `RCKUtils.environmentCatalogConfig`. Would appreciate a fresh look at the README diff when you have a moment.
--
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: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
Re: [PR] OpenAPI: Support CATALOG_NAME env var in REST fixture [iceberg]
Posted by "rexminnis (via GitHub)" <gi...@apache.org>.
rexminnis commented on code in PR #16007:
URL: https://github.com/apache/iceberg/pull/16007#discussion_r3193452441
##########
open-api/src/testFixtures/java/org/apache/iceberg/rest/RESTCatalogServer.java:
##########
@@ -98,6 +103,8 @@ private CatalogContext initializeBackendCatalog() throws IOException {
LOG.info("No warehouse location set. Defaulting to temp location: {}", warehouseLocation);
}
+ resolveCatalogNameFromEnv(catalogProperties, System.getenv());
Review Comment:
Hi @ebyhr — gentle nudge here. To recap my earlier reply: RCKUtils.environmentCatalogConfig() transforms CATALOG_NAME into the property key name (it strips the CATALOG_ prefix and lowercases what's left,
with no underscores remaining). The downstream PropertyUtil.propertyAsString(catalogProperties, "catalog.name", CATALOG_NAME_DEFAULT) lookup is for catalog.name, so the env var silently falls back to the
rest_backend default. The change here just bridges that one mismatch by lifting CATALOG_NAME env → catalog.name property before the lookup; everything else (CATALOG_* → arbitrary catalog properties via the
existing transform) is untouched.
Does that resolve the question, or would you prefer a different approach (e.g., teaching environmentCatalogConfig itself to special-case CATALOG_NAME)? Happy to update either way. CI is green and the change is small (8 lines + a test).
--
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: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
Re: [PR] OpenAPI: Support CATALOG_NAME env var in REST fixture [iceberg]
Posted by "rexminnis (via GitHub)" <gi...@apache.org>.
rexminnis commented on PR #16007:
URL: https://github.com/apache/iceberg/pull/16007#issuecomment-4411934436
Thanks @kevinjqliu — agreed on closing #14972; the existing `CATALOG_CATALOG_NAME=…` form works and a parallel code path isn't worth the complexity. I'll drop the Java change and the new test.
The docs aren't introducing `CATALOG_WAREHOUSE` as a new variable; it already works via the standard `CATALOG_*` prefix translation. The README spells out the mapping so first-time users don't have to read source.
Per the project's [AI-assisted contribution guidelines](https://iceberg.apache.org/contribute/#guidelines-for-ai-assisted-contributions): yes, AI-assisted (draft + test scaffolding); the contribution came from a real interop pain point with the fixture, I understand the `RCKUtils.environmentCatalogConfig` translation path end-to-end, and I reviewed/ran the changes locally. Force-push incoming with the docs-only diff.
--
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: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org