-
Notifications
You must be signed in to change notification settings - Fork 28k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[MINOR][SQL][DOCS] consistency in argument naming for time functions #29007
Conversation
Test build #125030 has finished for PR 29007 at commit
|
Jenkins retest this please |
OK, probably fine if it's just docs and for consistency. That's all of them? |
Test build #125088 has started for PR 29007 at commit |
In fact I found one more (in Pattern searched:
|
test this please |
Test build #125095 has finished for PR 29007 at commit
|
Test build #125105 has finished for PR 29007 at commit
|
May I suggest going the other way, i.e., avoiding abbreviation? I don't think there's any value in abbreviating, other than that it makes the argument's meaning less immediately clear. |
Further, spelled-out I chose to abbreviate because it was easier for my use case -- |
Thinking about this some more, there may actually be something more important, which is compatibility with named arguments. The names in the docs should probably match the names in the code. And we can't change the names in the code because of API compatibility -- existing callers may refer to them using named arguments. |
Note that this PR only changes the docstrings in the SQL API, AFAIK SQL doesn't support named arguments |
People don't use those references for non-SQL calls? |
no, since there are subtle but important differences and the respective APIs are easy to find right alongside one another on the Spark docs website. I can personally assure I read R for R reference, SQL for SQL reference, and Python for python reference. I also see headings for Java and Scala referenced in the same directory, but I rarely use those APIs so can't personally say I use them. |
I also prefer 'format' in general, but if this change is the smaller one, let's just do it rather than argue it much more. Someone can bulk change it again to format if desired. |
Jenkins test this please |
Test build #125483 has started for PR 29007 at commit |
Jenkins test this please |
Test build #125685 has finished for PR 29007 at commit
|
Merged to master |
What changes were proposed in this pull request?
Rename documented argument
format
asfmt
, to match the same argument name in several other SQL date/time functions, to wit,date_format
,date_trunc
,trunc
,to_date
, andto_timestamp
all usefmt
. Alsoformat_string
andprintf
use the same abbreviation in their argumentstrfmt
.Why are the changes needed?
Consistency -- I was trying to scour the documentation for functions with arguments using Java string formatting, it would have been nice to rely on searching for
fmt
instead of my more manual approach.Does this PR introduce any user-facing change?
In the documentation only
How was this patch tested?
No tests