Tanya-W commented on code in PR #14211:
URL: https://github.com/apache/doris/pull/14211#discussion_r1058121725


##########
be/src/vec/functions/match.cpp:
##########
@@ -0,0 +1,143 @@
+// 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.
+
+#include <limits>
+#include <type_traits>
+
+#include "common/consts.h"
+#include "common/logging.h"
+#include "vec/columns/column_string.h"
+#include "vec/data_types/data_type_number.h"
+#include "vec/data_types/data_type_string.h"
+#include "vec/functions/simple_function_factory.h"
+
+namespace doris::vectorized {
+
+class FunctionMatchBase : public IFunction {
+public:
+    size_t get_number_of_arguments() const override { return 2; }
+
+    String get_name() const override { return "match"; }
+
+    /// Get result types by argument types. If the function does not apply to 
these arguments, throw an exception.
+    DataTypePtr get_return_type_impl(const DataTypes& arguments) const 
override {
+        return std::make_shared<DataTypeUInt8>();
+    }
+    
+    Status execute_impl(FunctionContext* context, Block& block,
+                               const ColumnNumbers& arguments, size_t result,
+                               size_t input_rows_count) override {
+        //const auto match_query_col = 
block.get_by_position(arguments[1]).column->convert_to_full_column_if_const();
+        auto column_with_name = block.get_by_position(arguments[1]);
+        /*const auto* match_query = 
check_and_get_column<ColumnString>(match_query_col.get());
+        if (!match_query) {
+            return Status::InternalError("Not supported input arguments 
types");
+        }*/
+        auto match_query_str = column_with_name.to_string(0);
+        //std::string match_query_str = 
match_query_col->get_data_at(0).to_string();
+        std::string column_name = block.get_by_position(arguments[0]).name;
+        auto match_pred_name = BeConsts::BLOCK_TEMP_COLUMN_PREFIX + 
column_name + "_match_" + match_query_str;
+        if (!block.has(match_pred_name)) {
+            if (!config::enable_storage_vectorization) {
+                return Status::Cancelled("please check whether turn on the 
configuration 'enable_storage_vectorization'");
+            }
+            LOG(WARNING) << "execute match query meet error, block no column: 
" << match_pred_name;
+            return Status::InternalError("match query meet error");

Review Comment:
   updated



##########
be/src/vec/functions/match.cpp:
##########
@@ -0,0 +1,143 @@
+// 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.
+
+#include <limits>
+#include <type_traits>
+
+#include "common/consts.h"
+#include "common/logging.h"
+#include "vec/columns/column_string.h"
+#include "vec/data_types/data_type_number.h"
+#include "vec/data_types/data_type_string.h"
+#include "vec/functions/simple_function_factory.h"
+
+namespace doris::vectorized {
+
+class FunctionMatchBase : public IFunction {
+public:
+    size_t get_number_of_arguments() const override { return 2; }
+
+    String get_name() const override { return "match"; }
+
+    /// Get result types by argument types. If the function does not apply to 
these arguments, throw an exception.
+    DataTypePtr get_return_type_impl(const DataTypes& arguments) const 
override {
+        return std::make_shared<DataTypeUInt8>();
+    }
+    
+    Status execute_impl(FunctionContext* context, Block& block,
+                               const ColumnNumbers& arguments, size_t result,
+                               size_t input_rows_count) override {
+        //const auto match_query_col = 
block.get_by_position(arguments[1]).column->convert_to_full_column_if_const();
+        auto column_with_name = block.get_by_position(arguments[1]);
+        /*const auto* match_query = 
check_and_get_column<ColumnString>(match_query_col.get());
+        if (!match_query) {
+            return Status::InternalError("Not supported input arguments 
types");
+        }*/
+        auto match_query_str = column_with_name.to_string(0);
+        //std::string match_query_str = 
match_query_col->get_data_at(0).to_string();
+        std::string column_name = block.get_by_position(arguments[0]).name;
+        auto match_pred_name = BeConsts::BLOCK_TEMP_COLUMN_PREFIX + 
column_name + "_match_" + match_query_str;

Review Comment:
   updated



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