From 45d052dd691377c58dff992d75d8fdaed74f89a1 Mon Sep 17 00:00:00 2001 From: hackolade-bot Date: Thu, 12 Jun 2025 17:00:24 +0300 Subject: [PATCH] HCK-11497: add adapter to deconstruct array on derive and construct it on convert --- polyglot/adapter.json | 81 +++++++++++++++++++++++++++++++++++- polyglot/convertAdapter.json | 13 +++++- 2 files changed, 92 insertions(+), 2 deletions(-) diff --git a/polyglot/adapter.json b/polyglot/adapter.json index 85aa6a0..46d3aec 100644 --- a/polyglot/adapter.json +++ b/polyglot/adapter.json @@ -189,7 +189,86 @@ "to": { "length": 10485760 } - } + }, + [ + "deconstructArrayIntoArrayType", + { + "arrayDependency": { + "type": "or", + "values": [ + { + "type": "and", + "values": [ + { + "key": "type", + "value": "array" + }, + { + "key": "childType", + "value": "array" + } + ] + }, + { + "type": "and", + "values": [ + { + "key": "type", + "value": "array" + }, + { + "key": "childType", + "value": "list" + } + ] + }, + { + "type": "and", + "values": [ + { + "key": "type", + "value": "array" + }, + { + "key": "childType", + "value": "set" + } + ] + }, + { + "type": "and", + "values": [ + { + "key": "type", + "value": "array" + }, + { + "key": "childType", + "value": "tuple" + } + ] + } + ] + }, + "childDependency": { + "type": "not", + "values": { + "type": "or", + "values": [ + { + "key": "type", + "value": "document" + }, + { + "key": "type", + "value": "array" + } + ] + } + }, + "keyword": "array_type" + } + ] ] }, "postConvert": { diff --git a/polyglot/convertAdapter.json b/polyglot/convertAdapter.json index 1b08bb1..4745dc5 100644 --- a/polyglot/convertAdapter.json +++ b/polyglot/convertAdapter.json @@ -76,7 +76,18 @@ "to": { "hasMaxLength": true } - } + }, + [ + "constructArrayFromArrayType", + { + "dependency": { + "key": "array_type", + "exist": true + }, + "keywordOfArrayType": "array_type", + "typeOfPolyglotArray": "array" + } + ] ] } }