本文為英文版的機器翻譯版本,如內容有任何歧義或不一致之處,概以英文版為準。
AWS Clean Rooms 差異性隱私權的 SQL 功能
AWS Clean Rooms 差異隱私權使用一般用途查詢結構來支援複雜的 SQL 查詢。自訂分析範本會根據此結構進行驗證,以確保它們可以在受差異隱私權保護的資料表上執行。下表指出支援哪些函數。如需更多資訊,請參閱查詢結構和語法。
短名稱 | SQL 建構 | 常見資料表表達式 (CTEs) | 最終 SELECT 子句 |
---|---|---|---|
Aggregate functions |
|
Supported with the condition that CTEs using differential privacy protected tables
must result in data with user-level records. You should write the SELECT expression in
those CTEs using `SELECT userIdentifierColumn...' format. |
Supported aggregations: AVG, COUNT, COUNT DISTINCT, STDDEV, and SUM. |
CTEs | WITH clause, WITH clause subquery | Supported with the condition that CTEs using differential privacy protected tables
must result in data with user-level records. You should write the SELECT expression in
those CTEs using `SELECT userIdentifierColumn...' format. |
N/A |
Subqueries |
|
You can have any subquery that doesn't reference differential privacy relations in these constructs. You can have any subquery that references differential privacy relations in a FROM and JOIN clause only. | |
Join clauses |
|
支援的條件是,在開啟差異隱私權的查詢兩個或多個資料表時,僅支援在使用者識別符資料欄上加入等同的 JOIN 函數。確保強制性的同等加入條件正確。確認資料表擁有者已在所有資料表中設定相同的使用者識別符欄,以便使用者的定義在資料表之間保持一致。 在開啟差異隱私權的情況下結合兩個或多個關係時,不支援 CROSS JOIN 函數。 |
|
Set operators | UNION, UNION ALL, INTERSECT, EXCEPT | MINUS (these are synonyms) | All are supported | Not supported |
Window functions |
彙總函數
排名函數
|
All are supported with the condition that the user identifier column in the window function's partition clause is required when you query a relation with differential privacy turned on. | Not supported |
Conditional expressions |
|
All are supported | All are supported |
Conditions |
|
EXISTS and IN cannot be used because they require
subqueries. All others are supported. |
All are supported |
Date-time functions |
|
All are supported | All are supported |
String functions |
|
All are supported | All are supported |
Data type formatting functions |
|
All are supported | All are supported |
Hash functions |
|
All are supported | All are supported |
Mathematical operator symbols | +, -, *, /, %, and @ | All are supported | All are supported |
Math functions |
|
All are supported | All are supported |
SUPER type information functions |
|
All are supported | All are supported |
VARBYTE functions |
|
All are supported | All are supported |
JSON |
|
All are supported | All are supported |
Array functions |
|
Not supported | Not supported |
Extended GROUP BY | GROUPING SETS, ROLLUP, CUBE | Not supported | Not supported |
Sort operation | ORDER BY | Supported with the condition that an ORDER BY clause is only supported in a window function's partition clause when querying tables with differential privacy turned on. | Supported |
Row limits | LIMIT, OFFSET | Not supported in CTEs using differential privacy protected tables | All are supported |
Table and column aliasing | Supported | Supported | |
Math functions on aggregate functions | Supported | Supported | |
Scalar functions within aggregate functions | Supported | Supported |
不支援 SQL 建構的常見替代方案
類別 | SQL 建構 | 備用 |
---|---|---|
範圍函數 |
|
You can use the equivalent aggregate function with GROUP BY. |
Mathematical operator symbols |
|
|
Scalar functions |
|
|
Literals | INTERVAL ‘1 SECOND' | INTERVAL '1' SECOND |
Row limiting | TOP n | LIMIT n |
Join |
|
ON clause should explicitly contain a join criterion. |