diff --git a/be/src/vec/functions/function_convert_tz.h b/be/src/vec/functions/function_convert_tz.h index c9739c2e9be6f5..af118c80583769 100644 --- a/be/src/vec/functions/function_convert_tz.h +++ b/be/src/vec/functions/function_convert_tz.h @@ -88,12 +88,6 @@ class FunctionConvertTZ : public IFunction { std::make_shared()}; } - bool use_default_implementation_for_nulls() const override { return false; } - - Status close(FunctionContext* context, FunctionContext::FunctionStateScope scope) override { - return Status::OK(); - } - Status execute_impl(FunctionContext* context, Block& block, const ColumnNumbers& arguments, size_t result, size_t input_rows_count) const override { auto result_null_map_column = ColumnUInt8::create(input_rows_count, 0); @@ -110,10 +104,6 @@ class FunctionConvertTZ : public IFunction { default_preprocess_parameter_columns(argument_columns, col_const, {1, 2}, block, arguments); - for (int i = 0; i < 3; i++) { - check_set_nullable(argument_columns[i], result_null_map_column, col_const[i]); - } - if (col_const[1] && col_const[2]) { auto result_column = ColumnType::create(); execute_tz_const(context, assert_cast(argument_columns[0].get()), diff --git a/regression-test/data/query_p0/sql_functions/datetime_functions/test_convert_tz.out b/regression-test/data/query_p0/sql_functions/datetime_functions/test_convert_tz.out new file mode 100644 index 00000000000000..9bf49bd74ef238 --- /dev/null +++ b/regression-test/data/query_p0/sql_functions/datetime_functions/test_convert_tz.out @@ -0,0 +1,23 @@ +-- This file is automatically generated. You should know what you did if you want to edit this +-- !sql1 -- +2024-04-18T23:20 +2024-04-18T23:20 +2024-04-18T23:20 +2024-04-18T23:20 +2024-04-18T23:20 +2024-04-18T23:20 +2024-04-18T23:20 +2024-04-18T23:20 +2024-04-18T23:20 +2024-04-18T23:20 +2024-04-18T23:20 +2024-04-18T23:20 +2024-04-18T23:20 +2024-04-18T23:20 +2024-04-18T23:20 +2024-04-18T23:20 +2024-04-18T23:20 +2024-04-18T23:20 +2024-04-18T23:20 +2024-04-18T23:20 + diff --git a/regression-test/suites/query_p0/sql_functions/datetime_functions/test_convert_tz.groovy b/regression-test/suites/query_p0/sql_functions/datetime_functions/test_convert_tz.groovy new file mode 100644 index 00000000000000..2959c7f136b8e5 --- /dev/null +++ b/regression-test/suites/query_p0/sql_functions/datetime_functions/test_convert_tz.groovy @@ -0,0 +1,37 @@ +// 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. + +suite("test_convert_tz") { + sql """ + CREATE TABLE `cvt_tz` ( + `rowid` int NULL, + `dt` datetime NULL, + `property_value` varchar(65533) NULL + ) ENGINE=OLAP + DUPLICATE KEY(`rowid`, `dt`, `property_value`) + DISTRIBUTED BY HASH(`rowid`) BUCKETS 10 + PROPERTIES ( + "replication_allocation" = "tag.location.default: 1" + ); + """ + + sql """insert into cvt_tz select number, "2024-04-18 23:20:00", NULL from numbers("number" = "20"); """ + + order_qt_sql1 """ + select convert_tz(dt, '+00:00', IF(property_value IS NULL, '+00:00', property_value)) from cvt_tz + """ +} \ No newline at end of file