yangzhg commented on code in PR #8958:
URL: https://github.com/apache/incubator-doris/pull/8958#discussion_r848006064


##########
be/src/geo/geo_functions.cpp:
##########
@@ -267,22 +268,21 @@ doris_udf::BooleanVal 
GeoFunctions::st_contains(doris_udf::FunctionContext* ctx,
     if (state != nullptr && state->is_null) {
         return BooleanVal::null();
     }
-    GeoShape* shapes[2] = {nullptr, nullptr};
+    std::vector<std::shared_ptr<GeoShape>> shapes = {nullptr, nullptr};
     const StringVal* strs[2] = {&lhs, &rhs};
-    // use this to delete new
-    StContainsState local_state;
     for (int i = 0; i < 2; ++i) {
         if (state != nullptr && state->shapes[i] != nullptr) {
             shapes[i] = state->shapes[i];
         } else {
-            shapes[i] = local_state.shapes[i] = 
GeoShape::from_encoded(strs[i]->ptr, strs[i]->len);
+            shapes[i] =
+                    
std::shared_ptr<GeoShape>(GeoShape::from_encoded(strs[i]->ptr, strs[i]->len));
             if (shapes[i] == nullptr) {
                 return BooleanVal::null();
             }
         }
     }
 
-    return shapes[0]->contains(shapes[1]);
+    return shapes[0]->contains(shapes[1].get());

Review Comment:
   `contains` only accept raw pointer



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to