adityavaish opened a new pull request, #60141:
URL: https://github.com/apache/spark/pull/60141

   ### What changes were proposed in this pull request?
   
   Clarify the existing difference between seconds-extraction functions in the 
SQL function documentation and PySpark API docstrings:
   
   - `second()` returns an integer and discards fractional seconds.
   - `EXTRACT(SECOND FROM ...)`, `date_part('SECOND', ...)`, and the `datepart` 
alias return a decimal including fractional seconds.
   
   Add cross-references so users can choose the function that preserves the 
precision they need. No implementation or return types are changed.
   
   ### Why are the changes needed?
   
   The different return types can appear inconsistent without an explicit 
explanation. These documentation updates clarify that the existing behavior is 
intentional.
   
   Addresses the documentation ambiguity raised in 
https://github.com/apache/spark/issues/57535.
   
   ### Does this PR introduce _any_ user-facing change?
   
   No. This is a documentation-only clarification; runtime behavior is 
unchanged.
   
   ### How was this patch tested?
   
   Reviewed the documentation against the existing implementations: `Second` 
and `SecondsOfTime` return integers, while the `SECOND` extraction paths use 
decimal results that retain fractional seconds.
   
   `git diff --check` passes. No tests were added or run because only 
documentation strings were changed, with no executable code or examples 
modified.
   
   ### Was this patch authored or co-authored using generative AI tooling?
   
   Generated-by: GitHub Copilot App 1.0.102-0.unstable.r41779900948.gf482387
   
   This patch was authored with generative AI assistance from GitHub Copilot, 
powered by GPT-6.1 Sol. AI assistance was used to investigate the existing 
behavior and draft the documentation changes and pull request description.


-- 
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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to