Skip to content

Commit ca094d2

Browse files
committed
update mdl json schema
1 parent a207202 commit ca094d2

File tree

1 file changed

+129
-45
lines changed

1 file changed

+129
-45
lines changed

wren-mdl/mdl.schema.json

Lines changed: 129 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,59 @@
3333
"description": "the expression of the column. If the column is calculated, this field is required",
3434
"type": ["string", "null"]
3535
},
36+
"isHidden": {
37+
"description": "whether the column is hidden or not",
38+
"type": "boolean"
39+
},
40+
"columnLevelAccessControl": {
41+
"description": "the access-control rule for the column",
42+
"type": "object",
43+
"properties": {
44+
"name": {
45+
"description": "the name of the access-control rule",
46+
"type": "string"
47+
},
48+
"operator": {
49+
"description": "the operator of the access-control rule",
50+
"type": "string",
51+
"enum": [
52+
"EQUALS",
53+
"NOT_EQUALS",
54+
"GREATER_THAN",
55+
"LESS_THAN",
56+
"GREATER_THAN_OR_EQUALS",
57+
"LESS_THAN_OR_EQUALS"
58+
]
59+
},
60+
"required_properties": {
61+
"description": "the required properties for the access-control rule",
62+
"type": "array",
63+
"items": {
64+
"$ref": "#/$defs/sessionProperty"
65+
},
66+
"minItems": 1,
67+
"maxItems": 1
68+
},
69+
"threshold": {
70+
"description": "the threshold value of the access-control rule",
71+
"type": "object",
72+
"properties": {
73+
"value": {
74+
"description": "the value of the threshold",
75+
"type": "string"
76+
},
77+
"dataType": {
78+
"description": "the data type of the threshold",
79+
"type": "string",
80+
"enum": [
81+
"NUMERIC",
82+
"STRING"
83+
]
84+
}
85+
}
86+
}
87+
}
88+
},
3689
"properties": {
3790
"description": "the customize properties of the column",
3891
"type": "object",
@@ -43,6 +96,24 @@
4396
},
4497
"required": ["name", "type"],
4598
"additionalProperties": false
99+
},
100+
"sessionProperty": {
101+
"type": "object",
102+
"properties": {
103+
"name": {
104+
"description": "the name of the session property",
105+
"type": "string",
106+
"minLength": 1
107+
},
108+
"required": {
109+
"description": "whether the session property is required or not",
110+
"type": "boolean"
111+
},
112+
"defaultExpr": {
113+
"description": "the default SQL expression of the session property",
114+
"type": ["string", "null"]
115+
}
116+
}
46117
}
47118
},
48119
"type": "object",
@@ -57,6 +128,34 @@
57128
"type": "string",
58129
"minLength": 1
59130
},
131+
"sampleDataFolder": {
132+
"description": "the folder path for sample data",
133+
"type": "string",
134+
"minLength": 1
135+
},
136+
"dataSource": {
137+
"description": "the data source type",
138+
"type": "string",
139+
"enum": [
140+
"BIGQUERY",
141+
"CLICKHOUSE",
142+
"CANNER",
143+
"TRINO",
144+
"MSSQL",
145+
"MYSQL",
146+
"POSTGRES",
147+
"SNOWFLAKE",
148+
"DUCKDB",
149+
"LOCAL_FILE",
150+
"S3_FILE",
151+
"GCS_FILE",
152+
"MINIO_FILE",
153+
"ORACLE",
154+
"ATHENA",
155+
"REDSHIFT"
156+
],
157+
"minLength": 1
158+
},
60159
"models": {
61160
"description": "the list of models",
62161
"type": "array",
@@ -116,11 +215,35 @@
116215
"type": "string",
117216
"pattern": "^\\s*(\\d+(?:\\.\\d+)?)\\s*([a-zA-Z]+)\\s*$"
118217
},
218+
"rowLevelAccessControls": {
219+
"type": "array",
220+
"items": {
221+
"description": "the row-level access-control rule for the model",
222+
"type": "object",
223+
"properties": {
224+
"name": {
225+
"description": "the name of the access-control rule",
226+
"type": "string"
227+
},
228+
"required_properties": {
229+
"description": "the required properties for the access-control rule",
230+
"type": "array",
231+
"items": {
232+
"$ref": "#/$defs/sessionProperty"
233+
}
234+
},
235+
"condition": {
236+
"description": "The condition of the access-control rule. A condition is a SQL expression that evaluates to true or false.",
237+
"type": "string"
238+
}
239+
}
240+
}
241+
},
119242
"properties": {
120243
"description": "the customize properties of the model",
121244
"type": "object",
122245
"additionalProperties": {
123-
"type": "string"
246+
"type": ["string", "number", "boolean", "object", "array", "null"]
124247
}
125248
}
126249
},
@@ -169,7 +292,7 @@
169292
"description": "the customize properties of the relationship",
170293
"type": "object",
171294
"additionalProperties": {
172-
"type": "string"
295+
"type": ["string", "number", "boolean", "object", "array", "null"]
173296
}
174297
}
175298
},
@@ -258,7 +381,7 @@
258381
"properties": {
259382
"type": "object",
260383
"additionalProperties": {
261-
"type": "string"
384+
"type": ["string", "number", "boolean", "object", "array", "null"]
262385
}
263386
}
264387
},
@@ -286,7 +409,7 @@
286409
"description": "the customize properties of the view",
287410
"type": "object",
288411
"additionalProperties": {
289-
"type": "string"
412+
"type": ["string", "number", "boolean", "object", "array", "null"]
290413
}
291414
}
292415
},
@@ -326,7 +449,7 @@
326449
"description": "the customize properties of the member",
327450
"type": "object",
328451
"additionalProperties": {
329-
"type": "string"
452+
"type": ["string", "number", "boolean", "object", "array", "null"]
330453
}
331454
}
332455
},
@@ -337,51 +460,12 @@
337460
"description": "the customize properties of the enum",
338461
"type": "object",
339462
"additionalProperties": {
340-
"type": "string"
463+
"type": ["string", "number", "boolean", "object", "array", "null"]
341464
}
342465
}
343466
},
344467
"required": ["name", "values"]
345468
}
346-
},
347-
"macros": {
348-
"description": "the list of macros",
349-
"type": "array",
350-
"unevaluatedItems": false,
351-
"items": {
352-
"type": "object",
353-
"properties": {
354-
"name": {
355-
"description": "the name of the macro",
356-
"type": "string",
357-
"minLength": 1
358-
},
359-
"description": {
360-
"description": "the definition of the macro",
361-
"type": "string",
362-
"minLength": 1
363-
},
364-
"properties": {
365-
"description": "the customize properties of the macro",
366-
"type": "object",
367-
"additionalProperties": {
368-
"type": "string"
369-
}
370-
}
371-
},
372-
"required": ["name", "definition"]
373-
}
374-
},
375-
"cumulativeMetrics": {
376-
"type": "array",
377-
"items": {
378-
"type": "object",
379-
"description": "experimental feature. The format is subject to change"
380-
}
381-
},
382-
"dateSpine": {
383-
"type": "object",
384-
"description": "experimental feature. The format is subject to change"
385469
}
386470
},
387471
"required": ["catalog", "schema"],

0 commit comments

Comments
 (0)