79458637

Date: 2025-02-21 21:24:47
Score: 0.5
Natty:
Report link

Flatten the array first, insert and re-aggregate.

UPDATE MyTable
SET MyDict = (
  SELECT ARRAY_AGG(
    IFF(
      f.value:key2 = '123',
      OBJECT_INSERT(f.value, 'key2', 888, TRUE),
      f.value
    )
  )
  FROM TABLE(FLATTEN(INPUT => MyTable.MyDict)) t
)
Reasons:
  • Low length (0.5):
  • Has code block (-0.5):
  • Low reputation (0.5):
Posted by: keithwalsh