This is an automated email from the ASF dual-hosted git repository. lwz9103 pushed a commit to branch liquid in repository https://gitbox.apache.org/repos/asf/incubator-gluten.git
commit a269247d7d722ff9bc4635ba70a59fb12faa3cf0 Author: lwz9103 <[email protected]> AuthorDate: Thu Jul 11 13:55:11 2024 +0800 register function parser for kap functions (cherry picked from commit 2657ff371c5d1288b512d46c1a284bdeff9fcb2f) --- .../scalar_function_parser/kapFunctionParser.cpp | 49 ++++++++++++++++++++++ 1 file changed, 49 insertions(+) diff --git a/cpp-ch/local-engine/Parser/scalar_function_parser/kapFunctionParser.cpp b/cpp-ch/local-engine/Parser/scalar_function_parser/kapFunctionParser.cpp new file mode 100644 index 0000000000..7791b681e3 --- /dev/null +++ b/cpp-ch/local-engine/Parser/scalar_function_parser/kapFunctionParser.cpp @@ -0,0 +1,49 @@ +/* +* 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/Exception.h> + +namespace local_engine +{ +#define REGISTER_KAP_FUNCTION_PARSER(cls_name, substrait_name, ch_name) \ + class KapFunctionParser##cls_name : public FunctionParser \ + { \ + public: \ + KapFunctionParser##cls_name(SerializedPlanParser * plan_parser_) : FunctionParser(plan_parser_) \ + { \ + } \ + ~KapFunctionParser##cls_name() override = default; \ + static constexpr auto name = #substrait_name; \ + String getName() const override \ + { \ + return #substrait_name; \ + } \ + String getCHFunctionName(const substrait::Expression_ScalarFunction & /*substrait_func*/) const override \ + { \ + return #ch_name; \ + } \ + }; \ + static const FunctionParserRegister<KapFunctionParser##cls_name> register_scalar_function_parser_##cls_name; + +REGISTER_KAP_FUNCTION_PARSER(KeBitmapCardinality, ke_bitmap_cardinality, keBitmapCardinality); +REGISTER_KAP_FUNCTION_PARSER(KapMonthsBetween, kap_months_between, kapMonthsBetween); +REGISTER_KAP_FUNCTION_PARSER(KapYmdIntBetween, kap_ymd_int_between, kapYmdIntBetween); +REGISTER_KAP_FUNCTION_PARSER(Truncate, truncate, truncate); + +} + + --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
