Athena の Query で正規表現とかサブクエリとかやる方法


SELECT count(*)
FROM 
    (SELECT regexp_extract_all(request_uri, '(.*hoge_id=.*?)(.*?)&', 2)
        FROM "DATABASE_NAME"."TABLE_NAME"
        WHERE year=2018
            AND month=3
            AND day=13
        GROUP BY  regexp_extract_all(request_uri, '(.*hoge_id=.*?)(.*?)&', 2)
    )