Skip to content

Commit 6288e4d

Browse files
Vitalii4ashackolade-bot
andauthored
HCK-11497: add adapter to deconstruct array on derive and construct it on convert (#146)
Co-authored-by: hackolade-bot <[email protected]>
1 parent acda399 commit 6288e4d

File tree

2 files changed

+92
-2
lines changed

2 files changed

+92
-2
lines changed

polyglot/adapter.json

Lines changed: 80 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,86 @@
189189
"to": {
190190
"length": 10485760
191191
}
192-
}
192+
},
193+
[
194+
"deconstructArrayIntoArrayType",
195+
{
196+
"arrayDependency": {
197+
"type": "or",
198+
"values": [
199+
{
200+
"type": "and",
201+
"values": [
202+
{
203+
"key": "type",
204+
"value": "array"
205+
},
206+
{
207+
"key": "childType",
208+
"value": "array"
209+
}
210+
]
211+
},
212+
{
213+
"type": "and",
214+
"values": [
215+
{
216+
"key": "type",
217+
"value": "array"
218+
},
219+
{
220+
"key": "childType",
221+
"value": "list"
222+
}
223+
]
224+
},
225+
{
226+
"type": "and",
227+
"values": [
228+
{
229+
"key": "type",
230+
"value": "array"
231+
},
232+
{
233+
"key": "childType",
234+
"value": "set"
235+
}
236+
]
237+
},
238+
{
239+
"type": "and",
240+
"values": [
241+
{
242+
"key": "type",
243+
"value": "array"
244+
},
245+
{
246+
"key": "childType",
247+
"value": "tuple"
248+
}
249+
]
250+
}
251+
]
252+
},
253+
"childDependency": {
254+
"type": "not",
255+
"values": {
256+
"type": "or",
257+
"values": [
258+
{
259+
"key": "type",
260+
"value": "document"
261+
},
262+
{
263+
"key": "type",
264+
"value": "array"
265+
}
266+
]
267+
}
268+
},
269+
"keyword": "array_type"
270+
}
271+
]
193272
]
194273
},
195274
"postConvert": {

polyglot/convertAdapter.json

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,18 @@
7676
"to": {
7777
"hasMaxLength": true
7878
}
79-
}
79+
},
80+
[
81+
"constructArrayFromArrayType",
82+
{
83+
"dependency": {
84+
"key": "array_type",
85+
"exist": true
86+
},
87+
"keywordOfArrayType": "array_type",
88+
"typeOfPolyglotArray": "array"
89+
}
90+
]
8091
]
8192
}
8293
}

0 commit comments

Comments
 (0)