TileDB-Inc / TileDB-R

R interface to TileDB: The Modern Database
https://tiledb-inc.github.io/TileDB-R
Other
103 stars 18 forks source link

Can't read domain for dimensions of type UINT16 #758

Closed LTLA closed 2 months ago

LTLA commented 2 months ago

MRE:

library(tiledb)

context <- tiledb_ctx()
collected <- list(tiledb_dim(ctx=context, "d1", c(1L, 100L), tile=10L, type="UINT16"))
dom <- tiledb_domain(ctx=context, dims=collected)
schema <- tiledb_array_schema(ctx=context, domain=dom, attrs=list(tiledb_attr(ctx=context, "FOO", type="FLOAT32")))

path <- tempfile()
tiledb_array_create(path, schema)

obj <- tiledb_array(path)
s <- schema(obj)
dims <- dimensions(s)
doms <- lapply(dims, domain)
## Error: Static type (INT16) does not match expected type (UINT16)

This is attributable to a typo at

https://github.com/TileDB-Inc/TileDB-R/blob/321175a809867181e12b0f901a924772dcda070c/src/libtiledb.cpp#L927-L930

where TILEDB_UINT16 was intended.

Session information ``` R version 4.4.1 Patched (2024-06-20 r86796) Platform: aarch64-apple-darwin22.6.0 Running under: macOS Ventura 13.6.9 Matrix products: default BLAS: /Users/luna/Software/R/R-4-4-branch/lib/libRblas.dylib LAPACK: /Users/luna/Software/R/R-4-4-branch/lib/libRlapack.dylib; LAPACK version 3.12.0 locale: [1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8 time zone: America/Los_Angeles tzcode source: internal attached base packages: [1] stats graphics grDevices utils datasets methods base other attached packages: [1] RcppSpdlog_0.0.18 tiledb_0.30.0 loaded via a namespace (and not attached): [1] zoo_1.8-12 bit_4.5.0 compiler_4.4.1 tools_4.4.1 [5] RcppCCTZ_0.2.12 spdl_0.0.5 Rcpp_1.0.13 nanoarrow_0.5.0.1 [9] bit64_4.5.2 nanotime_0.3.10 grid_4.4.1 lattice_0.22-6 ```