You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by GitBox <gi...@apache.org> on 2022/06/24 02:31:11 UTC

[GitHub] [doris] adonis0147 commented on a diff in pull request #10385: [feature-wip](array-type) add function arrays_remove

adonis0147 commented on code in PR #10385:
URL: https://github.com/apache/doris/pull/10385#discussion_r905667287


##########
be/src/vec/functions/array/function_array_remove.h:
##########
@@ -0,0 +1,363 @@
+// 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 "vec/columns/column_array.h"
+#include "vec/columns/column_const.h"
+#include "vec/data_types/data_type_array.h"
+#include "vec/data_types/data_type_number.h"
+#include "vec/functions/function.h"
+#include "vec/functions/function_helpers.h"
+
+namespace doris::vectorized {
+
+class FunctionArrayRemove : public IFunction {
+public:
+    static constexpr auto name = "array_remove";
+    static FunctionPtr create() { return std::make_shared<FunctionArrayRemove>(); }
+
+    /// Get function name.
+    String get_name() const override { return name; }
+
+    bool use_default_implementation_for_nulls() const override { return true; }
+
+    bool is_variadic() const override { return false; }
+
+    size_t get_number_of_arguments() const override { return 2; }
+
+    DataTypePtr get_return_type_impl(const DataTypes& arguments) const override {
+        DCHECK(is_array(arguments[0]))
+                << "First argument for function: " << name << " should be DataTypeArray but it has type "
+                << arguments[0]->get_name() << ".";
+        return arguments[0];
+    }
+
+    Status execute_impl(FunctionContext* context, Block& block, const ColumnNumbers& arguments,
+                        size_t result, size_t input_rows_count) override {
+
+
+//        auto dst_null_column = ColumnUInt8::create(input_rows_count);
+//        UInt8* dst_null_map = dst_null_column->get_data().data();
+//        const UInt8* src_null_map = nullptr;
+//        ColumnsWithTypeAndName args;
+//        auto col_left = block.get_by_position(arguments[0]);
+//        if (col_left.column->is_nullable()) {
+//            auto null_col = check_and_get_column<ColumnNullable>(*col_left.column);
+//            src_null_map = null_col->get_null_map_column().get_data().data();
+//            args = {{null_col->get_nested_column_ptr(), remove_nullable(col_left.type),
+//                     col_left.name},
+//                    block.get_by_position(arguments[1])};
+//        } else {
+//            args = {col_left, block.get_by_position(arguments[1])};
+//        }
+//        auto res_column = _execute_non_nullable(args, input_rows_count, src_null_map);

Review Comment:
   Useless code should be removed.



-- 
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-unsubscribe@doris.apache.org

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


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