-
Notifications
You must be signed in to change notification settings - Fork 7
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
adds string dimension support #108
adds string dimension support #108
Conversation
3a3c95b
to
4a81187
Compare
899dd6b
to
7de5bb5
Compare
b3409cd
to
83eee25
Compare
b65efa3
to
1053599
Compare
array.go
Outdated
return nil, false, err | ||
} | ||
|
||
nonEmptyDomain, err := getNonEmptyDomainForDim(dimension, tmpDomain) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe you'll have to iterate through tmpDomain
here, else you'll end up with the same values. It might be easier to drop tiledb_array_get_non_empty_domain
and switch to tiledb_array_get_non_empty_domain_from_index
inside the for loop?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tmpDomain
is just a slice here. Initially it was used in a call to makeNonEmptyDomain
which was receiving a domain and did a loop in dimensions. Here we just use getNonEmptyDomainForDim
which accepts a diimension and we are performing the loop through domain dimensions around this function. I don't think i changed the intention of the initial code. I will add a test for tiledb_array_get_non_empty_domain
to make sure anyway
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The tmpDomain is created with tmpDomain, tmpDomainPtr, err := domainType.MakeSlice(uint64(2 * ndims))
. So it is the size of 2*ndims
. In the new getNonEmptyDomainForDim
you access index 0 and 1 of the passed slice. The problem I see is you always pass the same slice, tmpDomain
so for every dimension you are just accessing tmpDomain[0]
and tmpDomain[1]
. You need to subslice tmpDomain based on the index dimension, however that would require you to add switch cases for all the datatypes. I think it might be easier to switch to tiledb_array_get_non_empty_domain_by_index
to just fetch the single dimension's nonEmptyDomain to pass to getNonEmptyDomainForDim
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Got it. For this case, using the indexed version works well. In the case of tiledb_deserialize_array_nonempty_domain
there is no indexed version so there is no choice but using the switch
serialize.go
Outdated
return nil, false, err | ||
} | ||
|
||
nonEmptyDomain, err := getNonEmptyDomainForDim(dimension, tmpDomain) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as above you will need to iterate through tmpDomain
here, else you'll end up with the same values.
1053599
to
d285c33
Compare
Thanks for the changes, looks great! |
ExampleStringDimArray follows https://github.com/TileDB-Inc/TileDB/blob/e26d52bc20996d9dd320032aa3049dd198c5c7fc/test/src/unit-cppapi-array.cc#L1120