laskoviymishka commented on code in PR #3106:
URL: https://github.com/apache/iceberg-rust/pull/3106#discussion_r4756533534
##########
crates/catalog/rest/src/catalog.rs:
##########
@@ -1344,7 +991,7 @@ impl SessionCatalog for RestSessionCatalog {
let config = response
.config
.into_iter()
- .chain(self.user_config.props.clone())
+ .chain(self.props.clone())
Review Comment:
Could we keep the raw user `warehouse` out of this chain?
[`load_file_io`](https://github.com/apache/iceberg-rust/blob/2f4084fae8baed21e58e202702979102104508aa/crates/catalog/rest/src/catalog.rs#L634-L643)
starts from `client.props`, which already holds the server override, and
extends this map last, so the client's value wins. `main` [stripped `uri` and
`warehouse`](https://github.com/apache/iceberg-rust/blob/3cef7b693e53a3f8c31c9ee1172de298546a8969/crates/catalog/rest/src/catalog.rs#L1866-L1871)
from these props. With `warehouse` overridden in `/v1/config`,
`register_table` gets `client-logical` from `file_io().config()` at this head
and `s3://iceberg-catalog` on `main`.
The same chain is in `load_table` and `register_table`. Could we add a test
through one of those paths? The new test calls `load_file_io` directly.
##########
crates/catalog/rest/src/catalog.rs:
##########
@@ -1445,7 +1092,7 @@ impl SessionCatalog for RestSessionCatalog {
let config = response
.config
.into_iter()
- .chain(self.user_config.props.clone())
+ .chain(self.props.clone())
Review Comment:
Should table-vended config win over catalog props here? `main` has the same
order, but Java's `tableFileIO` calls [`RESTUtil.merge(properties(),
config)`](https://github.com/apache/iceberg/blob/2114bf631e49af532d66e2ce148ee49dd1dd1f1f/core/src/main/java/org/apache/iceberg/rest/RESTUtil.java#L63-L77),
so the table's `config` wins, vended credentials included. This PR adds
`warehouse` and `uri` to the keys that beat it. As I read it, `client.props`
already carries the user props
([L284-L287](https://github.com/apache/iceberg-rust/blob/2f4084fae8baed21e58e202702979102104508aa/crates/catalog/rest/src/catalog.rs#L284-L287)),
so passing `response.config` alone would give Java's order. Should we do that
here, or in its own issue?
--
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]