Skip to content

Commit

Permalink
Export of internal ZetaSQL changes.
Browse files Browse the repository at this point in the history
Upgraded bazel from version 5.3.0 to version 6.2.0.


--
Change by ZetaSQL Team <[email protected]>:
No public description
--
Change by ZetaSQL Team <[email protected]>:
Correctly plumb print_template_and_name_details for TVF.
--
Change by ZetaSQL Team <[email protected]>:
Enable collated sort keys in aggregate functions in reference implementation.
--
Change by ZetaSQL Team <[email protected]>:
Fix typo in comment
--
Change by ZetaSQL Team <[email protected]>:
"Simplify" the logic for adding spaces around brackets in map constructors.
--
Change by ZetaSQL Team <[email protected]>:
Do not add line break between ; and end-of-line comment.
--
Change by ZetaSQL Team <[email protected]>:
Upgraded bazel from version 5.3.0 to version 6.2.0.
--
Change by ZetaSQL Team <[email protected]>:
Small correction to a comment
--
Change by ZetaSQL Team <[email protected]>:
Cleanup two unused and deprecated functions in builtin_functions.h. Move one remaining deprecated function to the end of the file. Improve the comment on the one remaining function.
--
Change by ZetaSQL Team <[email protected]>:
Move a couple comments that got misplaced in the previous change to this sql_function_inliner.cc
--
Change by ZetaSQL Team <[email protected]>:
Add tests (both analyzer and compliance) for SQL-defined aggregate functions calling sql-defined aggregate functions.
--
Change by Brandon Dolphin <[email protected]>:
Add validation for object type when resolving CREATE|DROP|ALTER PRIVLEGE RESTRICTION statements.
--
Change by ZetaSQL Team <[email protected]>:
Fixes a ResolvedAST validation error from inlining specific shapes of SQL UDFs and adds both analyzer and compliance tests for the repro. Specifically, the affected shape was a ResolvedSubqueryExpr in the function body that references a function argument outside the subquery scan such as instance the LHS argument to an IN or LIKE ANY/ALL subquery. We were erroneously including "is_correlated" on these references even though only references in the scan (or the RHS argument for these subquery cases) should be considered correlated.
--
Change by John Fremlin <[email protected]>:
Move using namespace out of generated Bison header
--
Change by ZetaSQL Team <[email protected]>:
Enable ANONYMIZATION with ARRAY_FILTER rewriter testing in analyzer test
--
Change by Brandon Dolphin <[email protected]>:
Internal change

GitOrigin-RevId: 22017f256d0b4e0311e7a3cc79dfdf19c0d7eebd
Change-Id: I234baff6445b3c89bdf9937e9c3d323efa24a71b
  • Loading branch information
ZetaSQL Team authored and matthewcbrown committed Jul 24, 2023
1 parent 5133c6e commit 15770ae
Show file tree
Hide file tree
Showing 322 changed files with 4,404 additions and 2,881 deletions.
2 changes: 1 addition & 1 deletion .bazelversion
Original file line number Diff line number Diff line change
@@ -1 +1 @@
5.3.0
6.2.0
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ RUN apt-get update && apt-get -qq install -y default-jre default-jdk
RUN apt-get update && apt-get -qq install curl tar build-essential wget \
python python3 zip unzip

ENV BAZEL_VERSION=4.2.2
ENV BAZEL_VERSION=6.2.0

# Install bazel from source
RUN mkdir -p bazel && \
Expand Down
9 changes: 6 additions & 3 deletions docs/aggregate-dp-functions.md
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,10 @@ determine the optimal privacy parameters for your dataset and organization.

```sql
WITH ANONYMIZATION ...
ANON_AVG(expression [CLAMPED BETWEEN lower_bound AND upper_bound])
ANON_AVG(expression [clamped_between_clause])

clamped_between_clause:
CLAMPED BETWEEN lower_bound AND upper_bound
```

**Description**
Expand All @@ -184,8 +187,8 @@ can support these arguments:

+ `expression`: The input expression. This can be any numeric input type,
such as `INT64`.
+ `CLAMPED BETWEEN` clause:
Perform [clamping][dp-clamp-between] per privacy unit column averages.
+ `clamped_between_clause`: Perform [clamping][dp-clamp-between] per
privacy unit column averages.

**Return type**

Expand Down
117 changes: 74 additions & 43 deletions docs/functions-and-operators.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,10 @@ statement.
<tr>
<td>1</td>
<td>Field access operator</td>
<td><span><code>JSON</code></span><br><span><code>PROTO</code></span><br><span><code>STRUCT</code></span><br></td>
<td>

<span><code>STRUCT</code></span><br /><span><code>PROTO</code></span><br /><span><code>JSON</code></span><br />
</td>
<td>Field access operator</td>
<td>Binary</td>
</tr>
Expand Down Expand Up @@ -6002,7 +6005,10 @@ determine the optimal privacy parameters for your dataset and organization.

```sql
WITH ANONYMIZATION ...
ANON_AVG(expression [CLAMPED BETWEEN lower_bound AND upper_bound])
ANON_AVG(expression [clamped_between_clause])

clamped_between_clause:
CLAMPED BETWEEN lower_bound AND upper_bound
```

**Description**
Expand All @@ -6016,8 +6022,8 @@ can support these arguments:

+ `expression`: The input expression. This can be any numeric input type,
such as `INT64`.
+ `CLAMPED BETWEEN` clause:
Perform [clamping][dp-clamp-between] per privacy unit column averages.
+ `clamped_between_clause`: Perform [clamping][dp-clamp-between] per
privacy unit column averages.

**Return type**

Expand Down Expand Up @@ -15376,41 +15382,59 @@ Additional information about format specifiers:
<td>Decimal integer</td>
<td>392</td>
<td>
<span>INT32</span><br><span>INT64</span><br><span>UINT32</span><br><span>UINT64</span><br>
</td>

<span><code>INT32</code></span><br /><span><code>INT64</code></span><br /><span><code>UINT32</code></span><br /><span><code>UINT64</code></span><br />
</td>
</tr>

<tr>
<td><code>u</code></td>
<td>Unsigned integer</td>
<td>7235</td>
<td>
<span>UINT32</span><br><span>UINT64</span><br>
</td>

<span><code>UINT32</code></span><br /><span><code>UINT64</code></span><br />
</td>
</tr>

<tr>
<td><code>o</code></td>
<td>Octal</td>
<td>610</td>
<td>
<span>INT32</span><br><span>INT64</span><a href="#oxX">*</a><br><span>UINT32</span><br><span>UINT64</span>
Octal
<br /><br />
Note: If an <code>INT64</code> value is negative, an error is produced.
</td>
<td>610</td>
<td>

<span><code>INT32</code></span><br /><span><code>INT64</code></span><br /><span><code>UINT32</code></span><br /><span><code>UINT64</code></span><br />
</td>
</tr>
<tr>
<td><code>x</code></td>
<td>Hexadecimal integer</td>
<td>7fa</td>
<td>
<span>INT32</span><br><span>INT64</span><a href="#oxX">*</a><br><span>UINT32</span><br><span>UINT64</span>
Hexadecimal integer
<br /><br />
Note: If an <code>INT64</code> value is negative, an error is produced.
</td>
<td>7fa</td>
<td>

<span><code>INT32</code></span><br /><span><code>INT64</code></span><br /><span><code>UINT32</code></span><br /><span><code>UINT64</code></span><br />
</td>
</tr>
<tr>
<td><code>X</code></td>
<td>Hexadecimal integer (uppercase)</td>
<td>
Hexadecimal integer (uppercase)
<br /><br />
Note: If an <code>INT64</code> value is negative, an error is produced.
</td>
<td>7FA</td>
<td>
<span>INT32</span><br><span>INT64</span><a href="#oxX">*</a><br><span>UINT32</span><br><span>UINT64</span>

<span><code>INT32</code></span><br /><span><code>INT64</code></span><br /><span><code>UINT32</code></span><br /><span><code>UINT64</code></span><br />

</td>
</tr>
<tr>
Expand All @@ -15421,8 +15445,9 @@ Additional information about format specifiers:
inf<br/>
nan</td>
<td>
<span> NUMERIC</span><br><span> BIGNUMERIC</span><br><span> FLOAT</span><br><span> DOUBLE</span>
</td>

<span><code>NUMERIC</code></span><br /><span><code>BIGNUMERIC</code></span><br /><span><code>FLOAT</code></span><br /><span><code>DOUBLE</code></span><br />
</td>
</tr>
<tr>
<td><code>F</code></td>
Expand All @@ -15432,8 +15457,9 @@ Additional information about format specifiers:
INF<br/>
NAN</td>
<td>
<span> NUMERIC</span><br><span> BIGNUMERIC</span><br><span> FLOAT</span><br><span> DOUBLE</span>
</td>

<span><code>NUMERIC</code></span><br /><span><code>BIGNUMERIC</code></span><br /><span><code>FLOAT</code></span><br /><span><code>DOUBLE</code></span><br />
</td>
</tr>
<tr>
<td><code>e</code></td>
Expand All @@ -15442,8 +15468,9 @@ Additional information about format specifiers:
inf<br/>
nan</td>
<td>
<span>NUMERIC</span><br><span>BIGNUMERIC</span><br><span>FLOAT</span><br><span>DOUBLE</span>
</td>

<span><code>NUMERIC</code></span><br /><span><code>BIGNUMERIC</code></span><br /><span><code>FLOAT</code></span><br /><span><code>DOUBLE</code></span><br />
</td>
</tr>
<tr>
<td><code>E</code></td>
Expand All @@ -15452,8 +15479,9 @@ Additional information about format specifiers:
INF<br/>
NAN</td>
<td>
<span>NUMERIC</span><br><span>BIGNUMERIC</span><br><span>FLOAT</span><br><span>DOUBLE</span>
</td>

<span><code>NUMERIC</code></span><br /><span><code>BIGNUMERIC</code></span><br /><span><code>FLOAT</code></span><br /><span><code>DOUBLE</code></span><br />
</td>
</tr>
<tr>
<td><code>g</code></td>
Expand All @@ -15465,8 +15493,9 @@ Additional information about format specifiers:
inf<br/>
nan</td>
<td>
<span>NUMERIC</span><br><span>BIGNUMERIC</span><br><span>FLOAT</span><br><span>DOUBLE</span>
</td>

<span><code>NUMERIC</code></span><br /><span><code>BIGNUMERIC</code></span><br /><span><code>FLOAT</code></span><br /><span><code>DOUBLE</code></span><br />
</td>
</tr>
<tr>
<td><code>G</code></td>
Expand All @@ -15482,8 +15511,9 @@ Additional information about format specifiers:
NAN
</td>
<td>
<span>NUMERIC</span><br><span>BIGNUMERIC</span><br><span>FLOAT</span><br><span>DOUBLE</span>
</td>

<span><code>NUMERIC</code></span><br /><span><code>BIGNUMERIC</code></span><br /><span><code>FLOAT</code></span><br /><span><code>DOUBLE</code></span><br />
</td>
</tr>

<tr>
Expand All @@ -15504,10 +15534,9 @@ Additional information about format specifiers:

</td>
<td>
PROTO
<br />
JSON
</td>

<span><code>JSON</code></span><br /><span><code>PROTO</code></span><br />
</td>
</tr>

<tr>
Expand Down Expand Up @@ -15536,17 +15565,19 @@ month: 10

</td>
<td>
PROTO
<br />
JSON
</td>

<span><code>JSON</code></span><br /><span><code>PROTO</code></span><br />
</td>
</tr>

<tr>
<td><code>s</code></td>
<td>String of characters</td>
<td>sample</td>
<td>STRING</td>
<td>

<span><code>STRING</code></span><br />
</td>
</tr>
<tr>
<td><code>t</code></td>
Expand All @@ -15559,7 +15590,7 @@ month: 10
sample<br/>
2014&#8209;01&#8209;01
</td>
<td>&lt;any&gt;</td>
<td>Any type</td>
</tr>
<tr>
<td><code>T</code></td>
Expand All @@ -15575,7 +15606,7 @@ month: 10
2.3<br/>
date&nbsp;'2014&#8209;01&#8209;01'
</td>
<td>&lt;any&gt;</td>
<td>Any type</td>
</tr>
<tr>
<td><code>%</code></td>
Expand All @@ -15585,9 +15616,6 @@ month: 10
</tr>
</table>

<a id="oxX"></a><sup>*</sup>The specifiers `%o`, `%x`, and `%X` raise an
error if negative values are used.

The format specifier can optionally contain the sub-specifiers identified above
in the specifier prototype.

Expand Down Expand Up @@ -15843,7 +15871,10 @@ The `STRING` is formatted as follows:
<td>NULL</td>
</tr>
<tr>
<td><span> INT32</span><br><span> INT64</span><br><span> UINT32</span><br><span> UINT64</span><br></td>
<td>

<span><code>INT32</code></span><br /><span><code>INT64</code></span><br /><span><code>UINT32</code></span><br /><span><code>UINT64</code></span><br />
</td>
<td>123</td>
<td>123</td>
</tr>
Expand Down
5 changes: 4 additions & 1 deletion docs/operators.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,10 @@ statement.
<tr>
<td>1</td>
<td>Field access operator</td>
<td><span><code>JSON</code></span><br><span><code>PROTO</code></span><br><span><code>STRUCT</code></span><br></td>
<td>

<span><code>STRUCT</code></span><br /><span><code>PROTO</code></span><br /><span><code>JSON</code></span><br />
</td>
<td>Field access operator</td>
<td>Binary</td>
</tr>
Expand Down
Loading

0 comments on commit 15770ae

Please sign in to comment.