Code Monkey home page Code Monkey logo

dcrtopics's People

Contributors

hiro-mackay avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

dcrtopics's Issues

[230523]Data Clean Room Topics

(BigQuery) SQL pushdown is generally available (GA).

概要

SQL プッシュダウン は最適化手法の一つです。これは、BigQuery がフィルタリングなどのオペレーションを自身で実行する代わりに、外部データソース(例: Cloud SQL または Cloud Spanner データベース)に委任するときに行われます。

何がGood?

BigQuery に戻す必要があるデータの量が少なくなるため、クエリの総実行時間が短縮されます。また、処理されるデータが少なくなるため、コストを大幅に削減できます。

BT Group のデジタル部門がクエリを見直したところ、上記のようなクエリを BigQuery 連携クエリが実行するのに 10 分かかっていたことがわかりました。今では、プッシュダウンのおかげで 26 秒しかかかりません。

Usage

現在、SQL プッシュダウンは SELECT * FROM T という形式のクエリにのみ適用されます。

Cloud SQL - プッシュダウンなし

SELECT *
FROM  operations_table

Cloud SQL - プッシュダウンあり

SELECT
 "a",
 "b",
 "c"
FROM (
 SELECT *
 FROM  operations_table) t
WHERE
 (("a" = $1)
   AND (NOT "b" IN ($2,
       $3))
   AND ("c" = $4))

[230516]Data Clean Room Topics

Introducing BigQuery differential privacy

概要

Big Query 差分プライバシーのパブリックプレビューがリリース。
将来的には、今回の差分プライバシーソリューションをBigQuery データ クリーン ルームと統合し、プライバシーを保護しながら組織が機密データを匿名化して共有できるようにする予定。

何がGood?

Googleがリリースしているdifferential-privacyというOSSを基盤として、Google SQL for BigQuery に差分プライバシーが追加された。

BigQuery の差分プライバシーは既存のセキュリティ制御とも連携するため、次のことが可能に。

Usage

差分プライバシーを次の集計関数に適用して、結果を匿名化できる。

  • カウント
  • 平均
  • PERCENTILE_CONT
SELECT
WITH
  DIFFERENTIAL_PRIVACY
    OPTIONS (
      epsilon = 1,
      delta = 1e-7,
      privacy_unit_column = npi)
    provider_type,
PERCENTILE_CONT(
  bene_unique_cnt, 0.5, contribution_bounds_per_row => (0, 10000))
  percentile_50th,
PERCENTILE_CONT(
  bene_unique_cnt, 0.9, contribution_bounds_per_row => (0, 10000))
  percentile_90th
FROM `bigquery-public-data.cms_medicare.physicians_and_other_supplier_2015`
WHERE provider_type IS NOT NULL
GROUP BY 1
ORDER BY 2 DESC
LIMIT 10;

-- Query results may differ slightly with each run due to noise being applied
/*--------------------------------------+-----------------+-----------------*
| provider_type                        | percentile_50th | percentile_90th |
+--------------------------------------+-----------------+-----------------+
| Peripheral Vascular Disease          | 132.95          | 3134.24         |
| Ambulance Service Supplier           | 101.81          | 697.79          |
| Multispecialty Clinic/Group Practice | 75.03           | 2316.40         |
| Addiction Medicine                   | 68.38           | 3811.18         |
| Public Health Welfare Agency         | 67.27           | 597.46          |
| Neuropsychiatry                      | 63.85           | 375.88          |
| Emergency Medicine                   | 62.86           | 272.00          |
| Centralized Flu                      | 52.97           | 216.98          |
| Clinical Laboratory                  | 52.04           | 744.01          |
| Ophthalmology                        | 49.93           | 282.12          |
*--------------------------------------+-----------------+-----------------*/

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.