Skip to content

Error writing sub arrays #255

@jkanche

Description

@jkanche

Hi @eddelbuettel I'm using a combination of scripts from my earlier issue and from this page - https://docs.tiledb.com/main/solutions/tiledb-embedded/api-usage/writing-arrays/writing-in-dense-subarrays

Hopefully I'm doing something wrong here

library(tiledb)

uri <- "test.tdb"
if (dir.exists(uri)) unlink(uri, recursive=TRUE, force=TRUE)

## Generate a matrix
n <- 5L
k <- 4L
mat <- matrix(1:(n*k) * 0.12345, nrow=n, ncol=k)
print(mat)

dom <- tiledb_domain(dims = c(tiledb_dim("rows", c(1L, n), n, "INT32"),
                              tiledb_dim("cols", c(1L, k), k, "INT32")))
schema <- tiledb_array_schema(dom, attrs=tiledb_attr("vals", type="FLOAT64"))
tiledb_array_create(uri, schema)

arr <- tiledb_array(uri, is.sparse=FALSE)
I <- c(1:3)
J <- c(2:3)

print(mat[I, J])
arr[I, J] <- mat[I, J]

Fails to write in chunks and expects full matrix

> arr[I, J] <- mat[I, J]
Error in libtiledb_query_submit(qryptr) : 
  [TileDB::Writer] Error: Buffer sizes check failed; Invalid number of cells given for attribute 'vals' (6 != 20)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions