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

   ## What is the purpose of the change
   
   Step 5 of FLINK-23804, after #30191: every string and binary 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                                        
                                                             |
   
|-----------|------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------|
   | `LPAD`    | "If the length of string1 is shorter than integer, returns 
string1 shortened to integer characters." | A string longer than `len` is cut: 
`LPAD('hello', 2, '*')` is `he`. A negative `len` returns NULL, and with NOT 
NULL arguments that NULL fails the query |
   | `TRIM`    | "By default, whitespaces at both sides are removed."           
                                | Only the space is removed. A tab or a line 
break stays                                                     |
   | `OVERLAY` | "replaces INT2 (STRING2's length by default) characters of 
STRING1 with STRING2 from position INT1" | `FOR 0` drops the rest of the 
string: `OVERLAY('abcde' PLACING 'X' FROM 2 FOR 0)` is `aX`, not `aXbcde`   |
   | `ASCII`   | "Returns the numeric value of the first character of string."  
                                | For a character outside ASCII, the first 
UTF-8 byte as a signed number: `ASCII('é')` is `-61`             |
   | `ELT`     | `index <TINYINT \| SMALLINT \| INTEGER \| BIGINT>`             
                                | Only an `INT` index works. A `TINYINT`, 
`SMALLINT` or `BIGINT` index fails at runtime                      |
   
   ## Brief change log
   
   - Add 51 pages, one per row of the String & Binary table, and point every 
row at its page.
   - The concatenation operator `||` gets a page of its own next to `CONCAT`, 
since the two differ in arity and result type. `SUBSTRING` and `SUBSTR` keep 
separate pages.
   - Arguments are named after their role: `str`, `search_str`, `start_pos`, 
`pos` and `len`, `pad_str`, `trim_str`, `delim`, `sep`, `charset`, `bytes` and 
`num`. The Table API column shows the Java calls.
   - Chinese pages show the English sections. Where a row had a Chinese 
description, its first sentence becomes the summary, except for seven summaries 
that contradicted their page. This drops 1063 of the 1700 Chinese characters of 
the table. FLINK-41738 translates these pages, as FLINK-41730 does for the 
aggregate 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, the 
code generation, 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.
   
   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 `OVERLAY` and `ASCII` results above, `UNHEX` dropping the 
first digit of an odd-length string, or a `BIGINT` length or position, which 
fails the query in twelve functions. 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