feat: add REST API client with list_databases support#144
feat: add REST API client with list_databases support#144JingsongLi merged 11 commits intoapache:mainfrom
Conversation
This PR implements the basic REST API client infrastructure for Paimon catalog services, focusing on the list_databases API. Features: - Add REST API client with HTTP request support (GET, GET with params) - Add authentication module with Bearer token and NoOp providers - Add configuration options for catalog settings - Add mock server for testing REST API endpoints - Add list_databases and list_databases_paged API methods - Add unit tests and integration tests The implementation includes: - crates/paimon/src/api/: REST API client, response types, error handling - crates/paimon/src/api/auth/: Authentication providers - crates/paimon/src/common/: Configuration options - crates/paimon/src/api/mock_server.rs: Mock server for testing - crates/paimon/tests/rest_server_test.rs: Integration tests
…t-api-list-databases
| async-stream = "0.3.6" | ||
| reqwest = { version = "0.12", features = ["json"] } | ||
| tokio-util = "0.7" | ||
| axum = { version = "0.7", features = ["macros", "tokio", "http1", "http2"] } |
There was a problem hiding this comment.
axum is only used in mock server? If yes, we can add it to dev-dependencies only
There was a problem hiding this comment.
moved
Seems still in dependencies
| parquet = { workspace = true, features = ["async", "zstd"] } | ||
| async-stream = "0.3.6" | ||
| reqwest = { version = "0.12", features = ["json"] } | ||
| tokio-util = "0.7" |
There was a problem hiding this comment.
Seems no usage in code now.
| /// Merge another Options into this one, overwriting existing keys. | ||
| pub fn merge(&mut self, other: &Options) { | ||
| for (key, value) in &other.data { | ||
| self.data.insert(key.clone(), value.clone()); |
There was a problem hiding this comment.
Double check here, user options should be first.
There was a problem hiding this comment.
changed, use config_response.merge_options().
|
|
||
| #[test] | ||
| fn test_encode_decode_string() { | ||
| let original = "hello world/测试"; |
There was a problem hiding this comment.
Remove Chinese here and test some string which includes '=' and '&'.
There was a problem hiding this comment.
added
Sorry, my bad. Did you test Chines for purpose? If yes, you can keep it here.
There was a problem hiding this comment.
No, I have removed Chinese and added string which includes '=' and '&'.
|
Looks good to me! we can add http retry logic in future PR. |
ok. |
|
+1 |
This PR implements the basic REST API client infrastructure and rest mock server, only supporting the list_databases API.
Features:
The Rest catalog has too much code, so it had to be split. This PR is the first one, and other PRs will be submitted continuously afterward.
Purpose
Linked issue: #119
Tests
API and Format
Documentation