Skip to main content

CatalogService.PreviewTableSnapshot

Read a bounded page of rows from one TableSnapshot output file. Pin the manifest digest and file index from ListTableSnapshotFiles.

CatalogService · Installed Web API. Use the HTTPS origin of your Prokrust installation and credentials authorized for this operation.

POST /prokrust.api.v1alpha1.CatalogService/PreviewTableSnapshot

Request headers​

HeaderValue and purpose
AuthorizationUse Bearer $PROKRUST_TOKEN for a Kubernetes caller authorized for this operation. Browser calls use the signed-in session.
Content-Typeapplication/json selects ProtoJSON for this unary request.
Connect-Protocol-Version1 selects version 1 of the Connect protocol.

Request fields​

PreviewArtifactRequest

JSON fieldTypeMeaning
namespacestringKubernetes workspace namespace for the operation. Use the namespace in which the selected resource lives.
namestringKubernetes metadata.name of the selected resource in this namespace.
uidstringKubernetes metadata.uid identifying this particular object. Read it from the resource before targeting an existing instance.
manifestDigeststringRequired, from List*Files. Prevents selection from a different manifest.
fileIndexuint32Zero-based file index returned by the matching List*Files method in this manifest.
rowOffsetuint64Zero-based first row to return. Use nextRowOffset to continue within the same file.
rowLimituint32Zero defaults to 100; maximum 100.
maxBytesuint32Zero defaults to 1 MiB; 1..1048576 bounds both protobuf and JSON responses.

Example request​

Set PROKRUST_URL to the installation’s HTTPS origin and PROKRUST_TOKEN to your caller token. Replace the sample values with values from your installation.

curl --fail-with-body --silent --show-error \
-H "Authorization: Bearer $PROKRUST_TOKEN" \
-H 'Content-Type: application/json' \
-H 'Connect-Protocol-Version: 1' \
"$PROKRUST_URL/prokrust.api.v1alpha1.CatalogService/PreviewTableSnapshot" \
--data-binary @- <<'JSON'
{
"namespace": "analytics",
"name": "events-snapshot",
"uid": "db607470-6181-53ce-91b8-615446c4e0fa",
"manifestDigest": "sha256:c687d66a4fa16752ac849be49935d560250318839e5e350e3aa129c2d732a103",
"fileIndex": 0,
"rowLimit": 2,
"maxBytes": 1048576
}
JSON

Response fields​

PreviewArtifactResponse

JSON fieldTypeMeaning
manifestDigeststringSHA-256 identity of the verified manifest. Keep it with file indices so they refer to the same publication.
fileArtifactFileMetadata of the manifest entry selected by the request.
columnslist of PreviewColumnOrdered column descriptors. Use this order when interpreting positional row values.
rowslist of PreviewRowRows in the preview page. Each position corresponds to the same position in columns.
totalRowsuint64Total rows in the selected file, before applying preview bounds.
nextRowOffsetuint64First row offset of the next page when hasMore is true.
hasMoreboolTrue when another page is available. Continue with the returned offset or cursor for this operation.

Example response​

{
"manifestDigest": "sha256:c687d66a4fa16752ac849be49935d560250318839e5e350e3aa129c2d732a103",
"file": {
"index": 0,
"filename": "part-00000.parquet",
"mediaType": "application/vnd.apache.parquet",
"sizeBytes": "4096",
"digest": "sha256:dd09164db4dac30d29bce5833b8942470afe8064e3b8bdffc60d900d249f1db2"
},
"columns": [
{
"name": "value",
"dataType": "float64",
"nullable": false
}
],
"rows": [
{
"values": [
{
"text": "12.5"
}
]
}
],
"totalRows": "1",
"nextRowOffset": "1"
}