github-actions[bot] commented on code in PR #18999:
URL: https://github.com/apache/doris/pull/18999#discussion_r1174965892


##########
be/src/runtime/geometry_value.h:
##########
@@ -0,0 +1,60 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+#ifndef DORIS_GEOMETRY_VALUE_H
+#define DORIS_GEOMETRY_VALUE_H

Review Comment:
   warning: macro is not used [clang-diagnostic-unused-macros]
   ```cpp
   #define DORIS_GEOMETRY_VALUE_H
           ^
   ```
   



##########
be/src/runtime/geometry_value.h:
##########
@@ -0,0 +1,60 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+#ifndef DORIS_GEOMETRY_VALUE_H
+#define DORIS_GEOMETRY_VALUE_H
+
+
+#include "geo/geo_tobinary.h"
+#include "common/status.h"
+
+
+namespace doris {
+struct GeometryBinaryValue {
+    static const int MAX_LENGTH = (1 << 30);
+
+    // default nullprt and size 0 for invalid or NULL value
+    const char* ptr = nullptr;
+    size_t len = 0;
+    std::stringstream result_stream;
+
+    GeometryBinaryValue() : ptr(nullptr), len(0) {}
+    GeometryBinaryValue(const std::string& s) { 
from_geometry_string(s.c_str(), s.length()); }
+    GeometryBinaryValue(const char* ptr, int len) { from_geometry_string(ptr, 
len); }
+
+    ~GeometryBinaryValue() {
+        delete[] ptr;
+    }
+
+    const char* value() { return ptr; }

Review Comment:
   warning: method 'value' can be made const 
[readability-make-member-function-const]
   
   ```suggestion
       const char* value() const { return ptr; }
   ```
   



##########
be/src/vec/data_types/data_type_geometry.h:
##########
@@ -0,0 +1,79 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+#pragma once
+
+#include <ostream>
+
+#include "runtime/geometry_value.h"
+#include "vec/columns/column_string.h"
+#include "vec/data_types/data_type.h"
+#include "vec/data_types/data_type_string.h"
+
+namespace doris::vectorized {
+class DataTypeGeometry final : public IDataType {
+public:
+    using ColumnType = ColumnString;
+    static constexpr bool is_parametric = false;
+    using FieldType = GeometryField;
+
+    const char* get_family_name() const override { return "GEOMETRY"; }
+    TypeIndex get_type_id() const override { return TypeIndex::GEOMETRY; }
+    PrimitiveType get_type_as_primitive_type() const override { return 
TYPE_GEOMETRY; }
+    TPrimitiveType::type get_type_as_tprimitive_type() const override {
+        return TPrimitiveType::GEOMETRY;
+    }
+
+    int64_t get_uncompressed_serialized_bytes(const IColumn& column,
+                                              int data_version) const override;
+    char* serialize(const IColumn& column, char* buf, int data_version) const 
override;
+    const char* deserialize(const char* buf, IColumn* column, int 
data_version) const override;
+
+    MutableColumnPtr create_column() const override;
+
+    virtual Field get_default() const override {

Review Comment:
   warning: 'virtual' is redundant since the function is already declared 
'override' [modernize-use-override]
   
   ```suggestion
       Field get_default() const override {
   ```
   



##########
be/src/runtime/geometry_value.h:
##########
@@ -0,0 +1,60 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+#ifndef DORIS_GEOMETRY_VALUE_H
+#define DORIS_GEOMETRY_VALUE_H
+
+
+#include "geo/geo_tobinary.h"
+#include "common/status.h"
+
+
+namespace doris {
+struct GeometryBinaryValue {
+    static const int MAX_LENGTH = (1 << 30);
+
+    // default nullprt and size 0 for invalid or NULL value
+    const char* ptr = nullptr;
+    size_t len = 0;
+    std::stringstream result_stream;
+
+    GeometryBinaryValue() : ptr(nullptr), len(0) {}
+    GeometryBinaryValue(const std::string& s) { 
from_geometry_string(s.c_str(), s.length()); }
+    GeometryBinaryValue(const char* ptr, int len) { from_geometry_string(ptr, 
len); }
+
+    ~GeometryBinaryValue() {
+        delete[] ptr;
+    }
+
+    const char* value() { return ptr; }
+
+    size_t size() { return len; }

Review Comment:
   warning: method 'size' can be made const 
[readability-make-member-function-const]
   
   ```suggestion
       size_t size() const { return len; }
   ```
   



##########
be/src/runtime/geometry_value.h:
##########
@@ -0,0 +1,60 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+#ifndef DORIS_GEOMETRY_VALUE_H
+#define DORIS_GEOMETRY_VALUE_H
+
+
+#include "geo/geo_tobinary.h"
+#include "common/status.h"
+
+
+namespace doris {
+struct GeometryBinaryValue {
+    static const int MAX_LENGTH = (1 << 30);
+
+    // default nullprt and size 0 for invalid or NULL value
+    const char* ptr = nullptr;
+    size_t len = 0;
+    std::stringstream result_stream;
+
+    GeometryBinaryValue() : ptr(nullptr), len(0) {}
+    GeometryBinaryValue(const std::string& s) { 
from_geometry_string(s.c_str(), s.length()); }
+    GeometryBinaryValue(const char* ptr, int len) { from_geometry_string(ptr, 
len); }
+
+    ~GeometryBinaryValue() {
+        delete[] ptr;
+    }
+
+    const char* value() { return ptr; }
+
+    size_t size() { return len; }
+
+    void replace(char* ptr, int len) {

Review Comment:
   warning: pointer parameter 'ptr' can be pointer to const 
[readability-non-const-parameter]
   
   ```suggestion
       void replace(const char* ptr, int len) {
   ```
   



-- 
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