[MINOR][SQL] Fix incorrect scaladoc in functions.scala#57334
Closed
LuciferYang wants to merge 1 commit into
Closed
[MINOR][SQL] Fix incorrect scaladoc in functions.scala#57334LuciferYang wants to merge 1 commit into
LuciferYang wants to merge 1 commit into
Conversation
Corrects copy-paste scaladoc defects in `functions.scala` where the text contradicts the function signature or semantics: - `regr_avgy`: "average of the independent variable" -> "dependent variable" (it averages `y`, the dependent variable; pasted from `regr_avgx`). - `any_value(e, ignoreNulls)`: prose referenced `isIgnoreNull` -> `ignoreNulls`. - `ceil(columnName)`: referenced `e` (a param of the sibling overload) -> `columnName`. - `bitmap_bit_position` / `bitmap_bucket_number`: the two summaries were transposed; aligned each with its catalyst expression. - `datediff` / `date_diff`: examples called `dateddiff` (nonexistent) -> the actual function name. - `to_timestamp_ltz` (both overloads): "to a timestamp without time zone" -> "with local time zone" (LTZ builds TimestampType; pasted from the ntz docs). - `reduce` (both overloads): examples called `aggregate` -> `reduce`.
HyukjinKwon
approved these changes
Jul 19, 2026
LuciferYang
added a commit
that referenced
this pull request
Jul 20, 2026
### What changes were proposed in this pull request? Corrects copy-paste scaladoc defects in `sql/api`'s `functions.scala` where the doc text contradicts the function signature or the function's actual semantics: - `regr_avgy`: "average of the independent variable" -> "dependent variable" (it averages `y`, which the same sentence defines as the dependent variable; the summary was pasted from `regr_avgx`). - `any_value(e, ignoreNulls)`: the description referenced `isIgnoreNull`, which is not a parameter -> `ignoreNulls`. - `ceil(columnName)`: referenced `` `e` `` (the parameter of the `ceil(e: Column)` overload) -> `columnName`; matches the corrected `floor(columnName)` sibling. - `bitmap_bit_position` / `bitmap_bucket_number`: the two summaries were transposed; each is now aligned with its catalyst expression (`BitmapBitPosition` / `BitmapBucketNumber`). - `datediff` / `date_diff`: the examples called `dateddiff(...)` (a nonexistent function) -> the actual function name. - `to_timestamp_ltz` (both overloads): "to a timestamp without time zone" -> "with local time zone". The builder injects `TimestampType` (TIMESTAMP WITH LOCAL TIME ZONE); the wording was pasted from the adjacent `to_timestamp_ntz` docs. - `reduce` (both overloads): the examples called `aggregate(...)` -> `reduce(...)`. ### Why are the changes needed? The scaladoc misdescribes these functions. Most are harmless wrong names in examples, but `to_timestamp_ltz` documenting "without time zone" actively misleads about the return type (it produces a timestamp with local time zone), and the transposed `bitmap_*` summaries point users to the wrong function. ### Does this PR introduce _any_ user-facing change? No. Documentation-only change to scaladoc comments. ### How was this patch tested? No tests; scaladoc-only change. Each correction was verified against the function signature and, where semantics were involved (`to_timestamp_ltz`, `bitmap_*`), against the corresponding catalyst expression builder/definition. Checked the changed lines stay within 100 chars and introduce no non-ASCII characters. ### Was this patch authored or co-authored using generative AI tooling? Generated-by: Claude Code (Opus 4.8) Closes #57334 from LuciferYang/SPARK-functions-scaladoc. Authored-by: YangJie <yangjie01@baidu.com> Signed-off-by: yangjie01 <yangjie01@baidu.com> (cherry picked from commit 9bef20c) Signed-off-by: yangjie01 <yangjie01@baidu.com>
Contributor
Author
Contributor
Author
|
Merged into master/branch-4.x. Thanks @HyukjinKwon |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changes were proposed in this pull request?
Corrects copy-paste scaladoc defects in
sql/api'sfunctions.scalawhere the doc text contradicts the function signature or the function's actual semantics:regr_avgy: "average of the independent variable" -> "dependent variable" (it averagesy, which the same sentence defines as the dependent variable; the summary was pasted fromregr_avgx).any_value(e, ignoreNulls): the description referencedisIgnoreNull, which is not a parameter ->ignoreNulls.ceil(columnName): referenced`e`(the parameter of theceil(e: Column)overload) ->columnName; matches the correctedfloor(columnName)sibling.bitmap_bit_position/bitmap_bucket_number: the two summaries were transposed; each is now aligned with its catalyst expression (BitmapBitPosition/BitmapBucketNumber).datediff/date_diff: the examples calleddateddiff(...)(a nonexistent function) -> the actual function name.to_timestamp_ltz(both overloads): "to a timestamp without time zone" -> "with local time zone". The builder injectsTimestampType(TIMESTAMP WITH LOCAL TIME ZONE); the wording was pasted from the adjacentto_timestamp_ntzdocs.reduce(both overloads): the examples calledaggregate(...)->reduce(...).Why are the changes needed?
The scaladoc misdescribes these functions. Most are harmless wrong names in examples, but
to_timestamp_ltzdocumenting "without time zone" actively misleads about the return type (it produces a timestamp with local time zone), and the transposedbitmap_*summaries point users to the wrong function.Does this PR introduce any user-facing change?
No. Documentation-only change to scaladoc comments.
How was this patch tested?
No tests; scaladoc-only change. Each correction was verified against the function signature and, where semantics were involved (
to_timestamp_ltz,bitmap_*), against the corresponding catalyst expression builder/definition. Checked the changed lines stay within 100 chars and introduce no non-ASCII characters.Was this patch authored or co-authored using generative AI tooling?
Generated-by: Claude Code (Opus 4.8)