ViewCreate
Request to create a logical or materialized view from one or more backing resources. Materialized views require order_by and options.refresh.
lower_snake_case identifier from 1 to 63 characters. It must start with a lowercase letter or underscore and may contain lowercase letters, digits, and underscores.
Possible values: Value must match regular expression ^[a-z_][a-z0-9_]{0,62}$
alias object
- string
- null
View kind: 'view' or 'materialized'
Possible values: [view, materialized]
Parent collection ID (required)
Possible values: non-empty
folder_id object
- string
- null
tags object
- string[]
- null
description object
- string
- null
tables object[]required
Backing resources. tables[0] = primary (FROM). length ≥ 1
SQL alias used in column references
Backing resource category
Possible values: [dataset, source]
Identifier of the dataset or source used by this view table.
joins object
- object[]
- null
alias of the ViewTable this join introduces
Allowed Join Kind values. Values: inner, left, right, full.
Possible values: [inner, left, right, full]
inneron object[]required
AND'd binary conditions
left objectrequired
Join condition operand. Exactly one of column / expression set.
column object
Backing column reference in 'alias.col' form
- string
- null
expression object
SQL fragment when the operand is a computed expression
- string
- null
right objectrequired
Join condition operand. Exactly one of column / expression set.
column object
Backing column reference in 'alias.col' form
- string
- null
expression object
SQL fragment when the operand is a computed expression
- string
- null
Allowed Join Operator values. Values: eq, ne, gt, gte, lt, lte.
Possible values: [eq, ne, gt, gte, lt, lte]
eqschema objectrequired
Output Arrow schema (REQUIRED)
Output Arrow schema (REQUIRED)
column_masks object
- object
- null
row_filters object
- RowFilter
- null
Possible values: [and, or]
andconditions object[]
Nested conditions (leaf RowFilterCondition or group RowFilter)
- RowFilterCondition
- Option 2
conditionconditionColumn name to filter on
Allowed Row Filter Operator values. Values: eq, ne, gt, gte, lt, lte, in, not_in, and 4 more.
Possible values: [eq, ne, gt, gte, lt, lte, in, not_in, between, like, is_null, is_not_null]
value object
Filter value. Single value for scalar operators, list for 'in'/'not_in', 2-element list for 'between'. Omit for 'is_null'/'is_not_null'.
- Option 1
- null
group_by object
- string[]
- null
having object
- RowFilter
- null
Possible values: [and, or]
andconditions object[]
Nested conditions (leaf RowFilterCondition or group RowFilter)
- RowFilterCondition
- Option 2
conditionconditionColumn name to filter on
Allowed Row Filter Operator values. Values: eq, ne, gt, gte, lt, lte, in, not_in, and 4 more.
Possible values: [eq, ne, gt, gte, lt, lte, in, not_in, between, like, is_null, is_not_null]
value object
Filter value. Single value for scalar operators, list for 'in'/'not_in', 2-element list for 'between'. Omit for 'is_null'/'is_not_null'.
- Option 1
- null
order_by object
MergeTree ORDER BY ⊆ schema_ fields (required when type='materialized')
- string[]
- null
partition_by object
MergeTree PARTITION BY ⊆ schema_ fields (optional)
- string[]
- null
options object
View options. For type=materialized, options.refresh is required as a non-empty refresh-interval expression; type=view must not set it.
- object
- null
{
"name": "string",
"alias": "string",
"type": "view",
"collection_id": "string",
"folder_id": "string",
"tags": [
"string"
],
"description": "string",
"tables": [
{
"alias": "string",
"type": "dataset",
"resource": "string"
}
],
"joins": [
{
"target": "string",
"kind": "inner",
"on": [
{
"left": {
"column": "string",
"expression": "string"
},
"right": {
"column": "string",
"expression": "string"
},
"operator": "eq"
}
]
}
],
"schema": {},
"column_masks": {},
"row_filters": {
"kind": "and",
"conditions": [
{
"kind": "condition",
"column": "string",
"operator": "eq"
},
null
]
},
"group_by": [
"string"
],
"having": {
"kind": "and",
"conditions": [
{
"kind": "condition",
"column": "string",
"operator": "eq"
},
null
]
},
"order_by": [
"string"
],
"partition_by": [
"string"
],
"options": {}
}