LoginSignup
7
5

More than 3 years have passed since last update.

BigQueryでURLをデコードする方法

Last updated at Posted at 2019-12-23

関数で定義すればOK

CREATE TEMPORARY FUNCTION urlDecode(s STRING)
RETURNS STRING
LANGUAGE js AS "return decodeURI(s);";

-- with句でdbの代わりをしているだけです
-- アクセスログなどに代替してください
with db as (
    select '%e3%83%86%e3%82%b9%e3%83%88' as url
)

select
    urlDecode(db.url) AS decoded
from
    db

image.png

7
5
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
7
5