This is an automated email from the ASF dual-hosted git repository.
liuneng 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 7f8d2330e [GLUTEN-6042][CH]Fix to_date function result type nullable
check
7f8d2330e is described below
commit 7f8d2330e12b75365219e92049b35da7f428bb62
Author: KevinyhZou <[email protected]>
AuthorDate: Wed Jun 12 14:26:25 2024 +0800
[GLUTEN-6042][CH]Fix to_date function result type nullable check
What changes were proposed in this pull request?
(Please fill in changes proposed in this fix)
(Fixes: #6042)
How was this patch tested?
---
cpp-ch/local-engine/Functions/FunctionGetDateData.h | 5 +----
cpp-ch/local-engine/Functions/SparkFunctionToDateTime.h | 3 ---
2 files changed, 1 insertion(+), 7 deletions(-)
diff --git a/cpp-ch/local-engine/Functions/FunctionGetDateData.h
b/cpp-ch/local-engine/Functions/FunctionGetDateData.h
index 4f79d4bd0..6cd93dd02 100644
--- a/cpp-ch/local-engine/Functions/FunctionGetDateData.h
+++ b/cpp-ch/local-engine/Functions/FunctionGetDateData.h
@@ -46,7 +46,7 @@ public:
FunctionGetDateData() = default;
~FunctionGetDateData() override = default;
- DB::ColumnPtr executeImpl(const DB::ColumnsWithTypeAndName & arguments,
const DB::DataTypePtr & result_type, size_t) const override
+ DB::ColumnPtr executeImpl(const DB::ColumnsWithTypeAndName & arguments,
const DB::DataTypePtr &, size_t) const override
{
if (arguments.size() != 1)
throw
DB::Exception(DB::ErrorCodes::NUMBER_OF_ARGUMENTS_DOESNT_MATCH, "Function {}'s
arguments number must be 1.", getName());
@@ -54,9 +54,6 @@ public:
const DB::ColumnWithTypeAndName arg1 = arguments[0];
const auto * src_col =
checkAndGetColumn<DB::ColumnString>(arg1.column.get());
size_t size = src_col->size();
-
- if (!result_type->isNullable())
- throw DB::Exception(DB::ErrorCodes::ILLEGAL_TYPE_OF_ARGUMENT,
"Function {}'s return type must be nullable", getName());
using ColVecTo = ColumnVector<T>;
typename ColVecTo::MutablePtr result_column = ColVecTo::create(size,
0);
diff --git a/cpp-ch/local-engine/Functions/SparkFunctionToDateTime.h
b/cpp-ch/local-engine/Functions/SparkFunctionToDateTime.h
index d846f8956..980af85bd 100644
--- a/cpp-ch/local-engine/Functions/SparkFunctionToDateTime.h
+++ b/cpp-ch/local-engine/Functions/SparkFunctionToDateTime.h
@@ -145,9 +145,6 @@ public:
if (arguments.size() != 1 && arguments.size() != 2)
throw
DB::Exception(DB::ErrorCodes::NUMBER_OF_ARGUMENTS_DOESNT_MATCH, "Function {}'s
arguments number must be 1 or 2.", name);
- if (!result_type->isNullable())
- throw DB::Exception(DB::ErrorCodes::ILLEGAL_TYPE_OF_ARGUMENT,
"Function {}'s return type must be nullable", name);
-
if (!isDateTime64(removeNullable(result_type)))
throw DB::Exception(DB::ErrorCodes::ILLEGAL_TYPE_OF_ARGUMENT,
"Function {}'s return type must be datetime.", name);
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]