ServicesScanDALHTTP APIScans

Plan a scan

POST
/scans/plan

Plan a scan of one Table version: its output schema, how exactly it can enforce each filter clause, and one split for each file that statistics do not prune, in stored order. Planning reads only metadata, and refuses an emit it cannot run before any rows are read.

Authorization

bearerAuth
headerAuthorizationBearer <token>

Request Body

application/json
  1. body
scan*

A read of one Table version, sent whole with every plan and read request. columns selects top-level columns, or all of them when absent; projection computes the output columns instead. A filter clause that the service cannot enforce exactly fails the scan before any rows are read. limit caps the rows each split returns, in stored order. An emit returns a top-k or aggregates of the output rows instead of the rows themselves. rowRange selects half-open stored positions in this exact version, before filtering and deletion removal, concatenating fragments in stored order. Positions are not stable across rewrites. Empty ranges return no rows; reversed ranges are invalid. rowIdColumn adds a last output column of that name holding each row's row ID: the Table's stable identity of the row, a uint64 that survives rewrites and compaction and is never reused. rowIds keeps only rows whose row IDs fall in its ranges: planning prunes files whose row IDs cannot match, and reads enforce it exactly. A top-k can return and order by the row ID column. Aggregates take no rowIdColumn.

storage?|null

Response Body

Success

application/json
  1. response

A scan's output and one split for each file that statistics do not prune.

info*

A scan describes its output schema and filter support. An emit uses the schema of its results. The sourceFields map relates top-level stored names to stable field identities, independently of output projection. Omission means that the host does not expose these identities.

metrics?|null
splits*array<>
curl -X POST 'https://scandal.spiraldb.dev/scans/plan' \  -H 'Content-Type: application/json' \  -d '{  "scan": {    "table": {      "resourceId": "026d60bb-63a8-407e-bf67-01dcfc6022e6",      "versionId": "14707576-2549-4848-82ed-f68f8a1b47c7"    }  }}'
{  "info": {    "filterClauses": [      {        "expression": "string",        "reason": "string",        "support": "exact"      }    ],    "schema": null,    "sourceFields": {      "property1": "497f6eca-6276-4993-bfeb-53cbbbba6f08",      "property2": "497f6eca-6276-4993-bfeb-53cbbbba6f08"    },    "statistics": {      "columns": [        {          "countsExact": true,          "maxExact": true,          "maxValue": "string",          "minExact": true,          "minValue": "string",          "name": "string",          "nanCount": "string",          "nullCount": "string"        }      ],      "rowCount": "string",      "rowCountExact": true,      "storedBytes": "string"    },    "writeLayout": {      "ordering": [        {          "descending": true,          "nullsFirst": true,          "path": [            "string"          ],          "transform": "string"        }      ],      "partitioning": [        {          "path": [            "string"          ],          "transform": "string"        }      ]    }  },  "metrics": {    "filesConsidered": "string",    "filesPruned": "string",    "fragmentsConsidered": "string",    "fragmentsPruned": "string",    "outputRows": "string",    "storage": {      "bytes": "string",      "readTimeNs": "string",      "requests": "string",      "scope": "complete"    },    "windows": {      "prunedStatistics": "string",      "visited": "string"    }  },  "splits": [    {      "estimatedBytes": "string",      "estimatedRows": "string",      "fragmentId": "5d87088b-78ff-43fe-aeb7-86bff9e3b8f1",      "ordering": [        {          "descending": true,          "nullsFirst": true,          "path": [            "string"          ],          "transform": "string"        }      ],      "split": {        "fragment": "string",        "rows": {          "end": "string",          "start": "string"        }      }    }  ]}