You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 54137c1
Browse filesBrowse the repository at this point in the historyBrowse files
feat(rest): support rest catalog for databases, tables and snapshots
Add a REST catalog selected via the "metastore=rest" option:
- RestHttpClient: blocking libcurl client with exponential-backoff
retries. 429/503 are retried for every method, a transient transport
error only for an idempotent one; a server closing the connection
without responding is not retried. A Retry-After header is honored in
both the delta-seconds and the HTTP-date form with a
locale-independent parse, and is never shortened: the overall retry
budget bounds it while the per-sleep cap bounds only the backoff. Easy
handles are pooled, so a request reuses the previous connection
instead of paying a handshake every time; TLS below 1.2 is refused and
requests carry a default user agent. Every transported request is
debug-logged with the server request id.
- RestApi: HTTP + JSON protocol layer. "/v1/config" merges the server
options into the client ones (overrides > client options > defaults,
an override sent as null unsets the client option), "header." options
are sent as request headers and a listing follows the page tokens to
the last page. A failed request maps to a Status by the code of the
parsed error body, falling back to the http status, and carries a
RestErrorDetail with that code so callers can tell e.g. an
authentication failure from another IO error. A response body is never
echoed into an error, since it may carry credentials, so a body that
is not an error object is only reported as unparsable.
- RestCatalog: database, table and snapshot operations, with
"table-default." option defaults and a schema conversion computing the
highest field id (ids at or above the new
SpecialFieldIds::SYSTEM_FIELD_ID_START are excluded, duplicated ids
are rejected at any nesting level). A branch stays in the object name
so the server resolves it and returns the branch's own schema, the
default branch "main" being matched ignoring case and addressed as the
bare table. The "sys" database serves the local global system tables
like FileSystemCatalog.
- Bear token authentication provider ("bear" is the protocol's
historical spelling of "bearer"). RestAuthParameter::Create
url-encodes the query parameter values a signing provider signs.
- CatalogOptions: public catalog-level option keys (metastore, uri,
token, token.provider, "table-default." prefix), kept separate from
the table-level CoreOptions.
- CatalogUtils: system database, system table and branch checks shared
by FileSystemCatalog and RestCatalog.
- RestUtil::ExtractRequestId: the request id lookup shared by the debug
log line and the error message, falling back to any header whose name
carries a request id since a gateway may report it under its own name.
The pieces overlapping with the object store file systems move to
common/utils: UrlUtils carries both URL encoding flavors
(form-urlencoded for the REST api, RFC 3986 for S3), the generic HTTP
client moves there from common/fs, and the new SensitiveConfigUtils
redacts credentials for every surface that may expose them - the
sys.catalog_options table masks the value of a credential-carrying
option key, keeping at most a short tail of an identifier-like value,
and a server error message carrying a secret marker is redacted as a
whole.
libcurl is used from the system, so the new PAIMON_ENABLE_REST option
defaults to OFF like the other optional components with external
requirements; its CMake detection is a single find_package guarded by
PAIMON_ENABLE_S3 OR PAIMON_ENABLE_REST.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
0 commit comments