Skip to content

Commit 92310e4

Browse files
ZetaSQL Teamahirschberg-corp-oss
authored andcommitted
Export of internal ZetaSQL changes.
-- Change by ZetaSQL Team <no-reply@google.com>: Extend `literal_remover` to use predefined literal names specified in different engines. No change to production with absence of `PredefinedLiteralReplacementMap`. -- Change by ZetaSQL Team <no-reply@google.com>: No public description -- Change by Christoph Dibak <dibak@google.com>: Allow nested differential_privacy queries in the rewriter -- Change by Shannon Bales <nbales@google.com>: Have the parser return errors through the return value and not through a side channel. -- Change by ZetaSQL Team <no-reply@google.com>: Update gen_parse_tree.py to `use_custom_debug_string` instead of defining `SingleNodeDebugString()` in `extra_public_defs` -- Change by ZetaSQL Team <no-reply@google.com>: Add tests for overloaded TVF signatures with repeated, optional, and named arguments. -- Change by ZetaSQL Team <no-reply@google.com>: Added a link from the Resolved AST documentation to the generated Parser AST docs -- Change by Divyanshu Ranjan <divyanshur@google.com>: Handle Builtin TVFs in the reference implementation algebrizer. -- Change by Divyanshu Ranjan <divyanshur@google.com>: Add `TableValuedFunctionCallExpr` (+ other relevant) class to represent Builtin TVF algebrized call. -- Change by Shannon Bales <nbales@google.com>: Add a non-runtime error test that casts INTERNAL -> INTERVAL -- Change by ZetaSQL Team <no-reply@google.com>: No public description -- Change by ZetaSQL Team <no-reply@google.com>: Analyzer changes for resolution of Table Valued Functions with multiple signatures. -- Change by Brandon Dolphin <bdolphin@google.com>: Update comment on LanguageVersion enum to remove expired tentative freeze date for VERSION_1_4. -- Change by Evan Brown <ezb@google.com>: No public description -- Change by ZetaSQL Team <no-reply@google.com>: Resurrect aggregate filtering support. -- Change by ZetaSQL Team <no-reply@google.com>: Remove a redundant and problematic ctor for ExprResolutionInfo, and make calls more explicit. -- Change by ZetaSQL Team <no-reply@google.com>: Add compliance tests for multi level aggregation on UDAs -- Change by ZetaSQL Team <no-reply@google.com>: Print the name of the offending type when failing for double insertion in the catalog. -- Change by Brandon Dolphin <bdolphin@google.com>: Consistently use `FLOAT32` name for float value. -- Change by ZetaSQL Team <no-reply@google.com>: Update resolver to support LIMIT ALL and LIMIT <null> -- Change by ZetaSQL Team <no-reply@google.com>: Don't pass nullptr into GetNonEmptyLocation marked notnull -- Change by ZetaSQL Team <no-reply@google.com>: Internal fixes -- Change by ZetaSQL Team <no-reply@google.com>: Internal -- Change by ZetaSQL Team <no-reply@google.com>: Consistently use `FLOAT32` name for float value. -- Change by ZetaSQL Team <no-reply@google.com>: Mark TemplatedSQLTVF::Resolve() as final to prevent subclasses from modifying its resolution behavior. -- Change by Ivo Ristovski List <ilist@google.com>: Automated Code Change -- Change by ZetaSQL Team <no-reply@google.com>: mark FEATURE_MULTI_GROUPING_SETS not in development. -- Change by Divyanshu Ranjan <divyanshur@google.com>: Move `TvfInputRelation` and `TVFOpArgument` out of `TVFOp`. Rename `TVFOpArgument` to `TvfAlgebraArgument`. -- Change by ZetaSQL Team <no-reply@google.com>: Added a Jinja template and BUILD rules to generated Markdown documentation for the Parse AST. -- Change by ZetaSQL Team <no-reply@google.com>: Updated the execute-query-tool to support multi-statements in kScript mode. -- Change by ZetaSQL Team <no-reply@google.com>: Extended `StatementEvaluatorImpl` to support multi-statements. -- Change by ZetaSQL Team <no-reply@google.com>: Added the multi-stmt support to the reference implementation and the corresponding compliance tests. -- Change by ZetaSQL Team <no-reply@google.com>: Remove in-development tag for WITH DEPTH modifier -- Change by ZetaSQL Team <no-reply@google.com>: mark FEATURE_MULTI_GROUPING_SETS not in development. -- Change by ZetaSQL Team <no-reply@google.com>: Change the default weight type of percentile functions to the percentile type. -- Change by ZetaSQL Team <no-reply@google.com>: Execute Query highight column ID on hover -- Change by ZetaSQL Team <no-reply@google.com>: No public description -- Change by ZetaSQL Team <no-reply@google.com>: No public description -- Change by ZetaSQL Team <no-reply@google.com>: No public description -- Change by ZetaSQL Team <no-reply@google.com>: Remove RET_CHECK from reference implementation that asserted that measure values are non-NULL. -- Change by ZetaSQL Team <no-reply@google.com>: Update parser to support LIMIT ALL -- Change by ZetaSQL Team <no-reply@google.com>: Mark SQLTableValuedFunction::Resolve() override as final, to prevent any modification of its behavior. -- Change by ZetaSQL Team <no-reply@google.com>: Ensure all annotations are blocked from TVFs, as they are not currently supported. -- Change by ZetaSQL Team <no-reply@google.com>: Ensure all annotations are blocked from TVFs, as they are not currently supported. -- Change by ZetaSQL Team <no-reply@google.com>: Corrected a typo in DISTINCT-pipe-operator.md -- Change by ZetaSQL Team <no-reply@google.com>: No public description -- Change by ZetaSQL Team <no-reply@google.com>: Internal changes -- Change by ZetaSQL Team <no-reply@google.com>: Optimize `ToIdentifierLiteral` by using a static `LanguageOptions`. -- Change by ZetaSQL Team <no-reply@google.com>: Change "current table" to "input table" in descriptions of SET and DROP pipe operators to match how we talk about tables in the other pipe operators. -- Change by ZetaSQL Team <no-reply@google.com>: Add parser test attempting to insert at a subscript. -- Change by Divyanshu Ranjan <divyanshur@google.com>: Use TableValuedFunction::FullName instead of TableValuedFunction::SQLName in SQLBuilder. -- Change by ZetaSQL Team <no-reply@google.com>: Allow GROUP BY modifiers on UDAs in the resolver -- Change by ZetaSQL Team <no-reply@google.com>: Remove deprecated `TableValuedFunction` and `FixedOutputSchemaTVF` constructor with AnonymizationInfo param and migrate usages to the constructor that accepts a `std::vector<FunctionSignature>` -- Change by ZetaSQL Team <no-reply@google.com>: No public description -- Change by ZetaSQL Team <no-reply@google.com>: Support ResolvedMakeStruct in TestIsSameExpressionForGroupBy -- Change by ZetaSQL Team <no-reply@google.com>: Add ADD_MONTHS rewriters -- Change by ZetaSQL Team <no-reply@google.com>: Fix broken anchor text in sql reference and BQML docs -- Change by ZetaSQL Team <no-reply@google.com>: Remove "SELECT_" in LB_WITH_IN_SELECT_WITH_OPTIONS and KW_OPTIONS_IN_SELECT_WITH_OPTIONS. -- Change by ZetaSQL Team <no-reply@google.com>: No public description -- Change by ZetaSQL Team <no-reply@google.com>: Tighten the computation for annotations when converting NULL to a type. -- Change by ZetaSQL Team <no-reply@google.com>: No public description -- Change by ZetaSQL Team <no-reply@google.com>: Always use FLOAT32/FLOAT64 in FORMAT functions for float literals. -- Change by ZetaSQL Team <no-reply@google.com>: [BQ TOC] Moves `GENERATE_RANGE_ARRAY` from Array functions to Range functions and adds `RANGE` to the Range functions section -- Change by ZetaSQL Team <no-reply@google.com>: Added DML support to execute-query. -- Change by ZetaSQL Team <no-reply@google.com>: Rework the measure rewriter to create a single STRUCT column per GrainScan. -- Change by ZetaSQL Team <no-reply@google.com>: Casting graph elements should not introduce new properties -- Change by ZetaSQL Team <no-reply@google.com>: consolidate SetDefinitionForInlining copies -- Change by ZetaSQL Team <no-reply@google.com>: No public description -- Change by ZetaSQL Team <no-reply@google.com>: No public description -- Change by ZetaSQL Team <no-reply@google.com>: No public description -- Change by ZetaSQL Team <no-reply@google.com>: Add differential_privacy.test to ZetaSQL allowlist. -- Change by ZetaSQL Team <no-reply@google.com>: Fix the contract of coercion and casting to properly check for annotation defaults after natural propagation. The coercer should never change the target annotation maps. It should be passed from callers as an immutable input so that its decision is not changing in-flight or have circular logic. -- Change by ZetaSQL Team <no-reply@google.com>: Change analyzer/testdata/match_recognize.test to use MAXIMUM features instead of NONE. -- Change by ZetaSQL Team <no-reply@google.com>: Added an option `use_test_database_copy` to allow DDL statements to be tested in compliance tests. -- Change by ZetaSQL Team <no-reply@google.com>: Mark test case with RAND() as known to fail for Spanner, and add a different UUID-based test case to replace it. -- Change by ZetaSQL Team <no-reply@google.com>: Java support for creating TVF with multiple signatures -- Change by ZetaSQL Team <no-reply@google.com>: No public description -- Change by ZetaSQL Team <no-reply@google.com>: Internal changes. -- Change by ZetaSQL Team <no-reply@google.com>: Add a signatures field to TableValuedFunctionProto in order to support multiple signatures -- Change by ZetaSQL Team <no-reply@google.com>: Strengthen the check in analsysis to ensure that the return type of regexp_extract_groups is not changed between the compute result type callback and the function resolution. -- Change by ZetaSQL Team <no-reply@google.com>: Fix GSQL reference implementation for `TIMESTAMP(string)` function. -- Change by ZetaSQL Team <no-reply@google.com>: Fix a bug in annotation propagation of array constructor. -- Change by ZetaSQL Team <no-reply@google.com>: Generalize the `ResolvedUpdateArrayItem` AST node to a generic subscript operation -- Change by Jeff Shute <jshute@google.com>: Internal change. (And 500 more changes) GitOrigin-RevId: 513300940d5c0610117869eee76587e3c6a44761 Change-Id: I06af48e23489d760adbdd028f6afaed3b28d6561
1 parent 74b504c commit 92310e4

992 files changed

Lines changed: 81358 additions & 26655 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.bazelrc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ build:clang --cxxopt=-Wno-reorder-ctor
3636
build:clang --cxxopt=-Wno-unused-const-variable
3737
build:clang --cxxopt=-Wno-unused-function
3838
build:clang --cxxopt=-Wno-macro-redefined
39+
# Add this line to treat the specific warning as an error
40+
build:clang --cxxopt=-Werror=undefined-internal
3941
# By default, we don't suppress any warnings, to get g++-specific warning
4042
# suppression you can invoke with --config=g++
4143
build:g++ --action_env=BAZEL_CXXOPTS="-std=c++17"

WORKSPACE

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,6 @@ workspace(name = "com_google_zetasql")
3737

3838
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
3939

40-
http_archive(
41-
name = "toolchains_llvm",
42-
canonical_id = "1.0.0",
43-
sha256 = "e91c4361f99011a54814e1afbe5c436e0d329871146a3cd58c23a2b4afb50737",
44-
strip_prefix = "toolchains_llvm-1.0.0",
45-
url = "https://github.com/bazel-contrib/toolchains_llvm/releases/download/1.0.0/toolchains_llvm-1.0.0.tar.gz",
46-
)
47-
4840
http_archive(
4941
name = "rules_jvm_external",
5042
sha256 = "b17d7388feb9bfa7f2fa09031b32707df529f26c91ab9e5d909eb1676badd9a6",

bazel/flex.bzl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,8 @@ genlex(
6161

6262
load("@rules_flex//flex:flex.bzl", "FLEX_TOOLCHAIN_TYPE", "flex_toolchain")
6363
load("@rules_m4//m4:m4.bzl", "M4_TOOLCHAIN_TYPE")
64+
load("@rules_cc//cc/common:cc_common.bzl", "cc_common")
65+
load("@rules_cc//cc/common:cc_info.bzl", "CcInfo")
6466

6567
def _genlex_impl(ctx):
6668
"""Implementation for genlex rule."""

bazel/zetasql_deps_step_1.bzl

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -22,24 +22,20 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
2222
# but depend on them being something different. So we have to override them both
2323
# by defining the repo first.
2424
load("@com_google_zetasql//bazel:zetasql_bazel_version.bzl", "zetasql_bazel_version")
25-
load("@toolchains_llvm//toolchain:deps.bzl", "bazel_toolchain_dependencies")
26-
load("@toolchains_llvm//toolchain:rules.bzl", "llvm_toolchain")
2725

2826
def zetasql_deps_step_1(add_bazel_version = True):
2927
if add_bazel_version:
3028
zetasql_bazel_version()
3129

32-
bazel_toolchain_dependencies()
33-
llvm_toolchain(
34-
name = "llvm_toolchain",
35-
llvm_versions = {
36-
"": "16.0.0",
37-
# The LLVM repo stops providing pre-built binaries for the MacOS x86_64
38-
# architecture for versions >= 16.0.0: https://github.com/llvm/llvm-project/releases,
39-
# but our Kokoro MacOS tests are still using x86_64 (ventura).
40-
# TODO: Upgrade the MacOS version to sonoma-slcn.
41-
"darwin-x86_64": "15.0.7",
42-
},
30+
# Step 1 loads the toolchains_llvm helper repo.
31+
# Step 2 uses the llvm_toolchain rule to load the toolchain repo for a specific arch.
32+
# Step 3 loads the toolchain itself from that repo.
33+
http_archive(
34+
name = "toolchains_llvm",
35+
canonical_id = "1.0.0",
36+
sha256 = "e91c4361f99011a54814e1afbe5c436e0d329871146a3cd58c23a2b4afb50737",
37+
strip_prefix = "toolchains_llvm-1.0.0",
38+
url = "https://github.com/bazel-contrib/toolchains_llvm/releases/download/1.0.0/toolchains_llvm-1.0.0.tar.gz",
4339
)
4440

4541
http_archive(
@@ -52,10 +48,10 @@ def zetasql_deps_step_1(add_bazel_version = True):
5248
)
5349
http_archive(
5450
name = "rules_cc",
55-
sha256 = "712d77868b3152dd618c4d64faaddefcc5965f90f5de6e6dd1d5ddcd0be82d42",
56-
strip_prefix = "rules_cc-0.1.1",
51+
sha256 = "0d3b4f984c4c2e1acfd1378e0148d35caf2ef1d9eb95b688f8e19ce0c41bdf5b",
52+
strip_prefix = "rules_cc-0.1.4",
5753
urls = [
58-
"https://github.com/bazelbuild/rules_cc/releases/download/0.1.1/rules_cc-0.1.1.tar.gz",
54+
"https://github.com/bazelbuild/rules_cc/releases/download/0.1.4/rules_cc-0.1.4.tar.gz",
5955
],
6056
)
6157
http_archive(

bazel/zetasql_deps_step_2.bzl

Lines changed: 39 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -19,17 +19,29 @@
1919
load("@bazel_gazelle//:deps.bzl", "gazelle_dependencies", "go_repository")
2020
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
2121
load("@io_bazel_rules_go//go:deps.bzl", "go_register_toolchains", "go_rules_dependencies")
22-
load("@llvm_toolchain//:toolchains.bzl", "llvm_register_toolchains")
2322
load("@rules_bison//bison:bison.bzl", "bison_register_toolchains")
2423
load("@rules_flex//flex:flex.bzl", "flex_register_toolchains")
2524
load("@rules_foreign_cc//foreign_cc:repositories.bzl", "rules_foreign_cc_dependencies")
2625
load("@rules_m4//m4:m4.bzl", "m4_register_toolchains")
2726
load("@rules_proto//proto:repositories.bzl", "rules_proto_dependencies")
2827
load("@rules_proto//proto:setup.bzl", "rules_proto_setup")
2928
load("@rules_proto//proto:toolchains.bzl", "rules_proto_toolchains")
29+
load("@toolchains_llvm//toolchain:deps.bzl", "bazel_toolchain_dependencies")
30+
load("@toolchains_llvm//toolchain:rules.bzl", "llvm_toolchain")
3031

3132
def _load_deps_from_step_1():
32-
llvm_register_toolchains()
33+
bazel_toolchain_dependencies()
34+
llvm_toolchain(
35+
name = "llvm_toolchain",
36+
llvm_versions = {
37+
"": "16.0.0",
38+
# The LLVM repo stops providing pre-built binaries for the MacOS x86_64
39+
# architecture for versions >= 16.0.0: https://github.com/llvm/llvm-project/releases,
40+
# but our Kokoro MacOS tests are still using x86_64 (ventura).
41+
# TODO: Upgrade the MacOS version to sonoma-slcn.
42+
"darwin-x86_64": "15.0.7",
43+
},
44+
)
3345
rules_foreign_cc_dependencies()
3446

3547
def textmapper_dependencies():
@@ -171,16 +183,29 @@ def zetasql_deps_step_2(
171183
# SHA256=$(sha256sum ${COMMIT}.tar.gz | cut -f1 -d' ')
172184
# rm ${COMMIT}.tar.gz
173185
# echo \# Commit from $(date --iso-8601=date)
174-
# echo url = \"$URL\",
175-
# echo sha256 = \"$SHA256\",
176-
# echo strip_prefix = \"${PREFIX}${COMMIT}\",
177-
#
186+
# echo absl_url = \"$URL\",
187+
# echo absl_sha256 = \"$SHA256\",
188+
# echo absl_strip_prefix = \"${PREFIX}${COMMIT}\",
189+
190+
# Commit from 2024-07-15
191+
absl_sha256 = "04612122377806a412124a89f6258206783d4d53fbc5ad4c9cdc1f3b49411bfb"
192+
absl_url = "https://github.com/abseil/abseil-cpp/archive/eb852207758a773965301d0ae717e4235fc5301a.tar.gz"
193+
absl_strip_prefix = "abseil-cpp-eb852207758a773965301d0ae717e4235fc5301a"
178194
http_archive(
179195
name = "com_google_absl",
180-
# Commit from 2024-07-15
181-
sha256 = "04612122377806a412124a89f6258206783d4d53fbc5ad4c9cdc1f3b49411bfb",
182-
url = "https://github.com/abseil/abseil-cpp/archive/eb852207758a773965301d0ae717e4235fc5301a.tar.gz",
183-
strip_prefix = "abseil-cpp-eb852207758a773965301d0ae717e4235fc5301a",
196+
sha256 = absl_sha256,
197+
url = absl_url,
198+
strip_prefix = absl_strip_prefix,
199+
)
200+
201+
# Fetch a copy of the repository with the name "abseil-cpp". This is needed
202+
# because the RE2 library expects the Abseil repository to be named "abseil-cpp",
203+
# and other deps expect "com_google_absl".
204+
http_archive(
205+
name = "abseil-cpp",
206+
sha256 = absl_sha256,
207+
url = absl_url,
208+
strip_prefix = absl_strip_prefix,
184209
)
185210

186211
# required by many python libraries
@@ -393,14 +418,14 @@ py_library(
393418
if analyzer_deps:
394419
# RE2 Regex Framework, mostly used in unit tests.
395420
if not native.existing_rule("com_googlesource_code_re2"):
396-
# 2023-06-01
421+
# 2025-08-05
397422
http_archive(
398423
name = "com_googlesource_code_re2",
399424
urls = [
400-
"https://github.com/google/re2/archive/03da4fc0857c285e3a26782f6bc8931c4c950df4.tar.gz",
425+
"https://github.com/google/re2/archive/85c7c0fb1163b0bd83a7951f5a205ee7b489e33e.tar.gz",
401426
],
402-
sha256 = "ef516fb84824a597c4d5d0d6d330daedb18363b5a99eda87d027e6bdd9cba299",
403-
strip_prefix = "re2-03da4fc0857c285e3a26782f6bc8931c4c950df4",
427+
sha256 = "bdb61bacaf880fc0433686af103a0dea4edfb804a53d087ae529c7690bf41fb9",
428+
strip_prefix = "re2-85c7c0fb1163b0bd83a7951f5a205ee7b489e33e",
404429
)
405430

406431
# Jinja2.

bazel/zetasql_deps_step_3.bzl

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,11 @@
1616

1717
""" Step 3 to load ZetaSQL dependencies. """
1818

19-
load("@google_bazel_common//:workspace_defs.bzl", "google_common_workspace_rules")
20-
load("@com_google_protobuf//:protobuf_deps.bzl", "protobuf_deps")
2119
load("@com_github_grpc_grpc//bazel:grpc_deps.bzl", "grpc_deps")
2220
load("@com_google_googleapis//:repository_rules.bzl", "switched_rules_by_language")
21+
load("@com_google_protobuf//:protobuf_deps.bzl", "protobuf_deps")
22+
load("@google_bazel_common//:workspace_defs.bzl", "google_common_workspace_rules")
23+
load("@llvm_toolchain//:toolchains.bzl", "llvm_register_toolchains")
2324

2425
def zetasql_deps_step_3():
2526
protobuf_deps()
@@ -30,3 +31,4 @@ def zetasql_deps_step_3():
3031
cc = True,
3132
)
3233
google_common_workspace_rules()
34+
llvm_register_toolchains()

docs/aggregate_functions.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1101,6 +1101,11 @@ window_specification:
11011101
Gets the number of rows in the input or the number of rows with an
11021102
expression evaluated to any value other than `NULL`.
11031103

1104+
Note: If you're querying a large dataset, you can compute results faster and
1105+
save resources by using [HLL++ functions][hll-functions] for approximate
1106+
distinct counts. For more information, see
1107+
[Sketches][sketches].
1108+
11041109
**Definitions**
11051110

11061111
+ `*`: Use this value to get the number of all rows in the input.
@@ -1283,6 +1288,10 @@ FROM vendors;
12831288
*--------*/
12841289
```
12851290

1291+
[sketches]: https://github.com/google/zetasql/blob/master/docs/sketches.md
1292+
1293+
[hll-functions]: https://github.com/google/zetasql/blob/master/docs/hll_functions.md
1294+
12861295
[countif]: https://github.com/google/zetasql/blob/master/docs/aggregate_functions.md#countif
12871296

12881297
[groupable-data-types]: https://github.com/google/zetasql/blob/master/docs/data-types.md#groupable_data_types

docs/array_functions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -688,7 +688,7 @@ Returns `NULL` if `array_to_search` is `NULL`.
688688

689689
In the following example, the query first checks to see if any elements that are
690690
greater than 3 exist in an array (`e > 3`). Then the query checks to see if any
691-
any elements that are greater than 0 exist in an array (`e > 0`).
691+
elements that are greater than 0 exist in an array (`e > 0`).
692692

693693
```zetasql
694694
SELECT

docs/data-types.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2845,7 +2845,7 @@ with a timezone that observes DST, the following rules apply:
28452845
+ During the transition from standard time to DST, one hour is skipped. A
28462846
civil time from the skipped hour is treated the same as if it were written
28472847
an hour later. For example, in the `America/Los_Angeles` time zone, the hour
2848-
between 2 AM and 3 AM on May 10, 2024 is skipped on a clock. The times
2848+
between 2 AM and 3 AM on March 10, 2024 is skipped on a clock. The times
28492849
2:30 AM and 3:30 AM on that date are treated as the same point in time:
28502850

28512851
```zetasql

docs/differential-privacy.md

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,15 +35,15 @@ evening. Lots of guests come at 7 PM, and the restaurant is completely empty
3535
at 1 AM:
3636

3737
<center>
38-
![Chart shows busyness of a small rest by mapping visitors at specific hours of the day.](https://cloud.google.com/images/zetasql-dp-chart-a.png)
38+
![Chart shows busyness of a small rest by mapping visitors at specific hours of the day.][dp-chart-a]
3939
</center>
4040

4141
This chart looks useful, but there's a catch. When a new guest arrives, this
4242
fact is immediately revealed by the bar chart. In the following chart, it's
4343
clear that there's a new guest, and that this guest arrived at roughly 1 AM:
4444

4545
<center>
46-
![Chart shows outlier arrival.](https://cloud.google.com/images/zetasql-dp-chart-b.png)
46+
![Chart shows outlier arrival.][dp-chart-b]
4747
</center>
4848

4949
Showing this detail isn't great from a privacy perspective, as anonymized
@@ -52,7 +52,7 @@ side by side makes it even more apparent: the orange bar chart has one extra
5252
guest that has arrived around 1 AM:
5353

5454
<center>
55-
![Chart comparison highlights an individual contribution.](https://cloud.google.com/images/zetasql-dp-chart-c.png)
55+
![Chart comparison highlights an individual contribution.][dp-chart-c]
5656
</center>
5757

5858
Again, that's not great. To avoid this kind privacy issue, you can add random
@@ -61,7 +61,7 @@ comparison chart, the results are anonymized and no longer reveal individual
6161
contributions.
6262

6363
<center>
64-
![Differential privacy is applied to comparisons.](https://cloud.google.com/images/zetasql-dp-chart-d.gif)
64+
![Differential privacy is applied to comparisons.][dp-chart-d]
6565
</center>
6666

6767
## How differential privacy works on queries
@@ -371,5 +371,13 @@ individual's ID, you could expose sensitive data.
371371

372372
[dp-clamping]: https://github.com/google/zetasql/blob/master/docs/aggregate-dp-functions.md#dp_clamping
373373

374+
[dp-chart-a]: https://cloud.google.com/docs/images/zetasql-dp-chart-a.png
375+
376+
[dp-chart-b]: https://cloud.google.com/docs/images/zetasql-dp-chart-b.png
377+
378+
[dp-chart-c]: https://cloud.google.com/docs/images/zetasql-dp-chart-c.png
379+
380+
[dp-chart-d]: https://cloud.google.com/docs/images/zetasql-dp-chart-d.gif
381+
374382
<!-- mdlint on -->
375383

0 commit comments

Comments
 (0)