-
Notifications
You must be signed in to change notification settings - Fork 28.1k
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
[SPARK-10049][SPARKR] Support collecting data of ArraryType in DataFrame. #8458
Conversation
Test build #41620 timed out for PR 8458 at commit |
Test build #41621 has finished for PR 8458 at commit
|
cc @davies |
Test build #41678 has finished for PR 8458 at commit
|
Test build #41683 has finished for PR 8458 at commit
|
Test build #41723 has finished for PR 8458 at commit
|
@sun-rui I'll take a look at this tomorrow |
@@ -49,7 +49,7 @@ infer_type <- function(x) { | |||
stopifnot(length(x) > 0) | |||
names <- names(x) | |||
if (is.null(names)) { | |||
list(type = "array", elementType = infer_type(x[[1]]), containsNull = TRUE) | |||
paste0("array<", infer_type(x[[1]]), ">") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just to clarify this is to support vectors of the form c(1, 2, 3)
etc. ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is for list. Next changed one is for vector.
Test build #42033 has finished for PR 8458 at commit
|
Test build #42065 has finished for PR 8458 at commit
|
val parameterTypes = parameterTypesOfMethods(index) | ||
|
||
if (parameterTypes.length == numArgs) { | ||
val convertedArgs = new Array[Object](numArgs) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there any reason we shouldn't modify args
in place and make a copy ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Arg is checked and converted one by one when matching a method. It is possible that after some args were converted, an arg fails, then all args have to be reverted to the original ones for matching next method.
It could be possible for now that checking all args for one method, and only after the checking passes, then do conversion, thus we can modify args in place.
I will refine the code.
Test build #42188 has finished for PR 8458 at commit
|
args: Array[Object]): Option[Int] = { | ||
val numArgs = args.length | ||
|
||
for (index <- 0 to parameterTypesOfMethods.length - 1) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
0 until xxx
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
@sun-rui The changes looks good to me overall, just two minor comments, thanks! |
Test build #42228 has finished for PR 8458 at commit
|
Test build #42252 has finished for PR 8458 at commit
|
Jenkins, retest this please |
Test build #42272 has finished for PR 8458 at commit
|
Thanks @sun-rui -- LGTM. Merging this |
this PR :
after collection is observed to be of Scala Seq type.