[fix](agg,array) support TIMESTAMPTZ in multiple aggregate and array …#63293
Open
Mryange wants to merge 1 commit into
Open
[fix](agg,array) support TIMESTAMPTZ in multiple aggregate and array …#63293Mryange wants to merge 1 commit into
Mryange wants to merge 1 commit into
Conversation
…functions (apache#62756) Multiple BE aggregate and array functions failed at runtime when given `TIMESTAMPTZ` input, despite the FE planner accepting the queries. All failures shared the same root cause: manually maintained primitive-type dispatch switch-cases omitted `TYPE_TIMESTAMPTZ`. Affected functions and errors: | Function | Error | |----------|-------| | `max_by(timestamptz, ...)` / `min_by(timestamptz, ...)` | `Illegal type TimeStampTz(6) of argument` | | `max_by(..., timestamptz)` / `min_by(..., timestamptz)` | `Agg Function max_by(..., timestamptz(6)) is not implemented` | | `array_position` / `array_contains` / `countequal` with `Array<TIMESTAMPTZ>` | `execute failed or unsupported types for function` | | `map_agg_v2(timestamptz, ...)` | `Agg Function ... is not implemented` | | `histogram(timestamptz)` | `Agg Function ... is not implemented` | | `group_array_intersect(array<timestamptz>)` | `Agg Function ... is not implemented` | | `group_array_union(array<timestamptz>)` | `Agg Function ... is not implemented` | **`aggregate_function_min_max_by.cpp` / `.h`** — Replace the large switch-case in both `create_max_min_value()` and `create_aggregate_function_min_max_by()` with `dispatch_switch_scalar()`, which covers all scalar types including `TYPE_TIMESTAMPTZ` automatically. Only non-scalar cases (`STRING`, `ARRAY`, `BITMAP`) are handled separately. **`function_array_index.h`** — Replace the split `dispatch_switch_number()` + datetime if-else + IP if-else dispatch in `_execute_dispatch()` with a single `dispatch_switch_scalar()` call. **`aggregate_function_map_v2.cpp`** — Add `TYPE_TIMESTAMPTZ` to the key-type switch. **`aggregate_function_histogram.cpp`** — Add `TYPE_TIMESTAMPTZ` to `creator_with_type_list`. **`aggregate_function_group_array_set_op_impl.h`** — Replace the large nested-type switch-case with `dispatch_switch_scalar()` + `is_string_type()`, covering all scalar types including `TYPE_TIMESTAMPTZ` without manual enumeration. (cherry picked from commit 65e4da4)
Contributor
|
Thank you for your contribution to Apache Doris. Please clearly describe your PR:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
…functions (#62756)
#62756
Multiple BE aggregate and array functions failed at runtime when given
TIMESTAMPTZinput, despite the FE planner accepting the queries. All failures shared the same root cause: manually maintained primitive-type dispatch switch-cases omittedTYPE_TIMESTAMPTZ.Affected functions and errors:
max_by(timestamptz, ...)/min_by(timestamptz, ...)Illegal type TimeStampTz(6) of argumentmax_by(..., timestamptz)/min_by(..., timestamptz)Agg Function max_by(..., timestamptz(6)) is not implementedmap_agg_v2(timestamptz, ...)Agg Function ... is not implementedhistogram(timestamptz)Agg Function ... is not implementedgroup_array_union(array<timestamptz>)Agg Function ... is not implementedaggregate_function_min_max_by.cpp/.h— Replace the large switch-case in bothcreate_max_min_value()andcreate_aggregate_function_min_max_by()withdispatch_switch_scalar(), which covers all scalar types includingTYPE_TIMESTAMPTZautomatically. Only non-scalar cases (STRING,ARRAY,BITMAP) are handled separately.function_array_index.h— Replace the splitdispatch_switch_number()+ datetime if-else + IP if-else dispatch in_execute_dispatch()with a singledispatch_switch_scalar()call.aggregate_function_map_v2.cpp— AddTYPE_TIMESTAMPTZto the key-type switch.aggregate_function_histogram.cpp— AddTYPE_TIMESTAMPTZtocreator_with_type_list.aggregate_function_group_array_set_op_impl.h— Replace the large nested-type switch-case withdispatch_switch_scalar()+is_string_type(), covering all scalar types includingTYPE_TIMESTAMPTZwithout manual enumeration.(cherry picked from commit 65e4da4)
What problem does this PR solve?
Issue Number: close #xxx
Related PR: #xxx
Problem Summary:
Release note
None
Check List (For Author)
Test
Behavior changed:
Does this need documentation?
Check List (For Reviewer who merge this PR)