Skip to content

Commit

Permalink
Export of internal ZetaSQL changes.
Browse files Browse the repository at this point in the history
--
Change by ZetaSQL Team <[email protected]>:
Updated the zetasql doc for the zetasql release in Sept.
--
Change by ZetaSQL Team <[email protected]>:
No public description
--
Change by ZetaSQL Team <[email protected]>:
No public description
--
Change by ZetaSQL Team <[email protected]>:
No public description
--
Change by ZetaSQL Team <[email protected]>:
Minor refactoring against c++ resolved ast node generation templates
--
Change by ZetaSQL Team <[email protected]>:
No public description
--
Change by ZetaSQL Team <[email protected]>:
No public description
--
Change by ZetaSQL Team <[email protected]>:
No public description
--
Change by ZetaSQL Team <[email protected]>:
No public description
--
Change by ZetaSQL Team <[email protected]>:
No public description
--
Change by ZetaSQL Team <[email protected]>:
No public description
--
Change by ZetaSQL Team <[email protected]>:
No public description
--
Change by ZetaSQL Team <[email protected]>:
No public description
--
Change by Brandon Dolphin <[email protected]>:
No public description
--
Change by Christoph Dibak <[email protected]>:
Fix rewriting of public groups
--
Change by ZetaSQL Team <[email protected]>:
No public description
--
Change by ZetaSQL Team <[email protected]>:
Added `ARG_TYPE_ANY_3` and `ARG_ARRAY_TYPE_ANY_3`.
--
Change by ZetaSQL Team <[email protected]>:
No public description
--
Change by ZetaSQL Team <[email protected]>:
No public description
--
Change by Christoph Dibak <[email protected]>:
No public description
--
Change by ZetaSQL Team <[email protected]>:
No public description
--
Change by Christoph Dibak <[email protected]>:
No public description
--
Change by ZetaSQL Team <[email protected]>:
No public description
--
Change by ZetaSQL Team <[email protected]>:
No public description
--
Change by ZetaSQL Team <[email protected]>:
Refactor ResolvedAggreateScan algebrizer to remove duplicated logic
--
Change by ZetaSQL Team <[email protected]>:
Added more tests to validate that argument aliases are not supported.
--
Change by ZetaSQL Team <[email protected]>:
No public description
--
Change by ZetaSQL Team <[email protected]>:
No public description
--
Change by ZetaSQL Team <[email protected]>:
Added `argument_alias` fields to `ResolvedFunctionArgument`.
--
Change by ZetaSQL Team <[email protected]>:
Change edit distance implementation to use existing shared library.
--
Change by ZetaSQL Team <[email protected]>:
Add support for null handling in the AggregateFunctionEvaluator interface
--
Change by ZetaSQL Team <[email protected]>:
No public description
--
Change by ZetaSQL Team <[email protected]>:
No public description
--
Change by ZetaSQL Team <[email protected]>:
No public description
--
Change by ZetaSQL Team <[email protected]>:
Simplify logic for CASE expression formatting.
--
Change by ZetaSQL Team <[email protected]>:
No public description
--
Change by ZetaSQL Team <[email protected]>:
No public description
--
Change by ZetaSQL Team <[email protected]>:
No public description
--
Change by ZetaSQL Team <[email protected]>:
Do not include internal alias in UserFacingName for table argument.
--
Change by ZetaSQL Team <[email protected]>:
Adding utility functions `GreaterOrEqual` and `Subtract` to the rewriter utils.
--
Change by ZetaSQL Team <[email protected]>:
No public description
--
Change by ZetaSQL Team <[email protected]>:
No public description
--
Change by ZetaSQL Team <[email protected]>:
No public description
--
Change by ZetaSQL Team <[email protected]>:
Bugfix for JSON_ARRAY_APPEND and JSON_ARRAY_INSERT.
--
Change by ZetaSQL Team <[email protected]>:
No public description
--
Change by Richard Levasseur <[email protected]>:
No public description
--
Change by ZetaSQL Team <[email protected]>:
Added alias validation for function signatures.
--
Change by ZetaSQL Team <[email protected]>:
Add test coverage for conditional evaluation in WITH queries and WITH expressions.
--
Change by ZetaSQL Team <[email protected]>:
Add language feature to support multiway explicit UNNEST syntax
--
Change by ZetaSQL Team <[email protected]>:
Added a new language feature FEATURE_V_1_4_ARRAY_ZIP for the array_zip function.
--
Change by ZetaSQL Team <[email protected]>:
No public description
--
Change by ZetaSQL Team <[email protected]>:
Add a test case for conditional_evaluation on PIVOT and UNPIVOT
--
Change by ZetaSQL Team <[email protected]>:
No public description
--
Change by ZetaSQL Team <[email protected]>:
Add test coverage for anonymization with conditional evaluation
--
Change by ZetaSQL Team <[email protected]>:
No public description
--
Change by ZetaSQL Team <[email protected]>:
Replace CHECK with Status return in builtin function registry
--
Change by ZetaSQL Team <[email protected]>:
No public description
--
Change by ZetaSQL Team <[email protected]>:
No public description
--
Change by ZetaSQL Team <[email protected]>:
Added alias validation for function signatures.
--
Change by ZetaSQL Team <[email protected]>:
No public description
--
Change by ZetaSQL Team <[email protected]>:
No public description
--
Change by ZetaSQL Team <[email protected]>:
Move SetFormatValueContentOptions to SQLTestBase protected section.
--
Change by ZetaSQL Team <[email protected]>:
No public description
--
Change by ZetaSQL Team <[email protected]>:
No public description
--
Change by ZetaSQL Team <[email protected]>:
No public description
--
Change by ZetaSQL Team <[email protected]>:
No public description
--
Change by ZetaSQL Team <[email protected]>:
Moved `GetAliasForExpression` from the resolver code to resolved_ast_helper.h.
--
Change by ZetaSQL Team <[email protected]>:
No public description
--
Change by ZetaSQL Team <[email protected]>:
Added function_signature_testutil.cc to zetasql allowlist.
--
Change by ZetaSQL Team <[email protected]>:
Added function_signature_testutil.h into zetasql allowlist.
--
Change by ZetaSQL Team <[email protected]>:
No public description
--
Change by ZetaSQL Team <[email protected]>:
No public description
--
Change by ZetaSQL Team <[email protected]>:
No public description
--
Change by ZetaSQL Team <[email protected]>:
No public description
--
Change by ZetaSQL Team <[email protected]>:
No public description
--
Change by ZetaSQL Team <[email protected]>:
No public description
--
Change by ZetaSQL Team <[email protected]>:
No public description
--
Change by ZetaSQL Team <[email protected]>:
No public description
--
Change by ZetaSQL Team <[email protected]>:
Unify ReferenceDriver constructors.
--
Change by ZetaSQL Team <[email protected]>:
Cleanup some calls to MaybeUpdateErrorMessageWithLocation() with explicit values for keep_error_location_payload.
--
Change by ZetaSQL Team <[email protected]>:
No public description
--
Change by ZetaSQL Team <[email protected]>:
Add collation support for NULLIF function in the reference implementation.
--
Change by ZetaSQL Team <[email protected]>:
No public description
--
Change by Richard Levasseur <[email protected]>:
No public description
--
Change by ZetaSQL Team <[email protected]>:
Add reference implementation of UDFs and templated UDFs without rewriter.
--
Change by ZetaSQL Team <[email protected]>:
Add node_source to ResolvedArrayScan for single table array path shape
--
Change by ZetaSQL Team <[email protected]>:
No public description
--
Change by ZetaSQL Team <[email protected]>:
No public description
--
Change by ZetaSQL Team <[email protected]>:
No public description
--
Change by ZetaSQL Team <[email protected]>:
No public description
--
Change by ZetaSQL Team <[email protected]>:
No public description
--
Change by ZetaSQL Team <[email protected]>:
Clean up deprecated function signature.
--
Change by ZetaSQL Team <[email protected]>:
Add topologically sorted generated columns information to the ResolvedInsertStmt.
--
Change by ZetaSQL Team <[email protected]>:
Add a note about module support in docs for UDFs, TVFs, and UDAs.
--
Change by ZetaSQL Team <[email protected]>:
No public description
  (And 57 more changes)

GitOrigin-RevId: 2ff92e98da5ba81417caa763616253336d7d8407
Change-Id: Ib851d471d1bd3d96a36e4996ab25d5c7d381c27b
  • Loading branch information
ZetaSQL Team authored and KimiWaRokkuWoKikanai committed Sep 5, 2023
1 parent 54d659f commit 0b082e8
Show file tree
Hide file tree
Showing 294 changed files with 33,705 additions and 5,209 deletions.
24 changes: 12 additions & 12 deletions docs/aggregate_functions.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ To learn about the syntax for aggregate function calls, see

</td>
<td>
Returns an expression for some row.
Gets an expression for some row.
</td>
</tr>

Expand All @@ -33,7 +33,7 @@ To learn about the syntax for aggregate function calls, see

</td>
<td>
Returns an array of values.
Gets an array of values.
</td>
</tr>

Expand All @@ -51,7 +51,7 @@ To learn about the syntax for aggregate function calls, see

</td>
<td>
Returns the average of non-<code>NULL</code> values.
Gets the average of non-<code>NULL</code> values.
</td>
</tr>

Expand Down Expand Up @@ -87,7 +87,7 @@ To learn about the syntax for aggregate function calls, see

</td>
<td>
Returns the number of rows in the input, or the number of rows with an
Gets the number of rows in the input, or the number of rows with an
expression evaluated to any value other than <code>NULL</code>.
</td>
</tr>
Expand All @@ -97,7 +97,7 @@ To learn about the syntax for aggregate function calls, see

</td>
<td>
Returns the count of <code>TRUE</code> values for an expression.
Gets the count of <code>TRUE</code> values for an expression.
</td>
</tr>

Expand All @@ -106,7 +106,7 @@ To learn about the syntax for aggregate function calls, see

</td>
<td>
Returns the logical AND of all non-<code>NULL</code> expressions.
Gets the logical AND of all non-<code>NULL</code> expressions.
</td>
</tr>

Expand All @@ -115,7 +115,7 @@ To learn about the syntax for aggregate function calls, see

</td>
<td>
Returns the logical OR of all non-<code>NULL</code> expressions.
Gets the logical OR of all non-<code>NULL</code> expressions.
</td>
</tr>

Expand All @@ -124,7 +124,7 @@ To learn about the syntax for aggregate function calls, see

</td>
<td>
Returns the maximum non-<code>NULL</code> value.
Gets the maximum non-<code>NULL</code> value.
</td>
</tr>

Expand All @@ -133,7 +133,7 @@ To learn about the syntax for aggregate function calls, see

</td>
<td>
Returns the minimum non-<code>NULL</code> value.
Gets the minimum non-<code>NULL</code> value.
</td>
</tr>

Expand All @@ -142,8 +142,8 @@ To learn about the syntax for aggregate function calls, see

</td>
<td>
Returns a <code>STRING</code> or <code>BYTES</code> value obtained by
concatenating non-<code>NULL</code> values.
Concatenates non-<code>NULL</code> <code>STRING</code> or
<code>BYTES</code> values.
</td>
</tr>

Expand All @@ -152,7 +152,7 @@ To learn about the syntax for aggregate function calls, see

</td>
<td>
Returns the sum of non-<code>NULL</code> values.
Gets the sum of non-<code>NULL</code> values.
</td>
</tr>

Expand Down
8 changes: 4 additions & 4 deletions docs/approximate_aggregate_functions.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ sketches. If you would like to specify precision with sketches, see:

</td>
<td>
Returns the approximate result for <code>COUNT(DISTINCT expression)</code>.
Gets the approximate result for <code>COUNT(DISTINCT expression)</code>.
</td>
</tr>

Expand All @@ -49,7 +49,7 @@ sketches. If you would like to specify precision with sketches, see:

</td>
<td>
Returns the approximate quantile boundaries.
Gets the approximate quantile boundaries.
</td>
</tr>

Expand All @@ -58,7 +58,7 @@ sketches. If you would like to specify precision with sketches, see:

</td>
<td>
Returns the approximate top elements and their approximate count.
Gets the approximate top elements and their approximate count.
</td>
</tr>

Expand All @@ -67,7 +67,7 @@ sketches. If you would like to specify precision with sketches, see:

</td>
<td>
Returns the approximate top elements and sum, based on the approximate sum
Gets the approximate top elements and sum, based on the approximate sum
of an assigned weight.
</td>
</tr>
Expand Down
10 changes: 5 additions & 5 deletions docs/array_functions.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ ZetaSQL supports the following array functions.

</td>
<td>
Checks to see if there is an element in the array that is
Checks if there is an element in the array that is
equal to a search value.
</td>
</tr>
Expand All @@ -79,7 +79,7 @@ ZetaSQL supports the following array functions.

</td>
<td>
Checks to see if all search values are in an array.
Checks if all search values are in an array.
</td>
</tr>

Expand All @@ -88,7 +88,7 @@ ZetaSQL supports the following array functions.

</td>
<td>
Checks to see if any search values are in an array.
Checks if any search values are in an array.
</td>
</tr>

Expand All @@ -97,7 +97,7 @@ ZetaSQL supports the following array functions.

</td>
<td>
Checks to see if an array contains no repeated elements.
Checks if an array contains no repeated elements.
</td>
</tr>

Expand Down Expand Up @@ -151,7 +151,7 @@ ZetaSQL supports the following array functions.

</td>
<td>
Returns an array containing zero or more consecutive elements from an
Produces an array containing zero or more consecutive elements from an
input array.
</td>
</tr>
Expand Down
115 changes: 65 additions & 50 deletions docs/data-types.md
Original file line number Diff line number Diff line change
Expand Up @@ -1416,31 +1416,40 @@ Where:
#### Example

```sql
NEW Universe {
name: "Sol"
closest_planets: ["Mercury", "Venus", "Earth" ]
star {
radius_miles: 432,690
age: 4,603,000,000
NEW zetasql.examples.astronomy.Planet {
planet_name: 'Jupiter'
facts: {
length_of_day: 9.93
distance_to_sun: 5.2 * ASTRONOMICAL_UNIT
has_rings: TRUE
}
constellations [{
name: "Libra"
index: 0
}, {
name: "Scorpio"
index: 1
}]
planet_distances: [{
key: "Mercury"
distance: 46,507,000
}, {
key: "Venus"
distance: 107,480,000
}],
major_moons: [
{ moon_name: 'Io' },
{ moon_name: 'Europa' },
{ moon_name: 'Ganymede' },
{ moon_name: 'Callisto'}
]
minor_moons: (
SELECT ARRAY_AGG(moon_name)
FROM SolarSystemMoons
WHERE
planet_name = 'Jupiter'
AND circumference < 3121
)
count_of_space_probe_photos: (
GALILEO_PHOTOS
+ JUNO_PHOTOS
+ NEW_HORIZONS_PHOTOS
+ CASSINI_PHOTOS
+ ULYSSES_PHOTOS
+ VOYAGER_1_PHOTOS
+ VOYAGER_2_PHOTOS
+ PIONEER_10_PHOTOS
+ PIONEER_11_PHOTOS
),
(UniverseExtraInfo.extension) {
...
}
all_planets: (SELECT planets FROM SolTable)
}
```

Expand Down Expand Up @@ -1480,20 +1489,20 @@ Simple:
SELECT
key,
name,
NEW zetasql.examples.music.Chart { rank: 1 chart_name: "2" }
NEW zetasql.examples.music.Chart { rank: 1 chart_name: '2' }
```

Nested messages and arrays:

```sql
SELECT
NEW zetasql.examples.music.Album {
album_name: "New Moon"
album_name: 'New Moon'
singer {
nationality: "Canadian"
residence: [{ city: "Victoria" }, { city: "Toronto" }]
nationality: 'Canadian'
residence: [ { city: 'Victoria' }, { city: 'Toronto' } ]
}
song: ["Sandstorm","Wait"]
song: ['Sandstorm', 'Wait']
}
```

Expand All @@ -1502,81 +1511,87 @@ With an extension field (note a comma is required before the extension field):
```sql
SELECT
NEW zetasql.examples.music.Album {
album_name: "New Moon",
album_name: 'New Moon',
(zetasql.examples.music.downloads): 30
}
```

Non-literal expressions as values:

```sql
SELECT NEW zetasql.examples.music.Chart {
rank: (SELECT COUNT(*) FROM table_name WHERE foo="bar")
chart_name: CONCAT("best", "hits")
}
SELECT
NEW zetasql.examples.music.Chart {
rank: (SELECT COUNT(*) FROM TableName WHERE foo = 'bar')
chart_name: CONCAT('best', 'hits')
}
```

Examples of the type protocol buffer being inferred from context:

+ From `ARRAY` constructor:

```sql
SELECT ARRAY<zetasql.examples.music.Chart>[
{ rank: 1 chart_name: "2" },
{ rank: 2 chart_name: "3" }]
SELECT
ARRAY<zetasql.examples.music.Chart>[
{ rank: 1 chart_name: '2' },
{ rank: 2 chart_name: '3' }]
```
+ From `STRUCT` constructor:

```sql
SELECT STRUCT<STRING,zetasql.examples.music.Chart,INT64>
("foo", { rank: 1 chart_name: "2" }, 7)
SELECT
STRUCT<STRING, zetasql.examples.music.Chart, INT64>(
'foo', { rank: 1 chart_name: '2' }, 7)
```
+ From column names through `SET`:

+ Simple column:

```sql
UPDATE table_name SET ProtoColumn = { rank: 1 chart_name: "2" }
UPDATE TableName SET proto_column = { rank: 1 chart_name: '2' }
```

+ Array column:

```sql
UPDATE table_name SET ProtoArrayColumn =
[{ rank: 1 chart_name: "2" }, { rank: 2 chart_name: "3" }]
UPDATE TableName
SET proto_array_column = [
{ rank: 1 chart_name: '2' }, { rank: 2 chart_name: '3' }]
```

+ Struct column:

```sql
UPDATE table_name SET ProtoStructColumn =
("foo", { rank: 1 chart_name: "2" }, 7)
UPDATE TableName
SET proto_struct_column = ('foo', { rank: 1 chart_name: '2' }, 7)
```
+ From generated column names in `CREATE`:

```sql
CREATE TABLE T (
IntColumn INT32,
ProtoColumn zetasql.examples.music.Chart AS ({ rank: 1 chart_name: "2" })
CREATE TABLE TableName (
proto_column zetasql.examples.music.Chart AS ({ rank: 1 chart_name: '2' })
)
```
+ From column names in default values in `CREATE`:

```sql
CREATE TABLE T (
IntColumn INT32,
ProtoColumn zetasql.examples.music.Chart DEFAULT ({ rank: 1 chart_name: "2" })
)
CREATE TABLE TableName(
proto_column zetasql.examples.music.Chart
DEFAULT({ rank: 1 chart_name: '2' }))
```
+ From return types in SQL function body:

```sql
CREATE FUNCTION myfunc ( ) RETURNS zetasql.examples.music.Chart AS ({ rank: 1 chart_name: "2" })
CREATE FUNCTION MyFunc()
RETURNS zetasql.examples.music.Chart
AS (
{ rank: 1 chart_name: '2' }
)
```
+ From system variable type:

```sql
SET @@proto_system_variable = { rank: 1 chart_name: "2" }
SET @@proto_system_variable = { rank: 1 chart_name: '2' }
```

#### `NEW protocol_buffer (...)`
Expand Down
Loading

0 comments on commit 0b082e8

Please sign in to comment.