This is an automated email from the ASF dual-hosted git repository.
lihaopeng pushed a commit to branch branch-3.0
in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/branch-3.0 by this push:
new de190ed300d branch-3.0: [Enhancement](function) Support TIMEV2 type
for agg function max,min,any #45437 (#45504)
de190ed300d is described below
commit de190ed300d083fc462bc47b9da368628fd3a573
Author: github-actions[bot]
<41898282+github-actions[bot]@users.noreply.github.com>
AuthorDate: Thu Jan 2 10:15:48 2025 +0800
branch-3.0: [Enhancement](function) Support TIMEV2 type for agg function
max,min,any #45437 (#45504)
Cherry-picked from #45437
Co-authored-by: zclllyybb <[email protected]>
---
be/src/vec/aggregate_functions/aggregate_function_min_max.cpp | 6 ++++++
regression-test/data/nereids_syntax_p0/any_value.out | 7 +++++++
regression-test/suites/nereids_syntax_p0/any_value.groovy | 3 +++
3 files changed, 16 insertions(+)
diff --git a/be/src/vec/aggregate_functions/aggregate_function_min_max.cpp
b/be/src/vec/aggregate_functions/aggregate_function_min_max.cpp
index c1a72fd52bd..e02996a3388 100644
--- a/be/src/vec/aggregate_functions/aggregate_function_min_max.cpp
+++ b/be/src/vec/aggregate_functions/aggregate_function_min_max.cpp
@@ -23,6 +23,7 @@
#include "vec/aggregate_functions/aggregate_function_simple_factory.h"
#include "vec/aggregate_functions/factory_helpers.h"
#include "vec/aggregate_functions/helpers.h"
+#include "vec/core/types.h"
#include "vec/data_types/data_type_nullable.h"
namespace doris::vectorized {
@@ -69,6 +70,11 @@ AggregateFunctionPtr
create_aggregate_function_single_value(const String& name,
AggregateFunctionsSingleValue<Data<SingleValueDataFixed<UInt64>>>>(
argument_types, result_is_nullable);
}
+ if (which.idx == TypeIndex::Time || which.idx == TypeIndex::TimeV2) {
+ return creator_without_type::create<
+
AggregateFunctionsSingleValue<Data<SingleValueDataFixed<Float64>>>>(
+ argument_types, result_is_nullable);
+ }
if (which.idx == TypeIndex::IPv4) {
return creator_without_type::create<
AggregateFunctionsSingleValue<Data<SingleValueDataFixed<IPv4>>>>(
diff --git a/regression-test/data/nereids_syntax_p0/any_value.out
b/regression-test/data/nereids_syntax_p0/any_value.out
new file mode 100644
index 00000000000..ac9836e0630
--- /dev/null
+++ b/regression-test/data/nereids_syntax_p0/any_value.out
@@ -0,0 +1,7 @@
+-- This file is automatically generated. You should know what you did if you
want to edit this
+-- !sql_max --
+99:00:00
+
+-- !sql_min --
+00:00:00
+
diff --git a/regression-test/suites/nereids_syntax_p0/any_value.groovy
b/regression-test/suites/nereids_syntax_p0/any_value.groovy
index 3de2b0dd733..c838efe1c1d 100644
--- a/regression-test/suites/nereids_syntax_p0/any_value.groovy
+++ b/regression-test/suites/nereids_syntax_p0/any_value.groovy
@@ -23,4 +23,7 @@ suite("any_value") {
test {
sql "select any(s_suppkey), any(s_name), any_value(s_address) from
supplier;"
}
+ qt_sql_max """select max(cast(concat(number, ":00:00") as time)) from
numbers("number" = "100");"""
+ qt_sql_min """select min(cast(concat(number, ":00:00") as time)) from
numbers("number" = "100");"""
+ sql """select any(cast(concat(number, ":00:00") as time)) from
numbers("number" = "100");"""
}
\ No newline at end of file
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]