raminqaf opened a new pull request, #30185:
URL: https://github.com/apache/flink/pull/30185
## What is the purpose of the change
Step 3 of FLINK-23804, continued after #30033: every mathematical function
and operator 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
|
|----------|------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------|
| `ROUND` | "Returns a number rounded to INT decimal places for NUMERIC."
| `ROUND(12.345, n)` returns `0.123` for a column `n` of `1`. A
literal `1` gives `12.3` |
| `*` | "Returns NUMERIC1 multiplied by NUMERIC2"
| A `FLOAT` times a `DOUBLE` is a `FLOAT`, so `1.5 * 1E300` is
`Infinity`. The other order is a `DOUBLE` |
| `+` | "Returns NUMERIC1 plus NUMERIC2."
| `2147483647 + 1` is `-2147483648` for two `INT` operands,
without an error |
| `LOG` | "numeric2 must be greater than 0 and numeric1 must be greater
than 1." | A base below 1 works, and a base of 1, a zero or a negative
value returns `Infinity`, `-Infinity` or `NaN` |
| `ATAN2` | "Returns the arc tangent of a coordinate (NUMERIC1, NUMERIC2)."
| `ATAN2(y, 1.0)` fails at planning for an `INT` column `y`, since
`1.0` is a `DECIMAL` |
## Brief change log
- The first commit corrects the "XML and VARIANT" page after FLINK-41591
(#30051): `PARSE_XML` keeps the nanoseconds of a `dateTime` from `1677-09-21
00:12:43.145224192`, not from `00:12:44`.
- Add 32 pages. Every row of the category now points at a page.
- The arithmetic operators share one page: unary `+` and `-`, and binary
`+`, `-`, `*` and `/`, like Snowflake. `MOD` and `%` share a page, and so do
`CEIL` and `CEILING`. The rows of `MOD` and `%` are now separate, so the table
has 40 rows instead of 39.
- Arguments are named after their role: `x` for a single number, as DuckDB
names it, `ATAN2(y, x)`, `dividend` and `divisor`, `base` and `exponent`,
`digits`, `seed` and `bound`. The Table API column shows the Java calls instead
of the Scala ones, such as `expr1.plus(expr2)` for `NUMERIC1 + NUMERIC2`.
- Chinese pages show the English sections. Where a row had a Chinese
description, its first sentence becomes the summary. This drops 276 of the 589
Chinese characters of the category. FLINK-41717 translates these pages, as
FLINK-41529 and FLINK-41590 do for the earlier categories.
## 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 generators, the runtime code and the tests. A third pass removed what the
reviews of #29864 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 `ROUND` result above. The pages name no tickets. FLINK-41726
covers the `ROUND` result, and its fix will update the page. I'll file the
other 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]