Query editor
with follow_data as (select follower, profile_idfrom (selectfollower,ARRAY[CAST(profile_ids AS uint256)] AS profile_ids-- vars_struct.follower as follower,-- vars_struct.profileIds as profile_idsfrom (selectJSON_VALUE(vars,'lax $.follower') as follower,json_query(vars, 'lax $.profileIds[*]') AS profile_ids-- from_json(vars, 'struct<follower:string,profileIds:array<long>>') AS vars_structfrom lens_polygon.LensHub_call_followWithSig)union allselect-- t.`from` as follower,CAST(t."from" AS VARCHAR) AS follower,f.profileIds as profile_idsfrom lens_polygon.LensHub_call_follow finner join polygon.transactions t on f.call_tx_hash = t.hashwhere-- call_block_time >= '2022-05-18' -- Lens launch date-- and block_time >= '2022-05-18'call_block_time >= CAST('2022-05-18' AS TIMESTAMP)AND block_time >= CAST('2022-05-18' AS TIMESTAMP)) f-- lateral view explode(profile_ids) as profile_idCROSS JOIN UNNEST (f.profile_ids) AS b (profile_id)),profile_follower as (select profile_id,count(follower) as follower_countfrom follow_datagroup by 1)select (case when follower_count >= 10000 then '10K+ Followers'when follower_count >= 1000 then '1K+ Followers'when follower_count >= 100 then '100+ Followers'when follower_count >= 50 then '50+ Followers'when follower_count >= 10 then '10+ Followers'when follower_count >= 5 then '5+ Followers'else '1 - 5 Followers'end) as follower_count_type,count(profile_id) as profile_countfrom profile_followergroup by 1