-
Notifications
You must be signed in to change notification settings - Fork 18
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
tiledb_put_metadata only saving first element of character vector #626
Comments
I believe this to be a documented constraint: essentially a 'string' is already a vector of char, so you would have to do something like While not ideal, you could also combine it with JSON writers / parser to write for complex structures. |
Yeah, I (kind of) see what you mean. Just found this as well: #168 (comment). |
I will leave this open because this could do with added documentation. |
Kudos by the way for sending a perfect demonstration. Here is a slightly mod'ed version: #!/usr/bin/env Rscript
library(tiledb)
pth <- tempfile()
dir.create(pth)
dm <- tiledb_domain(dims = c(tiledb_dim("d1", c(1L, 10L), type = "INT32")))
sch <- tiledb_array_schema(dm, attrs = c(tiledb_attr("a1", type = "INT32")), sparse = TRUE)
ign <- tiledb_array_create(pth, sch)
arr <- tiledb_array(pth, "WRITE")
ign <- tiledb_array_open(arr, "WRITE")
ign <- tiledb_put_metadata(arr, "numeric_key", c(0.5, 1.5))
ign <- tiledb_put_metadata(arr, "integer_key", c(1L, 2L))
ign <- tiledb_put_metadata(arr, "character_key", paste(c("value_1", "value_2"), collapse=";"))
ign <- tiledb_array_close(arr)
arr <- tiledb_array_open(arr, "READ")
allmd <- tiledb_get_all_metadata(arr)
print(x = allmd) and it shows: $ ./gh_issue_626.R
character_key: value_1;value_2
integer_key: 1, 2
numeric_key: 0.5, 1.5
$ |
saw this too late, re-opened now |
On my machine,
tiledb_put_metadata
will only save one (the first) element of acharacter
vector, but all elements of anumeric
orinteger
vector. I am not sure whether that is the expected behavior.Result
sessionInfo
The text was updated successfully, but these errors were encountered: