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

java.lang.ArrayIndexOutOfBoundsException for 8 character column values #16395

Open
hutch3232 opened this issue Sep 18, 2024 · 0 comments
Open
Labels

Comments

@hutch3232
Copy link

I am trying to create a column with a constant string. I found that if the nchar of the string is a multiple of 8 an array index out of bounds exception is thrown.

library(data.table)
library(h2o)

h2o.init(port = 5551)
h2o.getVersion()
# [1] "3.44.0.3"

mt <- as.h2o(mtcars)
mt$test <- paste0(sample(letters, 8, replace = TRUE), collapse = "")
# ERROR MESSAGE:
# 
# DistributedException from localhost/127.0.0.1:5551: 'Index 142 out of bounds for length 142', caused by # java.lang.ArrayIndexOutOfBoundsException: Index 142 out of bounds for length 142

# passing in values of <n> 1:7, 9:15, 17:23, etc. works
mt <- as.h2o(mtcars)
mt$test <- paste0(sample(letters, <n>, replace = TRUE), collapse = "")

A workaround is to create the column with nchar %% 8 != 0 and then assign the column again, this time it will work.

@hutch3232 hutch3232 added the bug label Sep 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant