HyukjinKwon commented on a change in pull request #28365:
URL: https://github.com/apache/spark/pull/28365#discussion_r415660015
##########
File path: R/pkg/R/DataFrame.R
##########
@@ -2587,18 +2589,18 @@ setMethod("join",
if (is.null(joinType)) {
sdf <- callJMethod(x@sdf, "join", y@sdf, joinExpr@jc)
} else {
- if (joinType %in% c("inner", "cross",
+ valid_join_types <- c("inner", "cross",
"outer", "full", "fullouter", "full_outer",
"left", "leftouter", "left_outer",
"right", "rightouter", "right_outer",
- "semi", "left_semi", "leftsemi", "anti", "left_anti",
"leftanti")) {
+ "semi", "left_semi", "leftsemi", "anti", "left_anti",
"leftanti")
+ if (joinType %in% valid_join_types) {
joinType <- gsub("_", "", joinType)
sdf <- callJMethod(x@sdf, "join", y@sdf, joinExpr@jc,
joinType)
} else {
- stop(paste("joinType must be one of the following types:",
- "'inner', 'cross', 'outer', 'full', 'fullouter',
'full_outer',",
- "'left', 'leftouter', 'left_outer', 'right',
'rightouter', 'right_outer',",
- "'semi', 'leftsemi', 'left_semi', 'anti', 'leftanti' or
'left_anti'."))
+ stop(gettextf("joinType must be one of the following types:
'%s'",
Review comment:
Can we don't use `gettextf`? I think we can just do it with paste.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]