-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
Support for spatial_index
in azurerm_cosmosdb_sql_container
#11625
Conversation
spatial_index
in azurerm_cosmosdb_sql_container
spatialTypes := []documentdb.SpatialType{ | ||
documentdb.SpatialTypeLineString, | ||
documentdb.SpatialTypeMultiPolygon, | ||
documentdb.SpatialTypePoint, | ||
documentdb.SpatialTypePolygon, | ||
} | ||
|
||
for _, i := range input { | ||
indexPair := i.(map[string]interface{}) | ||
indexes = append(indexes, documentdb.SpatialSpec{ | ||
Types: &spatialTypes, | ||
Path: utils.String(indexPair["path"].(string)), | ||
}) | ||
} |
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.
should we expose this in schema instead of applying each spatial index to all types?
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 service will return all types no matter what types we try to update. But at least one type is necessary to be set, because missing types will lead to bad request.
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'm not sure why that doesn't mean we shouldn't expose the four types for people to individually set?
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.
It means, for example, we update types = ["String"], and the service returns ["String", "MultiPolygon", "Point", "Polygon"], shall we ignore the difference for the customers?
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.
It means that the service has set all types for you. The service team has confirmed that it's by design. I'd like to suggest not to expose types
to the clients?
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 think it's by design by service. Here is the service's reply:
https://gist.github.com/yupwei68/6c3ecffe6aeec33d945210e70bb3513a#gistcomment-3735507
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.
my point is would someone ever want to set a different spatial index path for different types? it type1 is path1 and type2 is path2 ect or will there always only ever be one index path for all types?
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.
There will always be index paths for all types, according to the service team. The user can't specify the specific types for their paths.
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.
ok so to be clear, there is a single path that is shared by all types regardless and its not possible to assign different paths to different types? i assume the portal only has a "path" property then and hides away types from the user? if this is all the case maybe it make sense to document htis in the property so users know the path is applied to all types?
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.
Yes. The portal has not supported this yet. I have updated the document and I have marked the types computed.
Thanks kt for your comments. Please continue reviewing. |
Thanks kt for your comment. I've added a comment and some description in the documents for this problem. Please continue reviewing. |
@yupwei68 - looking for confirmation about this: #11625 (comment) |
Thanks kt. Sorry for the missing. Please continue. |
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.
Thanks @yupwei68 - LGTM 👍 just needt he merge conflict sorted
Thanks kt, I've resolved the conflicts. |
This functionality has been released in v2.64.0 of the Terraform Provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. Thank you! |
I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active contributions. |
Fix #8817
--- PASS: TestAccCosmosDbSqlContainer_indexing_policy (1559.79s)