This is an automated email from the ASF dual-hosted git repository.

taiyangli pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/incubator-gluten.git


The following commit(s) were added to refs/heads/main by this push:
     new 01b334b10 [GLUTEN-6977][CH] Remove concat function parser (#6978)
01b334b10 is described below

commit 01b334b10ae523c2d2728b4f2679b573d899a4dc
Author: 李扬 <[email protected]>
AuthorDate: Wed Aug 28 10:51:11 2024 +0800

    [GLUTEN-6977][CH] Remove concat function parser (#6978)
    
    * remove concat function parser
    
    * update clickouse version
---
 cpp-ch/clickhouse.version                          |  2 +-
 .../CommonScalarFunctionParser.cpp                 |  1 +
 .../Parser/scalar_function_parser/concat.cpp       | 80 ----------------------
 3 files changed, 2 insertions(+), 81 deletions(-)

diff --git a/cpp-ch/clickhouse.version b/cpp-ch/clickhouse.version
index c4f9065ea..7e7d12cc6 100644
--- a/cpp-ch/clickhouse.version
+++ b/cpp-ch/clickhouse.version
@@ -1,3 +1,3 @@
 CH_ORG=Kyligence
 CH_BRANCH=rebase_ch/20240823
-CH_COMMIT=8532edf7d75
+CH_COMMIT=6feb101b7b9
diff --git 
a/cpp-ch/local-engine/Parser/scalar_function_parser/CommonScalarFunctionParser.cpp
 
b/cpp-ch/local-engine/Parser/scalar_function_parser/CommonScalarFunctionParser.cpp
index 9c3dc18ec..b65595ef8 100644
--- 
a/cpp-ch/local-engine/Parser/scalar_function_parser/CommonScalarFunctionParser.cpp
+++ 
b/cpp-ch/local-engine/Parser/scalar_function_parser/CommonScalarFunctionParser.cpp
@@ -133,6 +133,7 @@ REGISTER_COMMON_SCALAR_FUNCTION_PARSER(Conv, conv, 
sparkConv);
 REGISTER_COMMON_SCALAR_FUNCTION_PARSER(Uuid, uuid, generateUUIDv4);
 REGISTER_COMMON_SCALAR_FUNCTION_PARSER(Levenshtein, levenshtein, 
editDistanceUTF8);
 REGISTER_COMMON_SCALAR_FUNCTION_PARSER(FormatString, format_string, printf);
+REGISTER_COMMON_SCALAR_FUNCTION_PARSER(Concat, concat, concat);
 
 REGISTER_COMMON_SCALAR_FUNCTION_PARSER(Crc32, crc32, CRC32);
 REGISTER_COMMON_SCALAR_FUNCTION_PARSER(Murmur3Hash, murmur3hash, 
sparkMurmurHash3_32);
diff --git a/cpp-ch/local-engine/Parser/scalar_function_parser/concat.cpp 
b/cpp-ch/local-engine/Parser/scalar_function_parser/concat.cpp
deleted file mode 100644
index d0e1264c4..000000000
--- a/cpp-ch/local-engine/Parser/scalar_function_parser/concat.cpp
+++ /dev/null
@@ -1,80 +0,0 @@
-/*
- * 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 <Parser/FunctionParser.h>
-#include <Common/CHUtil.h>
-#include <Core/Field.h>
-#include <DataTypes/DataTypeNullable.h>
-#include <DataTypes/IDataType.h>
-
-namespace DB
-{
-
-namespace ErrorCodes
-{
-    extern const int BAD_ARGUMENTS;
-    extern const int NUMBER_OF_ARGUMENTS_DOESNT_MATCH;
-}
-}
-
-namespace local_engine
-{
-
-class FunctionParserConcat : public FunctionParser
-{
-public:
-    explicit FunctionParserConcat(SerializedPlanParser * plan_parser_) : 
FunctionParser(plan_parser_) {}
-    ~FunctionParserConcat() override = default;
-
-    static constexpr auto name = "concat";
-
-    String getName() const override { return name; }
-    String getCHFunctionName(const substrait::Expression_ScalarFunction &) 
const override { return name; }
-
-    const ActionsDAG::Node * parse(
-        const substrait::Expression_ScalarFunction & substrait_func,
-        ActionsDAG & actions_dag) const override
-    {
-        /*
-          parse concat(args) as:
-            1. if output type is array, return arrayConcat(args)
-            2. otherwise:
-                1) if args is empty, return empty string
-                2) if args have size 1, return identity(args[0])
-                3) otherwise return concat(args)
-        */
-        auto args = parseFunctionArguments(substrait_func, actions_dag);
-        const auto & output_type = substrait_func.output_type();
-        const ActionsDAG::Node * result_node = nullptr;
-        if (output_type.has_list())
-        {
-             result_node = toFunctionNode(actions_dag, "arrayConcat", args);
-        }
-        else
-        {
-            if (args.empty())
-                result_node = addColumnToActionsDAG(actions_dag, 
std::make_shared<DataTypeString>(), "");
-            else if (args.size() == 1)
-                result_node = toFunctionNode(actions_dag, "identity", args);
-            else
-                result_node = toFunctionNode(actions_dag, "concat", args);
-        }
-        return convertNodeTypeIfNeeded(substrait_func, result_node, 
actions_dag);
-    }
-};
-
-static FunctionParserRegister<FunctionParserConcat> register_concat;
-}


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to