Query editor
with roles as (SELECTgranted.account,ARRAY_AGG(DISTINCTCASEWHEN granted.role = 0x0000000000000000000000000000000000000000000000000000000000000000 THEN 'DEFAULT_ADMIN_ROLE'WHEN granted.role = 0xa615a8afb6fffcb8c6809ac0997b5c9c12b8cc97651150f14c8f6203168cff4c THEN 'UPGRADER'WHEN granted.role = 0xcc248bc24b61183ea1ffb7d8ab1560976dc4b64e39eab7e23a1c7b5dd946e81e THEN 'CHECKPOINTER'WHEN granted.role = 0x1d7d8843f0c1e1a93c132cfc3744403b38e2dc280a9cbff83c6f1219b210cf02 THEN 'SYSTEM'ELSE 'UNKNOWN'END) AS role_labels,ARRAY_AGG(DISTINCT granted.role) AS rolesFROM hourglass_ethereum.RewardsDistributorV2_evt_RoleGranted AS grantedLEFT JOIN hourglass_ethereum.RewardsDistributorV2_evt_RoleRevoked AS revokedON granted.contract_address = revoked.contract_addressAND granted.role = revoked.roleAND granted.account = revoked.accountWHERErevoked.role IS NULLGROUP BYgranted.account)selectarray_sort(role_labels) as role_labels, account, ens.name as ensfrom rolesleft join ens.resolver_latest as enson roles.account = ens.address