LoginSignup
3
0

BigQueryでKARTE SignalsのGoogle広告用のハッシュ値を生成する

Last updated at Posted at 2023-12-05

以下のドキュメントにかかれている、ハッシュ値をBigQueryで求めてみます。

@の手前のドットは削除する必要がある一方で、@の後ろのドットは維持する必要がある点に注意しながら、文字列置換を行います。

to_hex(sha256(lower(replace(replace(split(email, '@')[0], ' ', ''), '.', '')) || '@' || lower(replace(split(email, '@')[1], ' ', ''))))

サンプルとして提供されている John.Smith@gmail.com に対して処理した結果、ハッシュ値のサンプル通りの値が得られることが分かります。

スクリーンショット 2023-12-04 17.01.12.png

3
0
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
3
0