You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To return a fragment info value for a given index, the fragment index argument fid expects the index to start at 0. For example, if you've n fragments, you need to pass n-1 to get the information for the n fragment. This relates to functions like tiledb_fragment_info_get_timestamp_range(object, fid), tiledb_fragment_info_get_timestamp_range(finfo, fid) etc.
The following example shows how the issue came up initially.
library(tiledb)
uri<- tempfile()
# ingest #1df1<-data.frame(x=1:3, tm= Sys.Date() +1:3)
fromDataFrame(df1, uri, mode="ingest")
Sys.sleep(5)
# ingest #2df2<-data.frame(x=4:6, tm= Sys.Date() +4:6)
fromDataFrame(df2, uri, mode="append")
# Construct tiledb_fragment_info objectfinfo<- tiledb_fragment_info(uri)
# Return number of fragmentsfid<- tiledb_fragment_info_get_num(finfo)
# 2# Get time-stamp range for a given fragment index, here the last fragment
tiledb_fragment_info_get_timestamp_range(finfo, fid)
#> Error in libtiledb_fragment_info_timestamp_range(object@ptr, fid): [TileDB::FragmentInfo] Error: Cannot get fragment URI; Invalid fragment index# Adjust fragment index
tiledb_fragment_info_get_timestamp_range(finfo, fid-2) # 0 index#> [1] "2023-02-04 18:34:01 +03" "2023-02-04 18:34:01 +03"
tiledb_fragment_info_get_timestamp_range(finfo, fid-1) # 1 index#> [1] "2023-02-04 18:34:06 +03" "2023-02-04 18:34:06 +03"
Thanks for taking the time to file an issue. What is described here is correct -- and intentional. The R package wraps the TileDB Core API, and adheres to its interface. As this API uses zero-based indexing, so does the R interface to it.
Thanks for your prompt reply! From R perspective, a user doesn't expect zero-based indexing but since it is intentional there is no problem - as long as it is documented somewhere; apologies if I missed it.
To return a fragment info value for a given index, the fragment index argument
fid
expects the index to start at 0. For example, if you'ven
fragments, you need to passn-1
to get the information for then
fragment. This relates to functions liketiledb_fragment_info_get_timestamp_range(object, fid)
,tiledb_fragment_info_get_timestamp_range(finfo, fid)
etc.The following example shows how the issue came up initially.
Session info
The text was updated successfully, but these errors were encountered: