PredictionService.PreviewPredictionRun
Read a bounded page of rows from one PredictionRun output file. Pin the manifest digest and file index from ListPredictionRunFiles.
PredictionService · Installed Web API. Use the HTTPS origin of your Prokrust installation and credentials authorized for this operation.
POST /prokrust.api.v1alpha1.PredictionService/PreviewPredictionRun
Request headers
| Header | Value and purpose |
|---|---|
Authorization | Use Bearer $PROKRUST_TOKEN for a Kubernetes caller authorized for this operation. Browser calls use the signed-in session. |
Content-Type | application/json selects ProtoJSON for this unary request. |
Connect-Protocol-Version | 1 selects version 1 of the Connect protocol. |
Request fields
| JSON field | Type | Meaning |
|---|---|---|
namespace | string | Kubernetes workspace namespace for the operation. Use the namespace in which the selected resource lives. |
name | string | Kubernetes metadata.name of the selected resource in this namespace. |
uid | string | Kubernetes metadata.uid identifying this particular object. Read it from the resource before targeting an existing instance. |
manifestDigest | string | Required, from List*Files. Prevents selection from a different manifest. |
fileIndex | uint32 | Zero-based file index returned by the matching List*Files method in this manifest. |
rowOffset | uint64 | Zero-based first row to return. Use nextRowOffset to continue within the same file. |
rowLimit | uint32 | Zero defaults to 100; maximum 100. |
maxBytes | uint32 | Zero 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.PredictionService/PreviewPredictionRun" \
--data-binary @- <<'JSON'
{
"namespace": "analytics",
"name": "predict-values",
"uid": "7c787fd5-3835-58e1-8901-bd16ab9dec09",
"manifestDigest": "sha256:c687d66a4fa16752ac849be49935d560250318839e5e350e3aa129c2d732a103",
"fileIndex": 0,
"rowLimit": 2,
"maxBytes": 1048576
}
JSON
Response fields
| JSON field | Type | Meaning |
|---|---|---|
manifestDigest | string | SHA-256 identity of the verified manifest. Keep it with file indices so they refer to the same publication. |
file | ArtifactFile | Metadata of the manifest entry selected by the request. |
columns | list of PreviewColumn | Ordered column descriptors. Use this order when interpreting positional row values. |
rows | list of PreviewRow | Rows in the preview page. Each position corresponds to the same position in columns. |
totalRows | uint64 | Total rows in the selected file, before applying preview bounds. |
nextRowOffset | uint64 | First row offset of the next page when hasMore is true. |
hasMore | bool | True 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"
}