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
feat(rest): support rest catalog with database/table operations and snapshot listing
Add a REST catalog implementation selected via the "metastore=rest"
option:
- RestHttpClient: blocking libcurl client with exponential-backoff
retries (429/503 retried for all methods, transport errors only
for idempotent ones, honoring a Retry-After header in both the
delta-seconds and the HTTP-date form when it yields a positive
delay, with a locale-independent date parse; a server closing the
connection without responding is not retried) and per-request
debug logging.
- RestApi: HTTP + JSON layer with "/v1/config" option merging
(overrides > client options > defaults), "header." options as
request headers, paged listing and error-to-Status mapping that
prefers the code of the parsed error body over the http status,
redacts sensitive server messages, never echoes response bodies
into error messages (they may carry credentials), carries the
request id (x-request-id, falling back to any request-id header)
and attaches a RestErrorDetail with the mapped code so callers can
distinguish e.g. authentication failures programmatically.
- RestCatalog: database/table operations and snapshot listing,
"table-default." option defaults, system/branch table checks and
schema conversion with the computed highestFieldId, rejecting
duplicated field ids at any nesting level. Branch identifiers are
passed through to the server so it resolves the branch and returns
the branch's own schema (the default branch "main" resolves to the
bare table), snapshots of a branch are listed under the branch
object name, and the "sys" database serves the local global system
tables like FileSystemCatalog.
- Bear token authentication provider.
- CatalogOptions: catalog-level option keys (metastore, uri, token,
token.provider) and the "table-default." option prefix in a
dedicated public header, keeping them separate from the table-level
CoreOptions.
- CatalogUtils: system database and system/branch table checks
shared by FileSystemCatalog and RestCatalog; FileSystemCatalog's
create/drop/rename checks now use them instead of inline messages.
- SpecialFieldIds::SYSTEM_FIELD_ID_START names the reserved system
field id bound, which is excluded from the highest field id.
The pieces overlapping with the object store file systems are unified
under common/utils: UrlUtils carries both URL encoding flavors
(form-urlencoded for the REST api, RFC 3986 for S3), the generic HTTP
client moved there from common/fs, and the rest client reuses its
curl global-init guard, ScopeGuard cleanup and header-line parsing.
libcurl detection in CMake is a single find_package guarded by
PAIMON_ENABLE_S3 OR PAIMON_ENABLE_REST.
libcurl is used from the system rather than bundled, so the new
PAIMON_ENABLE_REST option defaults to OFF like the other optional
components with external requirements and is documented alongside
them.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
0 commit comments