Skip to content
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

h2o.merge will not work with frame with 1 row of <dbl> column #8275

Closed
exalate-issue-sync bot opened this issue May 11, 2023 · 3 comments
Closed

h2o.merge will not work with frame with 1 row of <dbl> column #8275

exalate-issue-sync bot opened this issue May 11, 2023 · 3 comments

Comments

@exalate-issue-sync
Copy link

With h2o.merge in R, if you try to join a single row H2O frame where the join is on a column to another frame, it will fail (below) or returns wrong number of rows:

Input:

{code:r}left <- data.frame(fruit = c(-177000000, -4000000, 100000000000, 200000000000, 1000000000000),
color <- c('red', 'orange', 'yellow', 'red', 'blue'))

right <- data.frame(fruit = c(-177000000), citrus <- c(FALSE))

left_hf <- as.h2o(left)
right_hf <- as.h2o(right)

merged <- h2o.merge(left_hf, right_hf, all.x = TRUE)
merged{code}

{quote}Output:
ERROR while rich displaying an object: Error in .h2o.doSafeREST(h2oRestApiVersion = h2oRestApiVersion, urlSuffix = page, :
ERROR MESSAGE:
java.lang.AssertionError
Traceback:

FUN(X[[i]], ...)

tryCatch(withCallingHandlers({

. if (!mime %in% names(repr::mime2repr)) . stop("No repr_* for mimetype ", mime, " in repr::mime2repr"). rpr <- repr::mime2repr[[mime]](obj). if (is.null(rpr)) . return(NULL). prepare_content(is.raw(rpr), rpr). }, error = error_handler), error = outer_handler)

tryCatchList(expr, classes, parentenv, handlers)

tryCatchOne(expr, names, parentenv, handlers[[1L]])

doTryCatch(return(expr), name, parentenv, handler)

withCallingHandlers({

. if (!mime %in% names(repr::mime2repr)) . stop("No repr_* for mimetype ", mime, " in repr::mime2repr"). rpr <- repr::mime2repr[[mime]](obj). if (is.null(rpr)) . return(NULL). prepare_content(is.raw(rpr), rpr). }, error = error_handler)

repr::mime2repr[[mime]](obj)

repr_text.default(obj)

paste(capture.output(print(obj)), collapse = "\n")

  1. capture.output(print(obj))

  2. evalVis(expr)

  3. withVisible(eval(expr, pf))

  4. eval(expr, pf)

  5. eval(expr, pf)

  6. print(obj)

  7. print.H2OFrame(obj)

  8. print(head(x, n, m))

  9. head(x, n, m)

  10. head.H2OFrame(x, n, m)

  11. nrow

  12. dim

  13. dim.H2OFrame

  14. .eval.frame

  15. .eval.driver

  16. .h2o._remoteSend(.h2o._RAPIDS, h2oRestApiVersion = 99, ast = exec_str, . session_id = h2o.getConnection()@mutable$session_id, method = "POST")

  17. .h2o.doSafeREST(h2oRestApiVersion = h2oRestApiVersion, urlSuffix = page, . parms = .params, method = method)

  18. stop(msg){quote}

@exalate-issue-sync
Copy link
Author

Neema Mashayekhi commented: The issue also occurs for multiple rows (as long as the values are the same):

{code:r}left <- data.frame(fruit = c(-177000000, -4000000, 100000000000, 200000000000, 1000000000000),
color <- c('red', 'orange', 'yellow', 'red', 'blue'))
right <- data.frame(fruit = c(-177000000, -177000000),
citrus <- c(FALSE))
left_hf <- as.h2o(left)
right_hf <- as.h2o(right)
merged <- h2o.merge(left_hf, right_hf, all.x = TRUE){code}

@exalate-issue-sync
Copy link
Author

Wendy commented: One more example from Kuba:

{noformat}[A, 12][B, 13][C, 14][D, 15]{noformat}

right frame

{noformat}[Y, 10000][B, 20000][X, 30000][D, 40000]{noformat}

Doing right marge ( allLeft=False, allRight=True) using radix method
expected:

{noformat}[Y,null,10000][B,13,20000][X,null,30000][D,15,40000]{noformat}

got:

{noformat}[Y,13,10000][B,null,20000][X,null,30000][D,12,40000]{noformat}

@h2o-ops
Copy link
Collaborator

h2o-ops commented May 14, 2023

JIRA Issue Migration Info

Jira Issue: PUBDEV-7362
Assignee: Wendy
Reporter: Neema Mashayekhi
State: Resolved
Fix Version: 3.30.0.4
Attachments: N/A
Development PRs: Available

Linked PRs from JIRA

#4515
#4631
h2oai/sparkling-water#2149

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant