Query editor
-- Query 1.C (REVISED for current JSON string format): view_feem_project_contract_map-- Maps project_id to individual contract addresses.-- Assumes contracts_raw_json from the view is a VARCHAR like '["0xabc","0xdef"]'SELECTp.project_id,p.name AS project_name,-- The elements of the unnested array are already the address stringst.contract_address_str AS contract_addressFROMdune.soniclabs.result_view_feem_projects_raw pCROSS JOIN UNNEST(-- First, cast the VARCHAR to JSON (to handle the outer quotes and escapes if it's a JSON-encoded string)-- Then, cast that JSON to an ARRAY of VARCHARs.TRY_CAST(JSON_PARSE(p.contracts_raw_json) AS ARRAY(VARCHAR))) AS t(contract_address_str) -- Each element 'contract_address_str' is now '0x...'WHEREp.contracts_raw_json IS NOT NULLAND p.contracts_raw_json != '[]' -- Avoid unnesting an explicitly empty array stringAND t.contract_address_str IS NOT NULL;