raminqaf opened a new pull request, #30191:
URL: https://github.com/apache/flink/pull/30191

   ## What is the purpose of the change
   
   Step 4 of FLINK-23804, after #30185: every aggregate and bitmap function 
gets a page of its own, generated from YAML. Each page was rechecked against 
the implementation, and every example result comes from running its SQL in 
batch and streaming mode. The recheck changed what the docs say, for example:
   
   | Function         | Old docs                                                
                          | Master                                              
                                                     |
   
|------------------|-----------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------|
   | `AVG`            | "returns the average (arithmetic mean) of expression 
across all input rows"       | The result keeps an integer type: `AVG` of `1` 
and `2` is `1`. Next to `STDDEV_POP(c)`, `AVG(c)` over `2147483647` twice is 
`-1` |
   | `VAR_SAMP`       | "returns the sample variance (square of the sample 
standard deviation)"           | `-1.0` instead of NULL for a group of one row 
over a NOT NULL input                                      |
   | `COUNT`          | `COUNT(DISTINCT expression1 [, expression2]*)`          
                          | `COUNT(DISTINCT a, b)` fails at planning            
                                                     |
   | `GROUP_ID`       | "Returns an integer that uniquely identifies the 
combination of grouping keys."   | `0` for the first occurrence of a grouping 
set and `1`, `2`, ... for repeats. `GROUPING_ID` identifies the keys |
   | `BITMAP_XOR_AGG` | "Aggregates the XOR (symmetric difference) of multiple 
bitmaps."                  | Keeps the values that occur in an odd number of 
bitmaps, so a value in three bitmaps stays               |
   
   ## Brief change log
   
   - Add 21 aggregate pages, including the grouping functions, and 18 bitmap 
pages, one commit per category. Every row of the four tables now points at a 
page.
   - `COUNT` covers `COUNT(expr)` and `COUNT(*)`, and `GROUPING` and 
`GROUPING_ID` share a page. The Table API-only `sum0` gets a page of its own, 
so the 40 rows have 39 pages.
   - Arguments are named after their role: `expr`, `separator`, `percentage` 
and `frequency`, `key_expr` and `value_expr`, `bitmap1` and `bitmap2`, 
`int_array`. The Table API column shows the Java calls.
   - The Bitmap page now says once that a `COALESCE`, `CASE`, `UNION ALL` or 
multi-row `VALUES` fails when it combines a nullable and a NOT NULL bitmap.
   - The see-also links of `JSON_OBJECT`, `JSON_ARRAY`, `GREATEST` and `LEAST` 
point at the new pages. The Chinese bitmap aggregate heading gets the English 
anchor the pages link to.
   - Chinese pages show the English sections. Where a row had a Chinese 
description, its first sentence becomes the summary, except for five summaries 
that contradicted their page. This drops 950 of the 1538 Chinese characters of 
the four tables. FLINK-41730 translates these pages, as FLINK-41717 does for 
the mathematical functions.
   
   ## Verifying this change
   
   This change is documentation only.
   
   - Every SQL example ran in batch and streaming mode on master with a local 
runner, which isn't part of this PR. The results on the pages are pasted from 
those runs.
   - A second review checked each statement against the type strategies, 
`AggFunctionFactory`, the runtime classes and the tests. A third pass removed 
what the reviews of #29864 and #30033 asked to leave out.
   - Hugo 0.126.3 builds both languages without warnings. A link check finds no 
new broken internal links. Every commit builds on its own.
   
   The recheck found bugs in the code, which this PR doesn't fix. The pages 
describe the current behavior, also where it's a bug that users would plausibly 
hit, such as the `AVG` and `VAR_SAMP` results above, or a streaming OVER window 
ordered by a non-time attribute, where several aggregates return wrong results. 
The pages name no tickets. I'll file the bugs separately.
   
   ## Does this pull request potentially affect one of the following parts:
   
     - Dependencies (does it add or upgrade a dependency): no
     - The public API, i.e., is any changed class annotated with 
`@Public(Evolving)`: no
     - The serializers: no
     - The runtime per-record code paths (performance sensitive): no
     - Anything that affects deployment or recovery: JobManager (and its 
components), Checkpointing, Kubernetes/Yarn, ZooKeeper: no
     - The S3 file system connector: no
   
   ## Documentation
   
     - Does this pull request introduce a new feature? no
     - If yes, how is the feature documented? not applicable
   
   ---
   
   ##### Was generative AI tooling used to co-author this PR?
   
   - [X] Yes (please specify the tool below)
   
   Generated-by: Claude Code 2.1.332 (Claude Opus 5.5)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to