-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Implement serialization for LinearRing. #12831
Conversation
Signed-off-by: dblock <[email protected]>
098c81e
to
7fc4fb0
Compare
LMK if you think it's better @shwetathareja @reta. |
Signed-off-by: dblock <[email protected]>
❌ Gradle check result for 098c81e: FAILURE Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
Compatibility status:Checks if related components are compatible with change 2271a3a Incompatible componentsSkipped componentsCompatible componentsCompatible components: [https://github.com/opensearch-project/custom-codecs.git, https://github.com/opensearch-project/asynchronous-search.git, https://github.com/opensearch-project/performance-analyzer-rca.git, https://github.com/opensearch-project/flow-framework.git, https://github.com/opensearch-project/cross-cluster-replication.git, https://github.com/opensearch-project/reporting.git, https://github.com/opensearch-project/job-scheduler.git, https://github.com/opensearch-project/security.git, https://github.com/opensearch-project/opensearch-oci-object-storage.git, https://github.com/opensearch-project/geospatial.git, https://github.com/opensearch-project/k-nn.git, https://github.com/opensearch-project/common-utils.git, https://github.com/opensearch-project/neural-search.git, https://github.com/opensearch-project/security-analytics.git, https://github.com/opensearch-project/anomaly-detection.git, https://github.com/opensearch-project/performance-analyzer.git, https://github.com/opensearch-project/notifications.git, https://github.com/opensearch-project/ml-commons.git, https://github.com/opensearch-project/index-management.git, https://github.com/opensearch-project/observability.git, https://github.com/opensearch-project/alerting.git, https://github.com/opensearch-project/sql.git] |
❌ Gradle check result for 7fc4fb0: FAILURE Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
Signed-off-by: dblock <[email protected]>
@@ -80,7 +80,11 @@ public SearchTask( | |||
|
|||
@Override | |||
public final String getDescription() { | |||
return descriptionSupplier.get(); | |||
try { |
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.
@dblock so I've check the codebase and it seems like we have at least 4 consolidated places where UnsupportedOperationException
is thrown all over the place:
- GeoJson (JSON serialization)
- GeometryIO (native stream serialization)
- GeoShapeIndexer (indexer)
- LegacyGeoShapeQueryProcessor / VectorGeoPointShapeQueryProcessor / LuceneGeometryCollector
It seems like LinearRing
is special case and should not be used as a top level geometry primitive, looking a bit more on how we could fix that.
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 implemented serialization for LinearRing
, so that fixes (1).
I'll start with the caveat that I know nothing about GeoJson, but does this serialization conform with the GeoJSON specification? I spent a few minutes looking at this and I couldn't quite figure it out (again, I know nothing about this domain), but which of the seven allowed geometries does a linear ring serialize itself as since "linear ring" isn't one of the allowed geometries? |
Thanks @andrross , I was looking for a reasons why it was not serializable in first place but it looks like this is exactly the one (https://macwright.com/2015/03/23/geojson-second-bite gives a sneak peek what a linear rings) |
Maybe @nknize can take a look at this? I approached this problem from a very practical point of view: task description wants to serialize the linear ring so that the user can see what's going on in the trace, and serialization was missing. I don't know if there are negative consequences of introducing this implementation that does not confirm with the GeoJSON spec. |
❌ Gradle check result for 2271a3a: FAILURE Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
org.opensearch.indices.IndicesRequestCacheIT.testCacheWithInvalidation {p0={"opensearch.experimental.feature.pluggable.caching.enabled":"false"}} #12308 |
This approach is completely fine for the "convert this structure to text to write into a log message" use case. The problem is the serialization is also used to create what I assume must be conforming GeoJSON potentially for communicating with other systems that expect conforming GeoJSON. Unfortunately I don't see any easy way to tease apart these use cases because the logging happens way up in the call stack while operating on very generic objects. |
❌ Gradle check result for 2271a3a: FAILURE Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
❌ Gradle check result for d08003d: TIMEOUT Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
Looks like @rishabhmaurya also posted a solution to the issue: #12844. :-) |
I'd like to leave this open for a bit, hoping someone (@nknize?) will have a strong opinion of why we should not have this serialization implementation for LinearRing. |
@shwetathareja in #12834 (comment) is saying this is dead code and we should delete it. |
Definitely let's delete it if it is dead (but I see it being used), may be what exactly is "dead" would good to clarify |
Closing in favor of #12910. |
Description
A user that enables trace-level logging with OpenSearch will run into a serialization error on geo tasks that they otherwise would not run into. It comes from here. This also happens in a test, and #12783 attempts to ignore the failed serialization error. This PR implements JSON serialization for
LinearRing
.Reproduce with
Related Issues
Closes #11688.
Check List
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.