[r] Support SparseNDArray writes case#2755
Conversation
e71c07d to
e3bd800
Compare
e3bd800 to
6cc17be
Compare
|
I think this is now ready for review. Locally I get |
There was another change here that we were able to revert so also reverting this one remaining changed line
SparseNDArray writes case
| ## the 'soma_data' data type may not have been cached, and if so we need to fetch it | ||
| if (is.null(private$.type)) { | ||
| ## TODO: replace with a libtiledbsoma accessor as discussed |
There was a problem hiding this comment.
Are you able to use SOMAArray::arrow_schema or SOMASparseArrayNDArray::schema to get the dtype of soma_data?
There was a problem hiding this comment.
I think it is not clear where the value would come from. This function is called with just the values to be written, and this segment is where, if no 'cached' type info exists, we go to the schema on disk as a last resort.
TileDB-SOMA/apis/r/R/SOMASparseNDArray.R
Lines 229 to 235 in f06cd71
In some of the use case we do not need that as private$.type has been set.
There was a problem hiding this comment.
And it is similar for thw write() function from which this is called. It gets called with just values (and an optional bbox). No schema info.
nguyenv
left a comment
There was a problem hiding this comment.
As discussed over DM, I will add a dtype getter for the soma_data into libtiledbsoma.
Issue and/or context:
Following PRs #2704 (data frames) and #2730 (dense arrays) this PR extends to C++-ification to sparse n-dimensional arrays.
Changes:
Refactored code to use C++ classes to write.
Notes for Reviewer:
SC 44886