Search documentation
karat

+

K

User Documentation ↗
Version 2.0

Get Dataset Schema

GET/api/v2/datasets/{datasetRid}/getSchema
Warning

This endpoint is in preview and may be modified or removed at any time. To use this endpoint, add preview=true to the request query parameters.

Gets a dataset's schema. If no endTransactionRid is provided, the latest committed version will be used.

Third-party applications using this endpoint via OAuth2 must request the following operation scope: api:datasets-read.

Path parameters

datasetRid
string

The Resource Identifier (RID) of a Dataset.

Query parameters

branchName
string
optional

The name of a Branch.

endTransactionRid
string
optional

The Resource Identifier (RID) of the end Transaction. If a user does not provide a value, the RID of the latest committed transaction will be used.

versionId
string
optional

The schema version that should be used. If none is provided, the latest version will be used.

preview
boolean
optional

Enables the use of preview functionality.

Response body

GetDatasetSchemaResponse
object
Hide child attributes

Hide child attributes

branchName
string

The name of a Branch.

endTransactionRid
string

The Resource Identifier (RID) of a Transaction.

schema
object

The schema for a Foundry dataset. Files uploaded to this dataset must match this schema.

Show child attributes

Show child attributes

versionId
string

The version identifier of a dataset schema.

Examples

Request

Copied!
1 2 3 curl \ -H "Authorization: Bearer $TOKEN" \ "https://$HOSTNAME/api/v2/datasets/ri.foundry.main.dataset.c26f11c8-cdb3-4f44-9f5d-9816ea1c82da/getSchema?branchName=master&endTransactionRid=ri.foundry.main.transaction.0a0207cb-26b7-415b-bc80-66a3aa3933f4&versionId=0000000d-2acf-537c-a228-3a9fe3cdc523&preview=true"

Response

Copied!
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 { "endTransactionRid": "ri.foundry.main.transaction.0a0207cb-26b7-415b-bc80-66a3aa3933f4", "schema": { "fieldSchemaList": [ { "name": "id", "type": "long", "nullable": false, "customMetadata": { "description": "Primary key" } }, { "name": "event_time", "type": "timestamp", "nullable": false }, { "name": "price", "type": "decimal", "precision": 10, "scale": 2, "nullable": true }, { "name": "tags", "type": "array", "nullable": true, "arraySubtype": { "type": "string", "nullable": false } }, { "name": "metrics", "type": "struct", "nullable": true, "subSchemas": [ { "name": "temperature", "type": "double", "nullable": true }, { "name": "humidity", "type": "double", "nullable": true } ] } ] }, "versionId": "0000000d-2acf-537c-a228-3a9fe3cdc523", "branchName": "master" }

Error responses

Error Name
BranchNotFoundError CodeNOT_FOUND
Status Code404
DescriptionThe requested branch could not be found, or the client token does not have access to it.
ParametersdatasetRid, branchName
DatasetNotFoundError CodeNOT_FOUND
Status Code404
DescriptionThe requested dataset could not be found, or the client token does not have access to it.
ParametersdatasetRid
SchemaNotFoundError CodeNOT_FOUND
Status Code404
DescriptionA schema could not be found for the given dataset and branch, or the client token does not have access to it.
ParametersdatasetRid, branchName, transactionRid
InvalidParameterCombinationError CodeINVALID_ARGUMENT
Status Code400
DescriptionThe given parameters are individually valid but cannot be used in the given combination.
ParametersvalidCombinations, providedParameters
DatasetViewNotFoundError CodeNOT_FOUND
Status Code404
DescriptionThe requested dataset view could not be found. A dataset view represents the effective file contents of a dataset for a branch at a point in time, calculated from transactions (SNAPSHOT, APPEND, UPDATE, DELETE). The view may not exist if the dataset has no transactions, contains no files, the branch is not valid, or the client token does not have access to it.
ParametersdatasetRid, branch
GetDatasetSchemaPermissionDeniedError CodePERMISSION_DENIED
Status Code403
DescriptionCould not getSchema the Dataset.
ParametersdatasetRid