본문 바로가기
MegazoneCloud
← 전체 글
GCP

BigQuery How to extract domain from URL

If you want extract a domain from provided URL strings in BigQuery.

It’s very easy. You can use net.Host function.

WITH
  examples AS (
  SELECT "https://some.domain.com/path?query=param#hash" AS example
  UNION ALL
  SELECT "some.domain.com/path?query=param#hash" AS example)
SELECT
  NET.HOST(example)
FROM
  examples

답글 남기기

이메일 주소는 공개되지 않습니다. 필수 필드는 *로 표시됩니다