Uploading a data schema
To streamline the repetitive steps when configuring schemas for data bindings, you can prepare a file with schemas and then upload it. To do this, follow these steps:
- In the management console
, select the folder containing the data binding you want to update. - Navigate to Yandex Query.
- In the left-hand panel, select Bindings.
- Locate the binding you need in the list, click
in its row, and select Edit. - Click Upload from file and select your schema file.
- Click Modify.
Data schemas
We support multiple schema formats:
- Plain text.
- JSON.
- JSON compatible with Data Transfer.
Plain text
The plain-text schema format is very similar to the SQL DDL syntax: it includes the SCHEMA keyword, a list of fields, and their corresponding data types. This is the only export format for data schemas in Yandex Query.
Here is an example of a schema in plain-text format:
SCHEMA=(
billing_account_id String NOT NULL,
billing_account_name String
)
Where:
billing_account_id: Field name.String: Field type.NOT NULL: Flag indicating a required field in the source data.
JSON
JSON format is used for importing schemas from external systems. A schema in JSON format is a set of properties defining field names, data types, and required flags.
Here is an example of a schema in JSON format:
[
{
"name": "billing_account_id",
"type": "String",
"required": true
},
{
"name": "billing_account_name",
"type": "String",
"required": false
}
]
Where:
billing_account_id: Field name.String: Field type.required: true: Flag indicating a required field in the source data.
Data Transfer-compatible JSON format
This format is intended for compatible description of data schemas across various systems. This JSON format consists of a set of records defining fields and their types, with all fields considered optional in the source data.
Schema example:
[
{
"name": "billing_account_id",
"typeName": "String"
},
{
"name": "billing_account_name",
"typeName": "String"
}
]
Where:
billing_account_id: Field name.String: Field type.
To ensure compatibility between Yandex Query and Data Transfer, we recommend using the following data types:
- INT64
- INT32
- INT16
- UINT64
- UINT32
- UINT16
- DOUBLE
- STRING
- UTF8