Skip to content

[MINOR][SQL] Fix incorrect scaladoc in functions.scala#57334

Open
LuciferYang wants to merge 1 commit into
apache:masterfrom
LuciferYang:SPARK-functions-scaladoc
Open

[MINOR][SQL] Fix incorrect scaladoc in functions.scala#57334
LuciferYang wants to merge 1 commit into
apache:masterfrom
LuciferYang:SPARK-functions-scaladoc

Conversation

@LuciferYang

@LuciferYang LuciferYang commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

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)

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`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants