Skip to content

[rest] Introduce snapshot loading to REST Catalog#5147

Merged
JingsongLi merged 2 commits intoapache:masterfrom
JingsongLi:rest_snapshot
Feb 25, 2025
Merged

[rest] Introduce snapshot loading to REST Catalog#5147
JingsongLi merged 2 commits intoapache:masterfrom
JingsongLi:rest_snapshot

Conversation

@JingsongLi
Copy link
Contributor

@JingsongLi JingsongLi commented Feb 25, 2025

Purpose

At present, for REST Catalog, table commits are all sent to the REST server, so it has the opportunity to cache snapshots, which can avoid the computing engine obtaining snapshots through the file system and accelerate the OLAP queries of the computing engine.

This PR introduces:

  /v1/{prefix}/databases/{database}/tables/{table}/snapshot:
    get:
      tags:
        - table
      summary: Get table snapshot
      operationId: getTableSnapshot
      parameters:
        - name: prefix
          in: path
          required: true
          schema:
            type: string
        - name: database
          in: path
          required: true
          schema:
            type: string
        - name: table
          in: path
          required: true
          schema:
            type: string
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetTableSnapshotResponse'
        "404":
          description: Resource not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        "500":
          description: Internal Server Error

And the GetTableSnapshotResponse is:

    GetTableSnapshotResponse:
      type: object
      properties:
        snapshot:
          $ref: '#/components/schemas/Snapshot'

When no snapshot for this table, REST can return 404 with SNAPSHOT ErrorResponseResourceType in NoSuchResourceException.

Tests

API and Format

Documentation

@jerry-024
Copy link
Contributor

+1

@JingsongLi JingsongLi merged commit a7486b0 into apache:master Feb 25, 2025
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants