be/src/exprs/function/date_time_transforms.h
Line | Count | Source |
1 | | // Licensed to the Apache Software Foundation (ASF) under one |
2 | | // or more contributor license agreements. See the NOTICE file |
3 | | // distributed with this work for additional information |
4 | | // regarding copyright ownership. The ASF licenses this file |
5 | | // to you under the Apache License, Version 2.0 (the |
6 | | // "License"); you may not use this file except in compliance |
7 | | // with the License. You may obtain a copy of the License at |
8 | | // |
9 | | // http://www.apache.org/licenses/LICENSE-2.0 |
10 | | // |
11 | | // Unless required by applicable law or agreed to in writing, |
12 | | // software distributed under the License is distributed on an |
13 | | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
14 | | // KIND, either express or implied. See the License for the |
15 | | // specific language governing permissions and limitations |
16 | | // under the License. |
17 | | // This file is copied from |
18 | | // https://github.com/ClickHouse/ClickHouse/blob/master/src/Functions/DateTimeTransforms.h |
19 | | // and modified by Doris |
20 | | |
21 | | #pragma once |
22 | | |
23 | | #include <libdivide.h> |
24 | | |
25 | | #include <cmath> |
26 | | #include <cstdint> |
27 | | |
28 | | #include "common/status.h" |
29 | | #include "core/binary_cast.hpp" |
30 | | #include "core/block/block.h" |
31 | | #include "core/block/column_numbers.h" |
32 | | #include "core/column/column.h" |
33 | | #include "core/column/column_decimal.h" |
34 | | #include "core/column/column_nullable.h" |
35 | | #include "core/column/column_string.h" |
36 | | #include "core/column/column_vector.h" |
37 | | #include "core/data_type/data_type_date.h" |
38 | | #include "core/data_type/data_type_date_time.h" |
39 | | #include "core/data_type/data_type_decimal.h" |
40 | | #include "core/data_type/data_type_string.h" |
41 | | #include "core/data_type/define_primitive_type.h" |
42 | | #include "core/data_type/primitive_type.h" |
43 | | #include "core/types.h" |
44 | | #include "core/value/time_value.h" |
45 | | #include "core/value/vdatetime_value.h" |
46 | | #include "exec/common/int_exp.h" |
47 | | #include "exec/common/util.hpp" |
48 | | #include "exprs/function/date_format_type.h" |
49 | | #include "exprs/function_context.h" |
50 | | |
51 | | // FIXME: This file contains widespread UB due to unsafe type-punning casts. |
52 | | // These must be properly refactored to eliminate reliance on reinterpret-style behavior. |
53 | | // |
54 | | // Temporarily suppress GCC 15+ warnings on user-defined type casts to allow build to proceed. |
55 | | #if defined(__GNUC__) && (__GNUC__ >= 15) |
56 | | #pragma GCC diagnostic push |
57 | | #pragma GCC diagnostic ignored "-Wcast-user-defined" |
58 | | #endif |
59 | | |
60 | | namespace doris { |
61 | | |
62 | | #define TIME_FUNCTION_IMPL(CLASS, UNIT, FUNCTION) \ |
63 | | template <PrimitiveType PType> \ |
64 | | struct CLASS { \ |
65 | | static constexpr PrimitiveType OpArgType = PType; \ |
66 | | using CppType = typename PrimitiveTypeTraits<PType>::CppType; \ |
67 | | static constexpr auto name = #UNIT; \ |
68 | | \ |
69 | 77 | static inline auto execute(const CppType& date_time_value) { \ |
70 | 77 | return date_time_value.FUNCTION; \ |
71 | 77 | } \ _ZN5doris13DayOfWeekImplILNS_13PrimitiveTypeE25EE7executeERKNS_11DateV2ValueINS_15DateV2ValueTypeEEE Line | Count | Source | 69 | 1 | static inline auto execute(const CppType& date_time_value) { \ | 70 | 1 | return date_time_value.FUNCTION; \ | 71 | 1 | } \ |
_ZN5doris14DayOfMonthImplILNS_13PrimitiveTypeE25EE7executeERKNS_11DateV2ValueINS_15DateV2ValueTypeEEE Line | Count | Source | 69 | 2 | static inline auto execute(const CppType& date_time_value) { \ | 70 | 2 | return date_time_value.FUNCTION; \ | 71 | 2 | } \ |
_ZN5doris13DayOfYearImplILNS_13PrimitiveTypeE25EE7executeERKNS_11DateV2ValueINS_15DateV2ValueTypeEEE Line | Count | Source | 69 | 1 | static inline auto execute(const CppType& date_time_value) { \ | 70 | 1 | return date_time_value.FUNCTION; \ | 71 | 1 | } \ |
_ZN5doris14WeekOfYearImplILNS_13PrimitiveTypeE25EE7executeERKNS_11DateV2ValueINS_15DateV2ValueTypeEEE Line | Count | Source | 69 | 1 | static inline auto execute(const CppType& date_time_value) { \ | 70 | 1 | return date_time_value.FUNCTION; \ | 71 | 1 | } \ |
_ZN5doris11WeekDayImplILNS_13PrimitiveTypeE25EE7executeERKNS_11DateV2ValueINS_15DateV2ValueTypeEEE Line | Count | Source | 69 | 2 | static inline auto execute(const CppType& date_time_value) { \ | 70 | 2 | return date_time_value.FUNCTION; \ | 71 | 2 | } \ |
_ZN5doris14WeekOfYearImplILNS_13PrimitiveTypeE26EE7executeERKNS_11DateV2ValueINS_19DateTimeV2ValueTypeEEE Line | Count | Source | 69 | 3 | static inline auto execute(const CppType& date_time_value) { \ | 70 | 3 | return date_time_value.FUNCTION; \ | 71 | 3 | } \ |
_ZN5doris13DayOfYearImplILNS_13PrimitiveTypeE26EE7executeERKNS_11DateV2ValueINS_19DateTimeV2ValueTypeEEE Line | Count | Source | 69 | 2 | static inline auto execute(const CppType& date_time_value) { \ | 70 | 2 | return date_time_value.FUNCTION; \ | 71 | 2 | } \ |
_ZN5doris13DayOfWeekImplILNS_13PrimitiveTypeE26EE7executeERKNS_11DateV2ValueINS_19DateTimeV2ValueTypeEEE Line | Count | Source | 69 | 5 | static inline auto execute(const CppType& date_time_value) { \ | 70 | 5 | return date_time_value.FUNCTION; \ | 71 | 5 | } \ |
_ZN5doris14DayOfMonthImplILNS_13PrimitiveTypeE26EE7executeERKNS_11DateV2ValueINS_19DateTimeV2ValueTypeEEE Line | Count | Source | 69 | 4 | static inline auto execute(const CppType& date_time_value) { \ | 70 | 4 | return date_time_value.FUNCTION; \ | 71 | 4 | } \ |
_ZN5doris11WeekDayImplILNS_13PrimitiveTypeE26EE7executeERKNS_11DateV2ValueINS_19DateTimeV2ValueTypeEEE Line | Count | Source | 69 | 4 | static inline auto execute(const CppType& date_time_value) { \ | 70 | 4 | return date_time_value.FUNCTION; \ | 71 | 4 | } \ |
_ZN5doris12ToSecondImplILNS_13PrimitiveTypeE25EE7executeERKNS_11DateV2ValueINS_15DateV2ValueTypeEEE Line | Count | Source | 69 | 3 | static inline auto execute(const CppType& date_time_value) { \ | 70 | 3 | return date_time_value.FUNCTION; \ | 71 | 3 | } \ |
_ZN5doris12ToMinuteImplILNS_13PrimitiveTypeE25EE7executeERKNS_11DateV2ValueINS_15DateV2ValueTypeEEE Line | Count | Source | 69 | 3 | static inline auto execute(const CppType& date_time_value) { \ | 70 | 3 | return date_time_value.FUNCTION; \ | 71 | 3 | } \ |
_ZN5doris10ToHourImplILNS_13PrimitiveTypeE25EE7executeERKNS_11DateV2ValueINS_15DateV2ValueTypeEEE Line | Count | Source | 69 | 3 | static inline auto execute(const CppType& date_time_value) { \ | 70 | 3 | return date_time_value.FUNCTION; \ | 71 | 3 | } \ |
_ZN5doris9ToDayImplILNS_13PrimitiveTypeE25EE7executeERKNS_11DateV2ValueINS_15DateV2ValueTypeEEE Line | Count | Source | 69 | 2 | static inline auto execute(const CppType& date_time_value) { \ | 70 | 2 | return date_time_value.FUNCTION; \ | 71 | 2 | } \ |
_ZN5doris11ToMonthImplILNS_13PrimitiveTypeE25EE7executeERKNS_11DateV2ValueINS_15DateV2ValueTypeEEE Line | Count | Source | 69 | 2 | static inline auto execute(const CppType& date_time_value) { \ | 70 | 2 | return date_time_value.FUNCTION; \ | 71 | 2 | } \ |
_ZN5doris10ToYearImplILNS_13PrimitiveTypeE25EE7executeERKNS_11DateV2ValueINS_15DateV2ValueTypeEEE Line | Count | Source | 69 | 2 | static inline auto execute(const CppType& date_time_value) { \ | 70 | 2 | return date_time_value.FUNCTION; \ | 71 | 2 | } \ |
_ZN5doris16ToYearOfWeekImplILNS_13PrimitiveTypeE25EE7executeERKNS_11DateV2ValueINS_15DateV2ValueTypeEEE Line | Count | Source | 69 | 2 | static inline auto execute(const CppType& date_time_value) { \ | 70 | 2 | return date_time_value.FUNCTION; \ | 71 | 2 | } \ |
_ZN5doris13ToQuarterImplILNS_13PrimitiveTypeE25EE7executeERKNS_11DateV2ValueINS_15DateV2ValueTypeEEE Line | Count | Source | 69 | 2 | static inline auto execute(const CppType& date_time_value) { \ | 70 | 2 | return date_time_value.FUNCTION; \ | 71 | 2 | } \ |
_ZN5doris10ToDaysImplILNS_13PrimitiveTypeE25EE7executeERKNS_11DateV2ValueINS_15DateV2ValueTypeEEE Line | Count | Source | 69 | 2 | static inline auto execute(const CppType& date_time_value) { \ | 70 | 2 | return date_time_value.FUNCTION; \ | 71 | 2 | } \ |
Unexecuted instantiation: _ZN5doris17ToMicroSecondImplILNS_13PrimitiveTypeE26EE7executeERKNS_11DateV2ValueINS_19DateTimeV2ValueTypeEEE _ZN5doris12ToSecondImplILNS_13PrimitiveTypeE26EE7executeERKNS_11DateV2ValueINS_19DateTimeV2ValueTypeEEE Line | Count | Source | 69 | 5 | static inline auto execute(const CppType& date_time_value) { \ | 70 | 5 | return date_time_value.FUNCTION; \ | 71 | 5 | } \ |
_ZN5doris12ToMinuteImplILNS_13PrimitiveTypeE26EE7executeERKNS_11DateV2ValueINS_19DateTimeV2ValueTypeEEE Line | Count | Source | 69 | 5 | static inline auto execute(const CppType& date_time_value) { \ | 70 | 5 | return date_time_value.FUNCTION; \ | 71 | 5 | } \ |
_ZN5doris10ToHourImplILNS_13PrimitiveTypeE26EE7executeERKNS_11DateV2ValueINS_19DateTimeV2ValueTypeEEE Line | Count | Source | 69 | 5 | static inline auto execute(const CppType& date_time_value) { \ | 70 | 5 | return date_time_value.FUNCTION; \ | 71 | 5 | } \ |
_ZN5doris9ToDayImplILNS_13PrimitiveTypeE26EE7executeERKNS_11DateV2ValueINS_19DateTimeV2ValueTypeEEE Line | Count | Source | 69 | 4 | static inline auto execute(const CppType& date_time_value) { \ | 70 | 4 | return date_time_value.FUNCTION; \ | 71 | 4 | } \ |
_ZN5doris11ToMonthImplILNS_13PrimitiveTypeE26EE7executeERKNS_11DateV2ValueINS_19DateTimeV2ValueTypeEEE Line | Count | Source | 69 | 4 | static inline auto execute(const CppType& date_time_value) { \ | 70 | 4 | return date_time_value.FUNCTION; \ | 71 | 4 | } \ |
_ZN5doris10ToYearImplILNS_13PrimitiveTypeE26EE7executeERKNS_11DateV2ValueINS_19DateTimeV2ValueTypeEEE Line | Count | Source | 69 | 4 | static inline auto execute(const CppType& date_time_value) { \ | 70 | 4 | return date_time_value.FUNCTION; \ | 71 | 4 | } \ |
_ZN5doris13ToQuarterImplILNS_13PrimitiveTypeE26EE7executeERKNS_11DateV2ValueINS_19DateTimeV2ValueTypeEEE Line | Count | Source | 69 | 4 | static inline auto execute(const CppType& date_time_value) { \ | 70 | 4 | return date_time_value.FUNCTION; \ | 71 | 4 | } \ |
Unexecuted instantiation: _ZN5doris13ToSecondsImplILNS_13PrimitiveTypeE26EE7executeERKNS_11DateV2ValueINS_19DateTimeV2ValueTypeEEE |
72 | | \ |
73 | 28 | static DataTypes get_variadic_argument_types() { \ |
74 | 28 | return {std::make_shared<typename PrimitiveTypeTraits<PType>::DataType>()}; \ |
75 | 28 | } \ _ZN5doris13DayOfWeekImplILNS_13PrimitiveTypeE25EE27get_variadic_argument_typesEv Line | Count | Source | 73 | 1 | static DataTypes get_variadic_argument_types() { \ | 74 | 1 | return {std::make_shared<typename PrimitiveTypeTraits<PType>::DataType>()}; \ | 75 | 1 | } \ |
_ZN5doris14DayOfMonthImplILNS_13PrimitiveTypeE25EE27get_variadic_argument_typesEv Line | Count | Source | 73 | 1 | static DataTypes get_variadic_argument_types() { \ | 74 | 1 | return {std::make_shared<typename PrimitiveTypeTraits<PType>::DataType>()}; \ | 75 | 1 | } \ |
_ZN5doris13DayOfYearImplILNS_13PrimitiveTypeE25EE27get_variadic_argument_typesEv Line | Count | Source | 73 | 1 | static DataTypes get_variadic_argument_types() { \ | 74 | 1 | return {std::make_shared<typename PrimitiveTypeTraits<PType>::DataType>()}; \ | 75 | 1 | } \ |
_ZN5doris14WeekOfYearImplILNS_13PrimitiveTypeE25EE27get_variadic_argument_typesEv Line | Count | Source | 73 | 1 | static DataTypes get_variadic_argument_types() { \ | 74 | 1 | return {std::make_shared<typename PrimitiveTypeTraits<PType>::DataType>()}; \ | 75 | 1 | } \ |
_ZN5doris11WeekDayImplILNS_13PrimitiveTypeE25EE27get_variadic_argument_typesEv Line | Count | Source | 73 | 1 | static DataTypes get_variadic_argument_types() { \ | 74 | 1 | return {std::make_shared<typename PrimitiveTypeTraits<PType>::DataType>()}; \ | 75 | 1 | } \ |
_ZN5doris14WeekOfYearImplILNS_13PrimitiveTypeE26EE27get_variadic_argument_typesEv Line | Count | Source | 73 | 1 | static DataTypes get_variadic_argument_types() { \ | 74 | 1 | return {std::make_shared<typename PrimitiveTypeTraits<PType>::DataType>()}; \ | 75 | 1 | } \ |
_ZN5doris13DayOfYearImplILNS_13PrimitiveTypeE26EE27get_variadic_argument_typesEv Line | Count | Source | 73 | 1 | static DataTypes get_variadic_argument_types() { \ | 74 | 1 | return {std::make_shared<typename PrimitiveTypeTraits<PType>::DataType>()}; \ | 75 | 1 | } \ |
_ZN5doris13DayOfWeekImplILNS_13PrimitiveTypeE26EE27get_variadic_argument_typesEv Line | Count | Source | 73 | 1 | static DataTypes get_variadic_argument_types() { \ | 74 | 1 | return {std::make_shared<typename PrimitiveTypeTraits<PType>::DataType>()}; \ | 75 | 1 | } \ |
_ZN5doris14DayOfMonthImplILNS_13PrimitiveTypeE26EE27get_variadic_argument_typesEv Line | Count | Source | 73 | 1 | static DataTypes get_variadic_argument_types() { \ | 74 | 1 | return {std::make_shared<typename PrimitiveTypeTraits<PType>::DataType>()}; \ | 75 | 1 | } \ |
_ZN5doris11WeekDayImplILNS_13PrimitiveTypeE26EE27get_variadic_argument_typesEv Line | Count | Source | 73 | 1 | static DataTypes get_variadic_argument_types() { \ | 74 | 1 | return {std::make_shared<typename PrimitiveTypeTraits<PType>::DataType>()}; \ | 75 | 1 | } \ |
_ZN5doris12ToSecondImplILNS_13PrimitiveTypeE25EE27get_variadic_argument_typesEv Line | Count | Source | 73 | 1 | static DataTypes get_variadic_argument_types() { \ | 74 | 1 | return {std::make_shared<typename PrimitiveTypeTraits<PType>::DataType>()}; \ | 75 | 1 | } \ |
_ZN5doris12ToMinuteImplILNS_13PrimitiveTypeE25EE27get_variadic_argument_typesEv Line | Count | Source | 73 | 1 | static DataTypes get_variadic_argument_types() { \ | 74 | 1 | return {std::make_shared<typename PrimitiveTypeTraits<PType>::DataType>()}; \ | 75 | 1 | } \ |
_ZN5doris10ToHourImplILNS_13PrimitiveTypeE25EE27get_variadic_argument_typesEv Line | Count | Source | 73 | 1 | static DataTypes get_variadic_argument_types() { \ | 74 | 1 | return {std::make_shared<typename PrimitiveTypeTraits<PType>::DataType>()}; \ | 75 | 1 | } \ |
_ZN5doris9ToDayImplILNS_13PrimitiveTypeE25EE27get_variadic_argument_typesEv Line | Count | Source | 73 | 1 | static DataTypes get_variadic_argument_types() { \ | 74 | 1 | return {std::make_shared<typename PrimitiveTypeTraits<PType>::DataType>()}; \ | 75 | 1 | } \ |
_ZN5doris11ToMonthImplILNS_13PrimitiveTypeE25EE27get_variadic_argument_typesEv Line | Count | Source | 73 | 1 | static DataTypes get_variadic_argument_types() { \ | 74 | 1 | return {std::make_shared<typename PrimitiveTypeTraits<PType>::DataType>()}; \ | 75 | 1 | } \ |
_ZN5doris10ToYearImplILNS_13PrimitiveTypeE25EE27get_variadic_argument_typesEv Line | Count | Source | 73 | 1 | static DataTypes get_variadic_argument_types() { \ | 74 | 1 | return {std::make_shared<typename PrimitiveTypeTraits<PType>::DataType>()}; \ | 75 | 1 | } \ |
_ZN5doris16ToYearOfWeekImplILNS_13PrimitiveTypeE25EE27get_variadic_argument_typesEv Line | Count | Source | 73 | 1 | static DataTypes get_variadic_argument_types() { \ | 74 | 1 | return {std::make_shared<typename PrimitiveTypeTraits<PType>::DataType>()}; \ | 75 | 1 | } \ |
_ZN5doris13ToQuarterImplILNS_13PrimitiveTypeE25EE27get_variadic_argument_typesEv Line | Count | Source | 73 | 1 | static DataTypes get_variadic_argument_types() { \ | 74 | 1 | return {std::make_shared<typename PrimitiveTypeTraits<PType>::DataType>()}; \ | 75 | 1 | } \ |
_ZN5doris10ToDaysImplILNS_13PrimitiveTypeE25EE27get_variadic_argument_typesEv Line | Count | Source | 73 | 1 | static DataTypes get_variadic_argument_types() { \ | 74 | 1 | return {std::make_shared<typename PrimitiveTypeTraits<PType>::DataType>()}; \ | 75 | 1 | } \ |
_ZN5doris17ToMicroSecondImplILNS_13PrimitiveTypeE26EE27get_variadic_argument_typesEv Line | Count | Source | 73 | 1 | static DataTypes get_variadic_argument_types() { \ | 74 | 1 | return {std::make_shared<typename PrimitiveTypeTraits<PType>::DataType>()}; \ | 75 | 1 | } \ |
_ZN5doris12ToSecondImplILNS_13PrimitiveTypeE26EE27get_variadic_argument_typesEv Line | Count | Source | 73 | 1 | static DataTypes get_variadic_argument_types() { \ | 74 | 1 | return {std::make_shared<typename PrimitiveTypeTraits<PType>::DataType>()}; \ | 75 | 1 | } \ |
_ZN5doris12ToMinuteImplILNS_13PrimitiveTypeE26EE27get_variadic_argument_typesEv Line | Count | Source | 73 | 1 | static DataTypes get_variadic_argument_types() { \ | 74 | 1 | return {std::make_shared<typename PrimitiveTypeTraits<PType>::DataType>()}; \ | 75 | 1 | } \ |
_ZN5doris10ToHourImplILNS_13PrimitiveTypeE26EE27get_variadic_argument_typesEv Line | Count | Source | 73 | 1 | static DataTypes get_variadic_argument_types() { \ | 74 | 1 | return {std::make_shared<typename PrimitiveTypeTraits<PType>::DataType>()}; \ | 75 | 1 | } \ |
_ZN5doris9ToDayImplILNS_13PrimitiveTypeE26EE27get_variadic_argument_typesEv Line | Count | Source | 73 | 1 | static DataTypes get_variadic_argument_types() { \ | 74 | 1 | return {std::make_shared<typename PrimitiveTypeTraits<PType>::DataType>()}; \ | 75 | 1 | } \ |
_ZN5doris11ToMonthImplILNS_13PrimitiveTypeE26EE27get_variadic_argument_typesEv Line | Count | Source | 73 | 1 | static DataTypes get_variadic_argument_types() { \ | 74 | 1 | return {std::make_shared<typename PrimitiveTypeTraits<PType>::DataType>()}; \ | 75 | 1 | } \ |
_ZN5doris10ToYearImplILNS_13PrimitiveTypeE26EE27get_variadic_argument_typesEv Line | Count | Source | 73 | 1 | static DataTypes get_variadic_argument_types() { \ | 74 | 1 | return {std::make_shared<typename PrimitiveTypeTraits<PType>::DataType>()}; \ | 75 | 1 | } \ |
_ZN5doris13ToQuarterImplILNS_13PrimitiveTypeE26EE27get_variadic_argument_typesEv Line | Count | Source | 73 | 1 | static DataTypes get_variadic_argument_types() { \ | 74 | 1 | return {std::make_shared<typename PrimitiveTypeTraits<PType>::DataType>()}; \ | 75 | 1 | } \ |
_ZN5doris13ToSecondsImplILNS_13PrimitiveTypeE26EE27get_variadic_argument_typesEv Line | Count | Source | 73 | 1 | static DataTypes get_variadic_argument_types() { \ | 74 | 1 | return {std::make_shared<typename PrimitiveTypeTraits<PType>::DataType>()}; \ | 75 | 1 | } \ |
|
76 | | } |
77 | | |
78 | | #define TO_TIME_FUNCTION(CLASS, UNIT) TIME_FUNCTION_IMPL(CLASS, UNIT, UNIT()) |
79 | | |
80 | | TO_TIME_FUNCTION(ToYearImpl, year); |
81 | | template <PrimitiveType PType> |
82 | | struct ToCenturyImpl { |
83 | | static constexpr PrimitiveType OpArgType = PType; |
84 | | using CppType = typename PrimitiveTypeTraits<PType>::CppType; |
85 | | static constexpr auto name = "century"; |
86 | | |
87 | 31 | static inline auto execute(const CppType& t) { |
88 | 31 | const auto& date_time_value = t; |
89 | 31 | int year = date_time_value.year(); |
90 | 31 | return (year - 1) / 100 + 1; |
91 | 31 | } _ZN5doris13ToCenturyImplILNS_13PrimitiveTypeE25EE7executeERKNS_11DateV2ValueINS_15DateV2ValueTypeEEE Line | Count | Source | 87 | 4 | static inline auto execute(const CppType& t) { | 88 | 4 | const auto& date_time_value = t; | 89 | 4 | int year = date_time_value.year(); | 90 | 4 | return (year - 1) / 100 + 1; | 91 | 4 | } |
_ZN5doris13ToCenturyImplILNS_13PrimitiveTypeE26EE7executeERKNS_11DateV2ValueINS_19DateTimeV2ValueTypeEEE Line | Count | Source | 87 | 27 | static inline auto execute(const CppType& t) { | 88 | 27 | const auto& date_time_value = t; | 89 | 27 | int year = date_time_value.year(); | 90 | 27 | return (year - 1) / 100 + 1; | 91 | 27 | } |
|
92 | | |
93 | 2 | static DataTypes get_variadic_argument_types() { |
94 | 2 | return {std::make_shared<typename PrimitiveTypeTraits<PType>::DataType>()}; |
95 | 2 | } _ZN5doris13ToCenturyImplILNS_13PrimitiveTypeE25EE27get_variadic_argument_typesEv Line | Count | Source | 93 | 1 | static DataTypes get_variadic_argument_types() { | 94 | 1 | return {std::make_shared<typename PrimitiveTypeTraits<PType>::DataType>()}; | 95 | 1 | } |
_ZN5doris13ToCenturyImplILNS_13PrimitiveTypeE26EE27get_variadic_argument_typesEv Line | Count | Source | 93 | 1 | static DataTypes get_variadic_argument_types() { | 94 | 1 | return {std::make_shared<typename PrimitiveTypeTraits<PType>::DataType>()}; | 95 | 1 | } |
|
96 | | }; |
97 | | TO_TIME_FUNCTION(ToYearOfWeekImpl, year_of_week); |
98 | | TO_TIME_FUNCTION(ToQuarterImpl, quarter); |
99 | | TO_TIME_FUNCTION(ToMonthImpl, month); |
100 | | TO_TIME_FUNCTION(ToDayImpl, day); |
101 | | TO_TIME_FUNCTION(ToHourImpl, hour); |
102 | | TO_TIME_FUNCTION(ToMinuteImpl, minute); |
103 | | TO_TIME_FUNCTION(ToSecondImpl, second); |
104 | | TO_TIME_FUNCTION(ToMicroSecondImpl, microsecond); |
105 | | |
106 | | TIME_FUNCTION_IMPL(WeekOfYearImpl, weekofyear, week(mysql_week_mode(3))); |
107 | | TIME_FUNCTION_IMPL(DayOfYearImpl, dayofyear, day_of_year()); |
108 | | TIME_FUNCTION_IMPL(DayOfMonthImpl, dayofmonth, day()); |
109 | | TIME_FUNCTION_IMPL(DayOfWeekImpl, dayofweek, day_of_week()); |
110 | | TIME_FUNCTION_IMPL(WeekDayImpl, weekday, weekday()); |
111 | | // TODO: the method should be always not nullable |
112 | | TIME_FUNCTION_IMPL(ToDaysImpl, to_days, daynr()); |
113 | | TIME_FUNCTION_IMPL(ToSecondsImpl, to_seconds, |
114 | | daynr() * 86400L + date_time_value.time_part_to_seconds()); |
115 | | |
116 | | #define TIME_FUNCTION_ONE_ARG_IMPL(CLASS, UNIT, FUNCTION) \ |
117 | | template <PrimitiveType PType> \ |
118 | | struct CLASS { \ |
119 | | static constexpr PrimitiveType OpArgType = PType; \ |
120 | | using ArgType = typename PrimitiveTypeTraits<PType>::CppType; \ |
121 | | static constexpr auto name = #UNIT; \ |
122 | | \ |
123 | 12 | static inline auto execute(const ArgType& t) { \ |
124 | 12 | const auto& date_time_value = (typename PrimitiveTypeTraits<PType>::CppType&)(t); \ |
125 | 12 | return date_time_value.FUNCTION; \ |
126 | 12 | } \ _ZN5doris20ToYearWeekOneArgImplILNS_13PrimitiveTypeE25EE7executeERKNS_11DateV2ValueINS_15DateV2ValueTypeEEE Line | Count | Source | 123 | 2 | static inline auto execute(const ArgType& t) { \ | 124 | 2 | const auto& date_time_value = (typename PrimitiveTypeTraits<PType>::CppType&)(t); \ | 125 | 2 | return date_time_value.FUNCTION; \ | 126 | 2 | } \ |
_ZN5doris20ToYearWeekOneArgImplILNS_13PrimitiveTypeE26EE7executeERKNS_11DateV2ValueINS_19DateTimeV2ValueTypeEEE Line | Count | Source | 123 | 4 | static inline auto execute(const ArgType& t) { \ | 124 | 4 | const auto& date_time_value = (typename PrimitiveTypeTraits<PType>::CppType&)(t); \ | 125 | 4 | return date_time_value.FUNCTION; \ | 126 | 4 | } \ |
_ZN5doris16ToWeekOneArgImplILNS_13PrimitiveTypeE25EE7executeERKNS_11DateV2ValueINS_15DateV2ValueTypeEEE Line | Count | Source | 123 | 2 | static inline auto execute(const ArgType& t) { \ | 124 | 2 | const auto& date_time_value = (typename PrimitiveTypeTraits<PType>::CppType&)(t); \ | 125 | 2 | return date_time_value.FUNCTION; \ | 126 | 2 | } \ |
_ZN5doris16ToWeekOneArgImplILNS_13PrimitiveTypeE26EE7executeERKNS_11DateV2ValueINS_19DateTimeV2ValueTypeEEE Line | Count | Source | 123 | 4 | static inline auto execute(const ArgType& t) { \ | 124 | 4 | const auto& date_time_value = (typename PrimitiveTypeTraits<PType>::CppType&)(t); \ | 125 | 4 | return date_time_value.FUNCTION; \ | 126 | 4 | } \ |
|
127 | | \ |
128 | 4 | static DataTypes get_variadic_argument_types() { \ |
129 | 4 | return {std::make_shared<typename PrimitiveTypeTraits<PType>::DataType>()}; \ |
130 | 4 | } \ _ZN5doris20ToYearWeekOneArgImplILNS_13PrimitiveTypeE25EE27get_variadic_argument_typesEv Line | Count | Source | 128 | 1 | static DataTypes get_variadic_argument_types() { \ | 129 | 1 | return {std::make_shared<typename PrimitiveTypeTraits<PType>::DataType>()}; \ | 130 | 1 | } \ |
_ZN5doris20ToYearWeekOneArgImplILNS_13PrimitiveTypeE26EE27get_variadic_argument_typesEv Line | Count | Source | 128 | 1 | static DataTypes get_variadic_argument_types() { \ | 129 | 1 | return {std::make_shared<typename PrimitiveTypeTraits<PType>::DataType>()}; \ | 130 | 1 | } \ |
_ZN5doris16ToWeekOneArgImplILNS_13PrimitiveTypeE25EE27get_variadic_argument_typesEv Line | Count | Source | 128 | 1 | static DataTypes get_variadic_argument_types() { \ | 129 | 1 | return {std::make_shared<typename PrimitiveTypeTraits<PType>::DataType>()}; \ | 130 | 1 | } \ |
_ZN5doris16ToWeekOneArgImplILNS_13PrimitiveTypeE26EE27get_variadic_argument_typesEv Line | Count | Source | 128 | 1 | static DataTypes get_variadic_argument_types() { \ | 129 | 1 | return {std::make_shared<typename PrimitiveTypeTraits<PType>::DataType>()}; \ | 130 | 1 | } \ |
|
131 | | } |
132 | | |
133 | | TIME_FUNCTION_ONE_ARG_IMPL(ToWeekOneArgImpl, week, week(mysql_week_mode(0))); |
134 | | TIME_FUNCTION_ONE_ARG_IMPL(ToYearWeekOneArgImpl, yearweek, year_week(mysql_week_mode(0))); |
135 | | |
136 | | template <PrimitiveType PType> |
137 | | struct ToDateImpl { |
138 | | static constexpr PrimitiveType OpArgType = PType; |
139 | | using DateType = typename PrimitiveTypeTraits<PType>::CppType; |
140 | | static constexpr auto name = "to_date"; |
141 | | |
142 | 5 | static auto execute(const DateType& t) { |
143 | 5 | if constexpr (std::is_same_v<DateType, DateV2Value<DateV2ValueType>>) { |
144 | 2 | return t; |
145 | | } else if constexpr (std::is_same_v<DateType, VecDateTimeValue>) { |
146 | | t.cast_to_date(); |
147 | | return t; |
148 | 3 | } else { |
149 | 3 | return binary_cast<UInt32, DateV2Value<DateV2ValueType>>( |
150 | 3 | (UInt32)(t.to_date_int_val() >> TIME_PART_LENGTH)); |
151 | 3 | } |
152 | 5 | } _ZN5doris10ToDateImplILNS_13PrimitiveTypeE25EE7executeERKNS_11DateV2ValueINS_15DateV2ValueTypeEEE Line | Count | Source | 142 | 2 | static auto execute(const DateType& t) { | 143 | 2 | if constexpr (std::is_same_v<DateType, DateV2Value<DateV2ValueType>>) { | 144 | 2 | return t; | 145 | | } else if constexpr (std::is_same_v<DateType, VecDateTimeValue>) { | 146 | | t.cast_to_date(); | 147 | | return t; | 148 | | } else { | 149 | | return binary_cast<UInt32, DateV2Value<DateV2ValueType>>( | 150 | | (UInt32)(t.to_date_int_val() >> TIME_PART_LENGTH)); | 151 | | } | 152 | 2 | } |
_ZN5doris10ToDateImplILNS_13PrimitiveTypeE26EE7executeERKNS_11DateV2ValueINS_19DateTimeV2ValueTypeEEE Line | Count | Source | 142 | 3 | static auto execute(const DateType& t) { | 143 | | if constexpr (std::is_same_v<DateType, DateV2Value<DateV2ValueType>>) { | 144 | | return t; | 145 | | } else if constexpr (std::is_same_v<DateType, VecDateTimeValue>) { | 146 | | t.cast_to_date(); | 147 | | return t; | 148 | 3 | } else { | 149 | 3 | return binary_cast<UInt32, DateV2Value<DateV2ValueType>>( | 150 | 3 | (UInt32)(t.to_date_int_val() >> TIME_PART_LENGTH)); | 151 | 3 | } | 152 | 3 | } |
|
153 | | |
154 | 4 | static DataTypes get_variadic_argument_types() { |
155 | 4 | return {std::make_shared<typename PrimitiveTypeTraits<PType>::DataType>()}; |
156 | 4 | } _ZN5doris10ToDateImplILNS_13PrimitiveTypeE25EE27get_variadic_argument_typesEv Line | Count | Source | 154 | 2 | static DataTypes get_variadic_argument_types() { | 155 | 2 | return {std::make_shared<typename PrimitiveTypeTraits<PType>::DataType>()}; | 156 | 2 | } |
_ZN5doris10ToDateImplILNS_13PrimitiveTypeE26EE27get_variadic_argument_typesEv Line | Count | Source | 154 | 2 | static DataTypes get_variadic_argument_types() { | 155 | 2 | return {std::make_shared<typename PrimitiveTypeTraits<PType>::DataType>()}; | 156 | 2 | } |
|
157 | | }; |
158 | | |
159 | | template <PrimitiveType ArgType> |
160 | | struct DateImpl : public ToDateImpl<ArgType> { |
161 | | static constexpr auto name = "date"; |
162 | | }; |
163 | | |
164 | | // TODO: This function look like no need do indeed copy here, we should optimize this function |
165 | | template <PrimitiveType PType> |
166 | | struct TimeStampImpl { |
167 | | static constexpr PrimitiveType OpArgType = PType; |
168 | | using ArgType = typename PrimitiveTypeTraits<PType>::CppType; |
169 | | static constexpr auto name = "timestamp"; |
170 | | |
171 | 0 | static auto execute(const ArgType& t) { return t; } |
172 | | |
173 | 1 | static DataTypes get_variadic_argument_types() { |
174 | 1 | return {std::make_shared<typename PrimitiveTypeTraits<PType>::DataType>()}; |
175 | 1 | } |
176 | | }; |
177 | | |
178 | | template <PrimitiveType PType> |
179 | | struct DayNameImpl { |
180 | | static constexpr PrimitiveType OpArgType = PType; |
181 | | using ArgType = typename PrimitiveTypeTraits<PType>::CppType; |
182 | | static constexpr auto name = "dayname"; |
183 | | static constexpr auto max_size = MAX_DAY_NAME_LEN; |
184 | | |
185 | | static auto execute(const typename PrimitiveTypeTraits<PType>::CppType& dt, |
186 | | ColumnString::Chars& res_data, size_t& offset, const char* const* day_names, |
187 | 3 | FunctionContext* /*context*/) { |
188 | 3 | DCHECK(day_names != nullptr); |
189 | 3 | const auto* day_name = dt.day_name_with_locale(day_names); |
190 | 3 | if (day_name != nullptr) { |
191 | 3 | auto len = strlen(day_name); |
192 | 3 | memcpy(&res_data[offset], day_name, len); |
193 | 3 | offset += len; |
194 | 3 | } |
195 | 3 | return offset; |
196 | 3 | } _ZN5doris11DayNameImplILNS_13PrimitiveTypeE25EE7executeERKNS_11DateV2ValueINS_15DateV2ValueTypeEEERNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEERmPKPKcPNS_15FunctionContextE Line | Count | Source | 187 | 1 | FunctionContext* /*context*/) { | 188 | 1 | DCHECK(day_names != nullptr); | 189 | 1 | const auto* day_name = dt.day_name_with_locale(day_names); | 190 | 1 | if (day_name != nullptr) { | 191 | 1 | auto len = strlen(day_name); | 192 | 1 | memcpy(&res_data[offset], day_name, len); | 193 | 1 | offset += len; | 194 | 1 | } | 195 | 1 | return offset; | 196 | 1 | } |
_ZN5doris11DayNameImplILNS_13PrimitiveTypeE26EE7executeERKNS_11DateV2ValueINS_19DateTimeV2ValueTypeEEERNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEERmPKPKcPNS_15FunctionContextE Line | Count | Source | 187 | 2 | FunctionContext* /*context*/) { | 188 | 2 | DCHECK(day_names != nullptr); | 189 | 2 | const auto* day_name = dt.day_name_with_locale(day_names); | 190 | 2 | if (day_name != nullptr) { | 191 | 2 | auto len = strlen(day_name); | 192 | 2 | memcpy(&res_data[offset], day_name, len); | 193 | 2 | offset += len; | 194 | 2 | } | 195 | 2 | return offset; | 196 | 2 | } |
|
197 | | |
198 | 2 | static DataTypes get_variadic_argument_types() { |
199 | 2 | return {std::make_shared<typename PrimitiveTypeTraits<PType>::DataType>()}; |
200 | 2 | } _ZN5doris11DayNameImplILNS_13PrimitiveTypeE25EE27get_variadic_argument_typesEv Line | Count | Source | 198 | 1 | static DataTypes get_variadic_argument_types() { | 199 | 1 | return {std::make_shared<typename PrimitiveTypeTraits<PType>::DataType>()}; | 200 | 1 | } |
_ZN5doris11DayNameImplILNS_13PrimitiveTypeE26EE27get_variadic_argument_typesEv Line | Count | Source | 198 | 1 | static DataTypes get_variadic_argument_types() { | 199 | 1 | return {std::make_shared<typename PrimitiveTypeTraits<PType>::DataType>()}; | 200 | 1 | } |
|
201 | | }; |
202 | | |
203 | | template <PrimitiveType PType> |
204 | | struct ToIso8601Impl { |
205 | | static constexpr PrimitiveType OpArgType = PType; |
206 | | using ArgType = typename PrimitiveTypeTraits<PType>::CppType; |
207 | | static constexpr auto name = "to_iso8601"; |
208 | | static constexpr auto max_size = PType == TYPE_DATEV2 ? 10 : 26; |
209 | | |
210 | | static auto execute(const typename PrimitiveTypeTraits<PType>::CppType& dt, |
211 | | ColumnString::Chars& res_data, size_t& offset, |
212 | 0 | const char* const* /*names_ptr*/, FunctionContext* /*context*/) { |
213 | 0 | auto length = dt.to_buffer((char*)res_data.data() + offset, |
214 | 0 | std::is_same_v<ArgType, UInt32> ? -1 : 6); |
215 | 0 | if (PType == TYPE_DATETIMEV2 || PType == TYPE_TIMESTAMPTZ) { |
216 | 0 | res_data[offset + 10] = 'T'; |
217 | 0 | } |
218 | |
|
219 | 0 | offset += length; |
220 | 0 | return offset; |
221 | 0 | } Unexecuted instantiation: _ZN5doris13ToIso8601ImplILNS_13PrimitiveTypeE25EE7executeERKNS_11DateV2ValueINS_15DateV2ValueTypeEEERNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEERmPKPKcPNS_15FunctionContextE Unexecuted instantiation: _ZN5doris13ToIso8601ImplILNS_13PrimitiveTypeE26EE7executeERKNS_11DateV2ValueINS_19DateTimeV2ValueTypeEEERNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEERmPKPKcPNS_15FunctionContextE |
222 | | |
223 | 2 | static DataTypes get_variadic_argument_types() { |
224 | 2 | return {std::make_shared<typename PrimitiveTypeTraits<PType>::DataType>()}; |
225 | 2 | } _ZN5doris13ToIso8601ImplILNS_13PrimitiveTypeE25EE27get_variadic_argument_typesEv Line | Count | Source | 223 | 1 | static DataTypes get_variadic_argument_types() { | 224 | 1 | return {std::make_shared<typename PrimitiveTypeTraits<PType>::DataType>()}; | 225 | 1 | } |
_ZN5doris13ToIso8601ImplILNS_13PrimitiveTypeE26EE27get_variadic_argument_typesEv Line | Count | Source | 223 | 1 | static DataTypes get_variadic_argument_types() { | 224 | 1 | return {std::make_shared<typename PrimitiveTypeTraits<PType>::DataType>()}; | 225 | 1 | } |
|
226 | | }; |
227 | | |
228 | | // Specialization for TIMESTAMPTZ type |
229 | | template <> |
230 | | struct ToIso8601Impl<TYPE_TIMESTAMPTZ> { |
231 | | static constexpr PrimitiveType OpArgType = TYPE_TIMESTAMPTZ; |
232 | | using ArgType = typename PrimitiveTypeTraits<TYPE_TIMESTAMPTZ>::CppType; |
233 | | static constexpr auto name = "to_iso8601"; |
234 | | // Format: YYYY-MM-DDTHH:MM:SS.SSSSSS+HH:MM |
235 | | static constexpr auto max_size = 32; |
236 | | |
237 | | static auto execute(const TimestampTzValue& tz_value, ColumnString::Chars& res_data, |
238 | | size_t& offset, const char* const* /*names_ptr*/, |
239 | 0 | FunctionContext* context) { |
240 | | // Get timezone |
241 | 0 | const auto& local_time_zone = context->state()->timezone_obj(); |
242 | | |
243 | | // Convert UTC time to local time |
244 | 0 | cctz::civil_second utc_sec(tz_value.year(), tz_value.month(), tz_value.day(), |
245 | 0 | tz_value.hour(), tz_value.minute(), tz_value.second()); |
246 | 0 | cctz::time_point<cctz::seconds> local_time = cctz::convert(utc_sec, cctz::utc_time_zone()); |
247 | |
|
248 | 0 | auto lookup_result = local_time_zone.lookup(local_time); |
249 | 0 | cctz::civil_second civ = lookup_result.cs; |
250 | 0 | auto time_offset = lookup_result.offset; |
251 | |
|
252 | 0 | int offset_hours = time_offset / 3600; |
253 | 0 | int offset_mins = (std::abs(time_offset) % 3600) / 60; |
254 | | |
255 | | // Create local datetime value |
256 | 0 | DateV2Value<DateTimeV2ValueType> local_dt; |
257 | 0 | local_dt.unchecked_set_time((uint16_t)civ.year(), (uint8_t)civ.month(), (uint8_t)civ.day(), |
258 | 0 | (uint8_t)civ.hour(), (uint8_t)civ.minute(), |
259 | 0 | (uint8_t)civ.second(), tz_value.microsecond()); |
260 | | |
261 | | // YYYY-MM-DDTHH:MM:SS.SSSSSS+HH:MM |
262 | 0 | auto length = local_dt.to_buffer((char*)res_data.data() + offset, 6); |
263 | 0 | res_data[offset + 10] = 'T'; |
264 | 0 | res_data[offset + length] = (offset_hours >= 0 ? '+' : '-'); |
265 | 0 | res_data[offset + length + 1] = static_cast<char>('0' + std::abs(offset_hours) / 10); |
266 | 0 | res_data[offset + length + 2] = '0' + std::abs(offset_hours) % 10; |
267 | 0 | res_data[offset + length + 3] = ':'; |
268 | 0 | res_data[offset + length + 4] = static_cast<char>('0' + offset_mins / 10); |
269 | 0 | res_data[offset + length + 5] = '0' + offset_mins % 10; |
270 | |
|
271 | 0 | offset += length + 6; |
272 | 0 | return offset; |
273 | 0 | } |
274 | | |
275 | 1 | static DataTypes get_variadic_argument_types() { |
276 | 1 | return {std::make_shared<typename PrimitiveTypeTraits<TYPE_TIMESTAMPTZ>::DataType>()}; |
277 | 1 | } |
278 | | }; |
279 | | |
280 | | template <PrimitiveType PType> |
281 | | struct MonthNameImpl { |
282 | | static constexpr PrimitiveType OpArgType = PType; |
283 | | using ArgType = typename PrimitiveTypeTraits<PType>::CppType; |
284 | | static constexpr auto name = "monthname"; |
285 | | static constexpr auto max_size = MAX_MONTH_NAME_LEN; |
286 | | |
287 | | static auto execute(const typename PrimitiveTypeTraits<PType>::CppType& dt, |
288 | | ColumnString::Chars& res_data, size_t& offset, |
289 | 0 | const char* const* month_names, FunctionContext* /*context*/) { |
290 | 0 | DCHECK(month_names != nullptr); |
291 | 0 | const auto* month_name = dt.month_name_with_locale(month_names); |
292 | 0 | if (month_name != nullptr) { |
293 | 0 | auto len = strlen(month_name); |
294 | 0 | memcpy(&res_data[offset], month_name, len); |
295 | 0 | offset += len; |
296 | 0 | } |
297 | 0 | return offset; |
298 | 0 | } Unexecuted instantiation: _ZN5doris13MonthNameImplILNS_13PrimitiveTypeE25EE7executeERKNS_11DateV2ValueINS_15DateV2ValueTypeEEERNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEERmPKPKcPNS_15FunctionContextE Unexecuted instantiation: _ZN5doris13MonthNameImplILNS_13PrimitiveTypeE26EE7executeERKNS_11DateV2ValueINS_19DateTimeV2ValueTypeEEERNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEERmPKPKcPNS_15FunctionContextE |
299 | | |
300 | 2 | static DataTypes get_variadic_argument_types() { |
301 | 2 | return {std::make_shared<typename PrimitiveTypeTraits<PType>::DataType>()}; |
302 | 2 | } _ZN5doris13MonthNameImplILNS_13PrimitiveTypeE25EE27get_variadic_argument_typesEv Line | Count | Source | 300 | 1 | static DataTypes get_variadic_argument_types() { | 301 | 1 | return {std::make_shared<typename PrimitiveTypeTraits<PType>::DataType>()}; | 302 | 1 | } |
_ZN5doris13MonthNameImplILNS_13PrimitiveTypeE26EE27get_variadic_argument_typesEv Line | Count | Source | 300 | 1 | static DataTypes get_variadic_argument_types() { | 301 | 1 | return {std::make_shared<typename PrimitiveTypeTraits<PType>::DataType>()}; | 302 | 1 | } |
|
303 | | }; |
304 | | |
305 | | template <typename FormatImpl, const char* FuncName> |
306 | | struct DateTimeV2FormatImpl { |
307 | | static constexpr PrimitiveType OpArgType = TYPE_DATETIMEV2; |
308 | | using ArgType = typename PrimitiveTypeTraits<TYPE_DATETIMEV2>::CppType; |
309 | | static constexpr auto name = FuncName; |
310 | | static constexpr auto max_size = FormatImpl::row_size; |
311 | | |
312 | | static auto execute(const ArgType& dt, ColumnString::Chars& res_data, size_t& offset, |
313 | 0 | const char* const* /*names_ptr*/, FunctionContext* /*context*/) { |
314 | 0 | auto* buf = reinterpret_cast<char*>(&res_data[offset]); |
315 | 0 | offset += FormatImpl::date_to_str(dt, buf); |
316 | 0 | return offset; |
317 | 0 | } Unexecuted instantiation: _ZN5doris20DateTimeV2FormatImplINS_16time_format_type11yyyy_MMImplEXadsoKcL_ZNS_14kYearMonthNameEEEEE7executeERKNS_11DateV2ValueINS_19DateTimeV2ValueTypeEEERNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEERmPKPS3_PNS_15FunctionContextE Unexecuted instantiation: _ZN5doris20DateTimeV2FormatImplINS_16time_format_type9dd_HHImplEXadsoKcL_ZNS_12kDayHourNameEEEEE7executeERKNS_11DateV2ValueINS_19DateTimeV2ValueTypeEEERNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEERmPKPS3_PNS_15FunctionContextE Unexecuted instantiation: _ZN5doris20DateTimeV2FormatImplINS_16time_format_type12dd_HH_mmImplEXadsoKcL_ZNS_14kDayMinuteNameEEEEE7executeERKNS_11DateV2ValueINS_19DateTimeV2ValueTypeEEERNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEERmPKPS3_PNS_15FunctionContextE Unexecuted instantiation: _ZN5doris20DateTimeV2FormatImplINS_16time_format_type15dd_HH_mm_ssImplEXadsoKcL_ZNS_14kDaySecondNameEEEEE7executeERKNS_11DateV2ValueINS_19DateTimeV2ValueTypeEEERNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEERmPKPS3_PNS_15FunctionContextE Unexecuted instantiation: _ZN5doris20DateTimeV2FormatImplINS_16time_format_type22dd_HH_mm_ss_SSSSSSImplEXadsoKcL_ZNS_19kDayMicrosecondNameEEEEE7executeERKNS_11DateV2ValueINS_19DateTimeV2ValueTypeEEERNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEERmPKPS3_PNS_15FunctionContextE Unexecuted instantiation: _ZN5doris20DateTimeV2FormatImplINS_16time_format_type9HH_mmImplEXadsoKcL_ZNS_15kHourMinuteNameEEEEE7executeERKNS_11DateV2ValueINS_19DateTimeV2ValueTypeEEERNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEERmPKPS3_PNS_15FunctionContextE Unexecuted instantiation: _ZN5doris20DateTimeV2FormatImplINS_16time_format_type12HH_mm_ssImplEXadsoKcL_ZNS_15kHourSecondNameEEEEE7executeERKNS_11DateV2ValueINS_19DateTimeV2ValueTypeEEERNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEERmPKPS3_PNS_15FunctionContextE Unexecuted instantiation: _ZN5doris20DateTimeV2FormatImplINS_16time_format_type19HH_mm_ss_SSSSSSImplEXadsoKcL_ZNS_20kHourMicrosecondNameEEEEE7executeERKNS_11DateV2ValueINS_19DateTimeV2ValueTypeEEERNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEERmPKPS3_PNS_15FunctionContextE Unexecuted instantiation: _ZN5doris20DateTimeV2FormatImplINS_16time_format_type9mm_ssImplEXadsoKcL_ZNS_17kMinuteSecondNameEEEEE7executeERKNS_11DateV2ValueINS_19DateTimeV2ValueTypeEEERNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEERmPKPS3_PNS_15FunctionContextE Unexecuted instantiation: _ZN5doris20DateTimeV2FormatImplINS_16time_format_type16mm_ss_SSSSSSImplEXadsoKcL_ZNS_22kMinuteMicrosecondNameEEEEE7executeERKNS_11DateV2ValueINS_19DateTimeV2ValueTypeEEERNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEERmPKPS3_PNS_15FunctionContextE Unexecuted instantiation: _ZN5doris20DateTimeV2FormatImplINS_16time_format_type13ss_SSSSSSImplEXadsoKcL_ZNS_22kSecondMicrosecondNameEEEEE7executeERKNS_11DateV2ValueINS_19DateTimeV2ValueTypeEEERNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEERmPKPS3_PNS_15FunctionContextE |
318 | | |
319 | 11 | static DataTypes get_variadic_argument_types() { |
320 | 11 | return {std::make_shared<typename PrimitiveTypeTraits<TYPE_DATETIMEV2>::DataType>()}; |
321 | 11 | } _ZN5doris20DateTimeV2FormatImplINS_16time_format_type11yyyy_MMImplEXadsoKcL_ZNS_14kYearMonthNameEEEEE27get_variadic_argument_typesEv Line | Count | Source | 319 | 1 | static DataTypes get_variadic_argument_types() { | 320 | 1 | return {std::make_shared<typename PrimitiveTypeTraits<TYPE_DATETIMEV2>::DataType>()}; | 321 | 1 | } |
_ZN5doris20DateTimeV2FormatImplINS_16time_format_type9dd_HHImplEXadsoKcL_ZNS_12kDayHourNameEEEEE27get_variadic_argument_typesEv Line | Count | Source | 319 | 1 | static DataTypes get_variadic_argument_types() { | 320 | 1 | return {std::make_shared<typename PrimitiveTypeTraits<TYPE_DATETIMEV2>::DataType>()}; | 321 | 1 | } |
_ZN5doris20DateTimeV2FormatImplINS_16time_format_type12dd_HH_mmImplEXadsoKcL_ZNS_14kDayMinuteNameEEEEE27get_variadic_argument_typesEv Line | Count | Source | 319 | 1 | static DataTypes get_variadic_argument_types() { | 320 | 1 | return {std::make_shared<typename PrimitiveTypeTraits<TYPE_DATETIMEV2>::DataType>()}; | 321 | 1 | } |
_ZN5doris20DateTimeV2FormatImplINS_16time_format_type15dd_HH_mm_ssImplEXadsoKcL_ZNS_14kDaySecondNameEEEEE27get_variadic_argument_typesEv Line | Count | Source | 319 | 1 | static DataTypes get_variadic_argument_types() { | 320 | 1 | return {std::make_shared<typename PrimitiveTypeTraits<TYPE_DATETIMEV2>::DataType>()}; | 321 | 1 | } |
_ZN5doris20DateTimeV2FormatImplINS_16time_format_type22dd_HH_mm_ss_SSSSSSImplEXadsoKcL_ZNS_19kDayMicrosecondNameEEEEE27get_variadic_argument_typesEv Line | Count | Source | 319 | 1 | static DataTypes get_variadic_argument_types() { | 320 | 1 | return {std::make_shared<typename PrimitiveTypeTraits<TYPE_DATETIMEV2>::DataType>()}; | 321 | 1 | } |
_ZN5doris20DateTimeV2FormatImplINS_16time_format_type9HH_mmImplEXadsoKcL_ZNS_15kHourMinuteNameEEEEE27get_variadic_argument_typesEv Line | Count | Source | 319 | 1 | static DataTypes get_variadic_argument_types() { | 320 | 1 | return {std::make_shared<typename PrimitiveTypeTraits<TYPE_DATETIMEV2>::DataType>()}; | 321 | 1 | } |
_ZN5doris20DateTimeV2FormatImplINS_16time_format_type12HH_mm_ssImplEXadsoKcL_ZNS_15kHourSecondNameEEEEE27get_variadic_argument_typesEv Line | Count | Source | 319 | 1 | static DataTypes get_variadic_argument_types() { | 320 | 1 | return {std::make_shared<typename PrimitiveTypeTraits<TYPE_DATETIMEV2>::DataType>()}; | 321 | 1 | } |
_ZN5doris20DateTimeV2FormatImplINS_16time_format_type19HH_mm_ss_SSSSSSImplEXadsoKcL_ZNS_20kHourMicrosecondNameEEEEE27get_variadic_argument_typesEv Line | Count | Source | 319 | 1 | static DataTypes get_variadic_argument_types() { | 320 | 1 | return {std::make_shared<typename PrimitiveTypeTraits<TYPE_DATETIMEV2>::DataType>()}; | 321 | 1 | } |
_ZN5doris20DateTimeV2FormatImplINS_16time_format_type9mm_ssImplEXadsoKcL_ZNS_17kMinuteSecondNameEEEEE27get_variadic_argument_typesEv Line | Count | Source | 319 | 1 | static DataTypes get_variadic_argument_types() { | 320 | 1 | return {std::make_shared<typename PrimitiveTypeTraits<TYPE_DATETIMEV2>::DataType>()}; | 321 | 1 | } |
_ZN5doris20DateTimeV2FormatImplINS_16time_format_type16mm_ss_SSSSSSImplEXadsoKcL_ZNS_22kMinuteMicrosecondNameEEEEE27get_variadic_argument_typesEv Line | Count | Source | 319 | 1 | static DataTypes get_variadic_argument_types() { | 320 | 1 | return {std::make_shared<typename PrimitiveTypeTraits<TYPE_DATETIMEV2>::DataType>()}; | 321 | 1 | } |
_ZN5doris20DateTimeV2FormatImplINS_16time_format_type13ss_SSSSSSImplEXadsoKcL_ZNS_22kSecondMicrosecondNameEEEEE27get_variadic_argument_typesEv Line | Count | Source | 319 | 1 | static DataTypes get_variadic_argument_types() { | 320 | 1 | return {std::make_shared<typename PrimitiveTypeTraits<TYPE_DATETIMEV2>::DataType>()}; | 321 | 1 | } |
|
322 | | }; |
323 | | |
324 | | inline constexpr char kYearMonthName[] = "year_month"; |
325 | | inline constexpr char kDayHourName[] = "day_hour"; |
326 | | inline constexpr char kDayMinuteName[] = "day_minute"; |
327 | | inline constexpr char kDaySecondName[] = "day_second"; |
328 | | inline constexpr char kDayMicrosecondName[] = "day_microsecond"; |
329 | | inline constexpr char kHourMinuteName[] = "hour_minute"; |
330 | | inline constexpr char kHourSecondName[] = "hour_second"; |
331 | | inline constexpr char kHourMicrosecondName[] = "hour_microsecond"; |
332 | | inline constexpr char kMinuteSecondName[] = "minute_second"; |
333 | | inline constexpr char kMinuteMicrosecondName[] = "minute_microsecond"; |
334 | | inline constexpr char kSecondMicrosecondName[] = "second_microsecond"; |
335 | | |
336 | | using YearMonthImpl = DateTimeV2FormatImpl<time_format_type::yyyy_MMImpl, kYearMonthName>; |
337 | | using DayHourImpl = DateTimeV2FormatImpl<time_format_type::dd_HHImpl, kDayHourName>; |
338 | | using DayMinuteImpl = DateTimeV2FormatImpl<time_format_type::dd_HH_mmImpl, kDayMinuteName>; |
339 | | using DaySecondImpl = DateTimeV2FormatImpl<time_format_type::dd_HH_mm_ssImpl, kDaySecondName>; |
340 | | using DayMicrosecondImpl = |
341 | | DateTimeV2FormatImpl<time_format_type::dd_HH_mm_ss_SSSSSSImpl, kDayMicrosecondName>; |
342 | | using HourMinuteImpl = DateTimeV2FormatImpl<time_format_type::HH_mmImpl, kHourMinuteName>; |
343 | | using HourSecondImpl = DateTimeV2FormatImpl<time_format_type::HH_mm_ssImpl, kHourSecondName>; |
344 | | using HourMicrosecondImpl = |
345 | | DateTimeV2FormatImpl<time_format_type::HH_mm_ss_SSSSSSImpl, kHourMicrosecondName>; |
346 | | using MinuteSecondImpl = DateTimeV2FormatImpl<time_format_type::mm_ssImpl, kMinuteSecondName>; |
347 | | using MinuteMicrosecondImpl = |
348 | | DateTimeV2FormatImpl<time_format_type::mm_ss_SSSSSSImpl, kMinuteMicrosecondName>; |
349 | | using SecondMicrosecondImpl = |
350 | | DateTimeV2FormatImpl<time_format_type::ss_SSSSSSImpl, kSecondMicrosecondName>; |
351 | | |
352 | | template <PrimitiveType PType> |
353 | | struct DateFormatImpl { |
354 | | using DateType = typename PrimitiveTypeTraits<PType>::CppType; |
355 | | using ArgType = typename PrimitiveTypeTraits<PType>::CppType; |
356 | | static constexpr PrimitiveType FromPType = PType; |
357 | | |
358 | | static constexpr auto name = "date_format"; |
359 | | |
360 | | template <typename Impl> |
361 | | static bool execute(const DateType& dt, StringRef format, ColumnString::Chars& res_data, |
362 | 20 | size_t& offset, const cctz::time_zone& time_zone) { |
363 | 20 | if constexpr (std::is_same_v<Impl, time_format_type::UserDefinedImpl>) { |
364 | | // Handle non-special formats. |
365 | 20 | char buf[100 + SAFE_FORMAT_STRING_MARGIN]; |
366 | 20 | if (!dt.to_format_string_conservative(format.data, format.size, buf, |
367 | 20 | 100 + SAFE_FORMAT_STRING_MARGIN)) { |
368 | 0 | return true; |
369 | 0 | } |
370 | | |
371 | 20 | auto len = strlen(buf); |
372 | 20 | res_data.insert(buf, buf + len); |
373 | 20 | offset += len; |
374 | 20 | return false; |
375 | 20 | } else { |
376 | 0 | if (!dt.is_valid_date()) { |
377 | 0 | return true; |
378 | 0 | } |
379 | | |
380 | | // No buffer is needed here because these specially optimized formats have fixed lengths, |
381 | | // and sufficient memory has already been reserved. |
382 | 0 | auto len = Impl::date_to_str(dt, (char*)res_data.data() + offset); |
383 | 0 | offset += len; |
384 | |
|
385 | 0 | return false; |
386 | 0 | } |
387 | 20 | } _ZN5doris14DateFormatImplILNS_13PrimitiveTypeE25EE7executeINS_16time_format_type15UserDefinedImplEEEbRKNS_11DateV2ValueINS_15DateV2ValueTypeEEENS_9StringRefERNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEERmRKN4cctz9time_zoneE Line | Count | Source | 362 | 6 | size_t& offset, const cctz::time_zone& time_zone) { | 363 | 6 | if constexpr (std::is_same_v<Impl, time_format_type::UserDefinedImpl>) { | 364 | | // Handle non-special formats. | 365 | 6 | char buf[100 + SAFE_FORMAT_STRING_MARGIN]; | 366 | 6 | if (!dt.to_format_string_conservative(format.data, format.size, buf, | 367 | 6 | 100 + SAFE_FORMAT_STRING_MARGIN)) { | 368 | 0 | return true; | 369 | 0 | } | 370 | | | 371 | 6 | auto len = strlen(buf); | 372 | 6 | res_data.insert(buf, buf + len); | 373 | 6 | offset += len; | 374 | 6 | return false; | 375 | | } else { | 376 | | if (!dt.is_valid_date()) { | 377 | | return true; | 378 | | } | 379 | | | 380 | | // No buffer is needed here because these specially optimized formats have fixed lengths, | 381 | | // and sufficient memory has already been reserved. | 382 | | auto len = Impl::date_to_str(dt, (char*)res_data.data() + offset); | 383 | | offset += len; | 384 | | | 385 | | return false; | 386 | | } | 387 | 6 | } |
Unexecuted instantiation: _ZN5doris14DateFormatImplILNS_13PrimitiveTypeE25EE7executeINS_16time_format_type12yyyyMMddImplEEEbRKNS_11DateV2ValueINS_15DateV2ValueTypeEEENS_9StringRefERNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEERmRKN4cctz9time_zoneE Unexecuted instantiation: _ZN5doris14DateFormatImplILNS_13PrimitiveTypeE25EE7executeINS_16time_format_type14yyyy_MM_ddImplEEEbRKNS_11DateV2ValueINS_15DateV2ValueTypeEEENS_9StringRefERNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEERmRKN4cctz9time_zoneE Unexecuted instantiation: _ZN5doris14DateFormatImplILNS_13PrimitiveTypeE25EE7executeINS_16time_format_type23yyyy_MM_dd_HH_mm_ssImplEEEbRKNS_11DateV2ValueINS_15DateV2ValueTypeEEENS_9StringRefERNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEERmRKN4cctz9time_zoneE Unexecuted instantiation: _ZN5doris14DateFormatImplILNS_13PrimitiveTypeE25EE7executeINS_16time_format_type11yyyy_MMImplEEEbRKNS_11DateV2ValueINS_15DateV2ValueTypeEEENS_9StringRefERNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEERmRKN4cctz9time_zoneE Unexecuted instantiation: _ZN5doris14DateFormatImplILNS_13PrimitiveTypeE25EE7executeINS_16time_format_type10yyyyMMImplEEEbRKNS_11DateV2ValueINS_15DateV2ValueTypeEEENS_9StringRefERNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEERmRKN4cctz9time_zoneE Unexecuted instantiation: _ZN5doris14DateFormatImplILNS_13PrimitiveTypeE25EE7executeINS_16time_format_type8yyyyImplEEEbRKNS_11DateV2ValueINS_15DateV2ValueTypeEEENS_9StringRefERNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEERmRKN4cctz9time_zoneE _ZN5doris14DateFormatImplILNS_13PrimitiveTypeE26EE7executeINS_16time_format_type15UserDefinedImplEEEbRKNS_11DateV2ValueINS_19DateTimeV2ValueTypeEEENS_9StringRefERNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEERmRKN4cctz9time_zoneE Line | Count | Source | 362 | 14 | size_t& offset, const cctz::time_zone& time_zone) { | 363 | 14 | if constexpr (std::is_same_v<Impl, time_format_type::UserDefinedImpl>) { | 364 | | // Handle non-special formats. | 365 | 14 | char buf[100 + SAFE_FORMAT_STRING_MARGIN]; | 366 | 14 | if (!dt.to_format_string_conservative(format.data, format.size, buf, | 367 | 14 | 100 + SAFE_FORMAT_STRING_MARGIN)) { | 368 | 0 | return true; | 369 | 0 | } | 370 | | | 371 | 14 | auto len = strlen(buf); | 372 | 14 | res_data.insert(buf, buf + len); | 373 | 14 | offset += len; | 374 | 14 | return false; | 375 | | } else { | 376 | | if (!dt.is_valid_date()) { | 377 | | return true; | 378 | | } | 379 | | | 380 | | // No buffer is needed here because these specially optimized formats have fixed lengths, | 381 | | // and sufficient memory has already been reserved. | 382 | | auto len = Impl::date_to_str(dt, (char*)res_data.data() + offset); | 383 | | offset += len; | 384 | | | 385 | | return false; | 386 | | } | 387 | 14 | } |
Unexecuted instantiation: _ZN5doris14DateFormatImplILNS_13PrimitiveTypeE26EE7executeINS_16time_format_type12yyyyMMddImplEEEbRKNS_11DateV2ValueINS_19DateTimeV2ValueTypeEEENS_9StringRefERNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEERmRKN4cctz9time_zoneE Unexecuted instantiation: _ZN5doris14DateFormatImplILNS_13PrimitiveTypeE26EE7executeINS_16time_format_type14yyyy_MM_ddImplEEEbRKNS_11DateV2ValueINS_19DateTimeV2ValueTypeEEENS_9StringRefERNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEERmRKN4cctz9time_zoneE Unexecuted instantiation: _ZN5doris14DateFormatImplILNS_13PrimitiveTypeE26EE7executeINS_16time_format_type23yyyy_MM_dd_HH_mm_ssImplEEEbRKNS_11DateV2ValueINS_19DateTimeV2ValueTypeEEENS_9StringRefERNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEERmRKN4cctz9time_zoneE Unexecuted instantiation: _ZN5doris14DateFormatImplILNS_13PrimitiveTypeE26EE7executeINS_16time_format_type11yyyy_MMImplEEEbRKNS_11DateV2ValueINS_19DateTimeV2ValueTypeEEENS_9StringRefERNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEERmRKN4cctz9time_zoneE Unexecuted instantiation: _ZN5doris14DateFormatImplILNS_13PrimitiveTypeE26EE7executeINS_16time_format_type10yyyyMMImplEEEbRKNS_11DateV2ValueINS_19DateTimeV2ValueTypeEEENS_9StringRefERNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEERmRKN4cctz9time_zoneE Unexecuted instantiation: _ZN5doris14DateFormatImplILNS_13PrimitiveTypeE26EE7executeINS_16time_format_type8yyyyImplEEEbRKNS_11DateV2ValueINS_19DateTimeV2ValueTypeEEENS_9StringRefERNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEERmRKN4cctz9time_zoneE |
388 | | |
389 | 2 | static DataTypes get_variadic_argument_types() { |
390 | 2 | return {std::make_shared<typename PrimitiveTypeTraits<PType>::DataType>(), |
391 | 2 | std::make_shared<DataTypeString>()}; |
392 | 2 | } _ZN5doris14DateFormatImplILNS_13PrimitiveTypeE25EE27get_variadic_argument_typesEv Line | Count | Source | 389 | 1 | static DataTypes get_variadic_argument_types() { | 390 | 1 | return {std::make_shared<typename PrimitiveTypeTraits<PType>::DataType>(), | 391 | 1 | std::make_shared<DataTypeString>()}; | 392 | 1 | } |
_ZN5doris14DateFormatImplILNS_13PrimitiveTypeE26EE27get_variadic_argument_typesEv Line | Count | Source | 389 | 1 | static DataTypes get_variadic_argument_types() { | 390 | 1 | return {std::make_shared<typename PrimitiveTypeTraits<PType>::DataType>(), | 391 | 1 | std::make_shared<DataTypeString>()}; | 392 | 1 | } |
|
393 | | }; |
394 | | |
395 | | template <bool WithStringArg, bool NewVersion = false> |
396 | | struct FromUnixTimeImpl { |
397 | | using ArgType = Int64; |
398 | | static constexpr PrimitiveType FromPType = TYPE_BIGINT; |
399 | | |
400 | 4 | static DataTypes get_variadic_argument_types() { |
401 | 4 | if constexpr (WithStringArg) { |
402 | 2 | return {std::make_shared<DataTypeInt64>(), std::make_shared<DataTypeString>()}; |
403 | 2 | } else { |
404 | 2 | return {std::make_shared<DataTypeInt64>()}; |
405 | 2 | } |
406 | 4 | } _ZN5doris16FromUnixTimeImplILb0ELb0EE27get_variadic_argument_typesEv Line | Count | Source | 400 | 1 | static DataTypes get_variadic_argument_types() { | 401 | | if constexpr (WithStringArg) { | 402 | | return {std::make_shared<DataTypeInt64>(), std::make_shared<DataTypeString>()}; | 403 | 1 | } else { | 404 | 1 | return {std::make_shared<DataTypeInt64>()}; | 405 | 1 | } | 406 | 1 | } |
_ZN5doris16FromUnixTimeImplILb1ELb0EE27get_variadic_argument_typesEv Line | Count | Source | 400 | 1 | static DataTypes get_variadic_argument_types() { | 401 | 1 | if constexpr (WithStringArg) { | 402 | 1 | return {std::make_shared<DataTypeInt64>(), std::make_shared<DataTypeString>()}; | 403 | | } else { | 404 | | return {std::make_shared<DataTypeInt64>()}; | 405 | | } | 406 | 1 | } |
_ZN5doris16FromUnixTimeImplILb0ELb1EE27get_variadic_argument_typesEv Line | Count | Source | 400 | 1 | static DataTypes get_variadic_argument_types() { | 401 | | if constexpr (WithStringArg) { | 402 | | return {std::make_shared<DataTypeInt64>(), std::make_shared<DataTypeString>()}; | 403 | 1 | } else { | 404 | 1 | return {std::make_shared<DataTypeInt64>()}; | 405 | 1 | } | 406 | 1 | } |
_ZN5doris16FromUnixTimeImplILb1ELb1EE27get_variadic_argument_typesEv Line | Count | Source | 400 | 1 | static DataTypes get_variadic_argument_types() { | 401 | 1 | if constexpr (WithStringArg) { | 402 | 1 | return {std::make_shared<DataTypeInt64>(), std::make_shared<DataTypeString>()}; | 403 | | } else { | 404 | | return {std::make_shared<DataTypeInt64>()}; | 405 | | } | 406 | 1 | } |
|
407 | | static const int64_t TIMESTAMP_VALID_MAX = 32536771199; |
408 | | static constexpr auto name = NewVersion ? "from_unixtime_new" : "from_unixtime"; |
409 | | |
410 | 2 | [[nodiscard]] static bool check_valid(const ArgType& val) { |
411 | 2 | if constexpr (NewVersion) { |
412 | 2 | if (val < 0) [[unlikely]] { |
413 | 0 | return false; |
414 | 0 | } |
415 | 2 | } else { |
416 | 0 | if (val < 0 || val > TIMESTAMP_VALID_MAX) [[unlikely]] { |
417 | 0 | return false; |
418 | 0 | } |
419 | 0 | } |
420 | 2 | return true; |
421 | 2 | } Unexecuted instantiation: _ZN5doris16FromUnixTimeImplILb0ELb0EE11check_validERKl Unexecuted instantiation: _ZN5doris16FromUnixTimeImplILb1ELb0EE11check_validERKl _ZN5doris16FromUnixTimeImplILb0ELb1EE11check_validERKl Line | Count | Source | 410 | 2 | [[nodiscard]] static bool check_valid(const ArgType& val) { | 411 | 2 | if constexpr (NewVersion) { | 412 | 2 | if (val < 0) [[unlikely]] { | 413 | 0 | return false; | 414 | 0 | } | 415 | | } else { | 416 | | if (val < 0 || val > TIMESTAMP_VALID_MAX) [[unlikely]] { | 417 | | return false; | 418 | | } | 419 | | } | 420 | 2 | return true; | 421 | 2 | } |
Unexecuted instantiation: _ZN5doris16FromUnixTimeImplILb1ELb1EE11check_validERKl |
422 | | |
423 | | static DateV2Value<DateTimeV2ValueType> get_datetime_value(const ArgType& val, |
424 | 2 | const cctz::time_zone& time_zone) { |
425 | 2 | DateV2Value<DateTimeV2ValueType> dt; |
426 | 2 | dt.from_unixtime(val, time_zone); |
427 | 2 | return dt; |
428 | 2 | } Unexecuted instantiation: _ZN5doris16FromUnixTimeImplILb0ELb0EE18get_datetime_valueERKlRKN4cctz9time_zoneE Unexecuted instantiation: _ZN5doris16FromUnixTimeImplILb1ELb0EE18get_datetime_valueERKlRKN4cctz9time_zoneE _ZN5doris16FromUnixTimeImplILb0ELb1EE18get_datetime_valueERKlRKN4cctz9time_zoneE Line | Count | Source | 424 | 2 | const cctz::time_zone& time_zone) { | 425 | 2 | DateV2Value<DateTimeV2ValueType> dt; | 426 | 2 | dt.from_unixtime(val, time_zone); | 427 | 2 | return dt; | 428 | 2 | } |
Unexecuted instantiation: _ZN5doris16FromUnixTimeImplILb1ELb1EE18get_datetime_valueERKlRKN4cctz9time_zoneE |
429 | | |
430 | | // return true if null(result is invalid) |
431 | | template <typename Impl> |
432 | | static bool execute(const ArgType& val, StringRef format, ColumnString::Chars& res_data, |
433 | 2 | size_t& offset, const cctz::time_zone& time_zone) { |
434 | 2 | if (!check_valid(val)) { |
435 | 0 | return true; |
436 | 0 | } |
437 | 2 | DateV2Value<DateTimeV2ValueType> dt = get_datetime_value(val, time_zone); |
438 | 2 | if (!dt.is_valid_date()) [[unlikely]] { |
439 | 0 | return true; |
440 | 0 | } |
441 | 2 | if constexpr (std::is_same_v<Impl, time_format_type::UserDefinedImpl>) { |
442 | 0 | char buf[100 + SAFE_FORMAT_STRING_MARGIN]; |
443 | 0 | if (!dt.to_format_string_conservative(format.data, format.size, buf, |
444 | 0 | 100 + SAFE_FORMAT_STRING_MARGIN)) { |
445 | 0 | return true; |
446 | 0 | } |
447 | | |
448 | 0 | auto len = strlen(buf); |
449 | 0 | res_data.insert(buf, buf + len); |
450 | 0 | offset += len; |
451 | 2 | } else { |
452 | | // No buffer is needed here because these specially optimized formats have fixed lengths, |
453 | | // and sufficient memory has already been reserved. |
454 | 2 | auto len = Impl::date_to_str(dt, (char*)res_data.data() + offset); |
455 | 2 | offset += len; |
456 | 2 | } |
457 | 0 | return false; |
458 | 2 | } Unexecuted instantiation: _ZN5doris16FromUnixTimeImplILb0ELb0EE7executeINS_16time_format_type15UserDefinedImplEEEbRKlNS_9StringRefERNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEERmRKN4cctz9time_zoneE Unexecuted instantiation: _ZN5doris16FromUnixTimeImplILb0ELb0EE7executeINS_16time_format_type12yyyyMMddImplEEEbRKlNS_9StringRefERNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEERmRKN4cctz9time_zoneE Unexecuted instantiation: _ZN5doris16FromUnixTimeImplILb0ELb0EE7executeINS_16time_format_type14yyyy_MM_ddImplEEEbRKlNS_9StringRefERNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEERmRKN4cctz9time_zoneE Unexecuted instantiation: _ZN5doris16FromUnixTimeImplILb0ELb0EE7executeINS_16time_format_type23yyyy_MM_dd_HH_mm_ssImplEEEbRKlNS_9StringRefERNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEERmRKN4cctz9time_zoneE Unexecuted instantiation: _ZN5doris16FromUnixTimeImplILb0ELb0EE7executeINS_16time_format_type11yyyy_MMImplEEEbRKlNS_9StringRefERNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEERmRKN4cctz9time_zoneE Unexecuted instantiation: _ZN5doris16FromUnixTimeImplILb0ELb0EE7executeINS_16time_format_type10yyyyMMImplEEEbRKlNS_9StringRefERNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEERmRKN4cctz9time_zoneE Unexecuted instantiation: _ZN5doris16FromUnixTimeImplILb0ELb0EE7executeINS_16time_format_type8yyyyImplEEEbRKlNS_9StringRefERNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEERmRKN4cctz9time_zoneE Unexecuted instantiation: _ZN5doris16FromUnixTimeImplILb1ELb0EE7executeINS_16time_format_type15UserDefinedImplEEEbRKlNS_9StringRefERNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEERmRKN4cctz9time_zoneE Unexecuted instantiation: _ZN5doris16FromUnixTimeImplILb1ELb0EE7executeINS_16time_format_type12yyyyMMddImplEEEbRKlNS_9StringRefERNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEERmRKN4cctz9time_zoneE Unexecuted instantiation: _ZN5doris16FromUnixTimeImplILb1ELb0EE7executeINS_16time_format_type14yyyy_MM_ddImplEEEbRKlNS_9StringRefERNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEERmRKN4cctz9time_zoneE Unexecuted instantiation: _ZN5doris16FromUnixTimeImplILb1ELb0EE7executeINS_16time_format_type23yyyy_MM_dd_HH_mm_ssImplEEEbRKlNS_9StringRefERNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEERmRKN4cctz9time_zoneE Unexecuted instantiation: _ZN5doris16FromUnixTimeImplILb1ELb0EE7executeINS_16time_format_type11yyyy_MMImplEEEbRKlNS_9StringRefERNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEERmRKN4cctz9time_zoneE Unexecuted instantiation: _ZN5doris16FromUnixTimeImplILb1ELb0EE7executeINS_16time_format_type10yyyyMMImplEEEbRKlNS_9StringRefERNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEERmRKN4cctz9time_zoneE Unexecuted instantiation: _ZN5doris16FromUnixTimeImplILb1ELb0EE7executeINS_16time_format_type8yyyyImplEEEbRKlNS_9StringRefERNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEERmRKN4cctz9time_zoneE Unexecuted instantiation: _ZN5doris16FromUnixTimeImplILb0ELb1EE7executeINS_16time_format_type15UserDefinedImplEEEbRKlNS_9StringRefERNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEERmRKN4cctz9time_zoneE Unexecuted instantiation: _ZN5doris16FromUnixTimeImplILb0ELb1EE7executeINS_16time_format_type12yyyyMMddImplEEEbRKlNS_9StringRefERNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEERmRKN4cctz9time_zoneE Unexecuted instantiation: _ZN5doris16FromUnixTimeImplILb0ELb1EE7executeINS_16time_format_type14yyyy_MM_ddImplEEEbRKlNS_9StringRefERNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEERmRKN4cctz9time_zoneE _ZN5doris16FromUnixTimeImplILb0ELb1EE7executeINS_16time_format_type23yyyy_MM_dd_HH_mm_ssImplEEEbRKlNS_9StringRefERNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEERmRKN4cctz9time_zoneE Line | Count | Source | 433 | 2 | size_t& offset, const cctz::time_zone& time_zone) { | 434 | 2 | if (!check_valid(val)) { | 435 | 0 | return true; | 436 | 0 | } | 437 | 2 | DateV2Value<DateTimeV2ValueType> dt = get_datetime_value(val, time_zone); | 438 | 2 | if (!dt.is_valid_date()) [[unlikely]] { | 439 | 0 | return true; | 440 | 0 | } | 441 | | if constexpr (std::is_same_v<Impl, time_format_type::UserDefinedImpl>) { | 442 | | char buf[100 + SAFE_FORMAT_STRING_MARGIN]; | 443 | | if (!dt.to_format_string_conservative(format.data, format.size, buf, | 444 | | 100 + SAFE_FORMAT_STRING_MARGIN)) { | 445 | | return true; | 446 | | } | 447 | | | 448 | | auto len = strlen(buf); | 449 | | res_data.insert(buf, buf + len); | 450 | | offset += len; | 451 | 2 | } else { | 452 | | // No buffer is needed here because these specially optimized formats have fixed lengths, | 453 | | // and sufficient memory has already been reserved. | 454 | 2 | auto len = Impl::date_to_str(dt, (char*)res_data.data() + offset); | 455 | 2 | offset += len; | 456 | 2 | } | 457 | 2 | return false; | 458 | 2 | } |
Unexecuted instantiation: _ZN5doris16FromUnixTimeImplILb0ELb1EE7executeINS_16time_format_type11yyyy_MMImplEEEbRKlNS_9StringRefERNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEERmRKN4cctz9time_zoneE Unexecuted instantiation: _ZN5doris16FromUnixTimeImplILb0ELb1EE7executeINS_16time_format_type10yyyyMMImplEEEbRKlNS_9StringRefERNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEERmRKN4cctz9time_zoneE Unexecuted instantiation: _ZN5doris16FromUnixTimeImplILb0ELb1EE7executeINS_16time_format_type8yyyyImplEEEbRKlNS_9StringRefERNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEERmRKN4cctz9time_zoneE Unexecuted instantiation: _ZN5doris16FromUnixTimeImplILb1ELb1EE7executeINS_16time_format_type15UserDefinedImplEEEbRKlNS_9StringRefERNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEERmRKN4cctz9time_zoneE Unexecuted instantiation: _ZN5doris16FromUnixTimeImplILb1ELb1EE7executeINS_16time_format_type12yyyyMMddImplEEEbRKlNS_9StringRefERNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEERmRKN4cctz9time_zoneE Unexecuted instantiation: _ZN5doris16FromUnixTimeImplILb1ELb1EE7executeINS_16time_format_type14yyyy_MM_ddImplEEEbRKlNS_9StringRefERNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEERmRKN4cctz9time_zoneE Unexecuted instantiation: _ZN5doris16FromUnixTimeImplILb1ELb1EE7executeINS_16time_format_type23yyyy_MM_dd_HH_mm_ssImplEEEbRKlNS_9StringRefERNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEERmRKN4cctz9time_zoneE Unexecuted instantiation: _ZN5doris16FromUnixTimeImplILb1ELb1EE7executeINS_16time_format_type11yyyy_MMImplEEEbRKlNS_9StringRefERNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEERmRKN4cctz9time_zoneE Unexecuted instantiation: _ZN5doris16FromUnixTimeImplILb1ELb1EE7executeINS_16time_format_type10yyyyMMImplEEEbRKlNS_9StringRefERNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEERmRKN4cctz9time_zoneE Unexecuted instantiation: _ZN5doris16FromUnixTimeImplILb1ELb1EE7executeINS_16time_format_type8yyyyImplEEEbRKlNS_9StringRefERNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEERmRKN4cctz9time_zoneE |
459 | | }; |
460 | | |
461 | | // only new verison |
462 | | template <bool WithStringArg> |
463 | | struct FromUnixTimeDecimalImpl { |
464 | | using ArgType = Int64; |
465 | | static constexpr PrimitiveType FromPType = TYPE_DECIMAL64; |
466 | | constexpr static short Scale = 6; // same with argument's scale in FE's signature |
467 | | |
468 | 2 | static DataTypes get_variadic_argument_types() { |
469 | 2 | if constexpr (WithStringArg) { |
470 | 1 | return {std::make_shared<DataTypeDecimal64>(), std::make_shared<DataTypeString>()}; |
471 | 1 | } else { |
472 | 1 | return {std::make_shared<DataTypeDecimal64>()}; |
473 | 1 | } |
474 | 2 | } _ZN5doris23FromUnixTimeDecimalImplILb0EE27get_variadic_argument_typesEv Line | Count | Source | 468 | 1 | static DataTypes get_variadic_argument_types() { | 469 | | if constexpr (WithStringArg) { | 470 | | return {std::make_shared<DataTypeDecimal64>(), std::make_shared<DataTypeString>()}; | 471 | 1 | } else { | 472 | 1 | return {std::make_shared<DataTypeDecimal64>()}; | 473 | 1 | } | 474 | 1 | } |
_ZN5doris23FromUnixTimeDecimalImplILb1EE27get_variadic_argument_typesEv Line | Count | Source | 468 | 1 | static DataTypes get_variadic_argument_types() { | 469 | 1 | if constexpr (WithStringArg) { | 470 | 1 | return {std::make_shared<DataTypeDecimal64>(), std::make_shared<DataTypeString>()}; | 471 | | } else { | 472 | | return {std::make_shared<DataTypeDecimal64>()}; | 473 | | } | 474 | 1 | } |
|
475 | | static constexpr auto name = "from_unixtime_new"; |
476 | | |
477 | 2 | [[nodiscard]] static bool check_valid(const ArgType& val) { |
478 | 2 | if (val < 0) [[unlikely]] { |
479 | 0 | return false; |
480 | 0 | } |
481 | 2 | return true; |
482 | 2 | } _ZN5doris23FromUnixTimeDecimalImplILb0EE11check_validERKl Line | Count | Source | 477 | 2 | [[nodiscard]] static bool check_valid(const ArgType& val) { | 478 | 2 | if (val < 0) [[unlikely]] { | 479 | 0 | return false; | 480 | 0 | } | 481 | 2 | return true; | 482 | 2 | } |
Unexecuted instantiation: _ZN5doris23FromUnixTimeDecimalImplILb1EE11check_validERKl |
483 | | |
484 | | static DateV2Value<DateTimeV2ValueType> get_datetime_value(const ArgType& interger, |
485 | | const ArgType& fraction, |
486 | 2 | const cctz::time_zone& time_zone) { |
487 | 2 | DateV2Value<DateTimeV2ValueType> dt; |
488 | | // 9 is nanoseconds, our input's scale is 6 |
489 | 2 | dt.from_unixtime(interger, (int32_t)fraction * common::exp10_i32(9 - Scale), time_zone, 6); |
490 | 2 | return dt; |
491 | 2 | } _ZN5doris23FromUnixTimeDecimalImplILb0EE18get_datetime_valueERKlS3_RKN4cctz9time_zoneE Line | Count | Source | 486 | 2 | const cctz::time_zone& time_zone) { | 487 | 2 | DateV2Value<DateTimeV2ValueType> dt; | 488 | | // 9 is nanoseconds, our input's scale is 6 | 489 | 2 | dt.from_unixtime(interger, (int32_t)fraction * common::exp10_i32(9 - Scale), time_zone, 6); | 490 | 2 | return dt; | 491 | 2 | } |
Unexecuted instantiation: _ZN5doris23FromUnixTimeDecimalImplILb1EE18get_datetime_valueERKlS3_RKN4cctz9time_zoneE |
492 | | |
493 | | // return true if null(result is invalid) |
494 | | template <typename Impl> |
495 | | static bool execute_decimal(const ArgType& interger, const ArgType& fraction, StringRef format, |
496 | | ColumnString::Chars& res_data, size_t& offset, |
497 | 2 | const cctz::time_zone& time_zone) { |
498 | 2 | if (!check_valid(interger + (fraction > 0 ? 1 : ((fraction < 0) ? -1 : 0)))) [[unlikely]] { |
499 | 0 | return true; |
500 | 0 | } |
501 | 2 | DateV2Value<DateTimeV2ValueType> dt = get_datetime_value(interger, fraction, time_zone); |
502 | 2 | if (!dt.is_valid_date()) [[unlikely]] { |
503 | 0 | return true; |
504 | 0 | } |
505 | 2 | if constexpr (std::is_same_v<Impl, time_format_type::UserDefinedImpl>) { |
506 | 0 | char buf[100 + SAFE_FORMAT_STRING_MARGIN]; |
507 | 0 | if (!dt.to_format_string_conservative(format.data, format.size, buf, |
508 | 0 | 100 + SAFE_FORMAT_STRING_MARGIN)) { |
509 | 0 | return true; |
510 | 0 | } |
511 | | |
512 | 0 | auto len = strlen(buf); |
513 | 0 | res_data.insert(buf, buf + len); |
514 | 0 | offset += len; |
515 | 2 | } else { |
516 | | // No buffer is needed here because these specially optimized formats have fixed lengths, |
517 | | // and sufficient memory has already been reserved. |
518 | 2 | auto len = time_format_type::yyyy_MM_dd_HH_mm_ss_SSSSSSImpl::date_to_str( |
519 | 2 | dt, (char*)res_data.data() + offset); |
520 | 2 | offset += len; |
521 | 2 | } |
522 | 0 | return false; |
523 | 2 | } _ZN5doris23FromUnixTimeDecimalImplILb0EE15execute_decimalINS_16time_format_type30yyyy_MM_dd_HH_mm_ss_SSSSSSImplEEEbRKlS6_NS_9StringRefERNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEERmRKN4cctz9time_zoneE Line | Count | Source | 497 | 2 | const cctz::time_zone& time_zone) { | 498 | 2 | if (!check_valid(interger + (fraction > 0 ? 1 : ((fraction < 0) ? -1 : 0)))) [[unlikely]] { | 499 | 0 | return true; | 500 | 0 | } | 501 | 2 | DateV2Value<DateTimeV2ValueType> dt = get_datetime_value(interger, fraction, time_zone); | 502 | 2 | if (!dt.is_valid_date()) [[unlikely]] { | 503 | 0 | return true; | 504 | 0 | } | 505 | | if constexpr (std::is_same_v<Impl, time_format_type::UserDefinedImpl>) { | 506 | | char buf[100 + SAFE_FORMAT_STRING_MARGIN]; | 507 | | if (!dt.to_format_string_conservative(format.data, format.size, buf, | 508 | | 100 + SAFE_FORMAT_STRING_MARGIN)) { | 509 | | return true; | 510 | | } | 511 | | | 512 | | auto len = strlen(buf); | 513 | | res_data.insert(buf, buf + len); | 514 | | offset += len; | 515 | 2 | } else { | 516 | | // No buffer is needed here because these specially optimized formats have fixed lengths, | 517 | | // and sufficient memory has already been reserved. | 518 | 2 | auto len = time_format_type::yyyy_MM_dd_HH_mm_ss_SSSSSSImpl::date_to_str( | 519 | 2 | dt, (char*)res_data.data() + offset); | 520 | 2 | offset += len; | 521 | 2 | } | 522 | 2 | return false; | 523 | 2 | } |
Unexecuted instantiation: _ZN5doris23FromUnixTimeDecimalImplILb0EE15execute_decimalINS_16time_format_type15UserDefinedImplEEEbRKlS6_NS_9StringRefERNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEERmRKN4cctz9time_zoneE Unexecuted instantiation: _ZN5doris23FromUnixTimeDecimalImplILb1EE15execute_decimalINS_16time_format_type30yyyy_MM_dd_HH_mm_ss_SSSSSSImplEEEbRKlS6_NS_9StringRefERNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEERmRKN4cctz9time_zoneE Unexecuted instantiation: _ZN5doris23FromUnixTimeDecimalImplILb1EE15execute_decimalINS_16time_format_type15UserDefinedImplEEEbRKlS6_NS_9StringRefERNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEERmRKN4cctz9time_zoneE |
524 | | }; |
525 | | |
526 | | // Base template for optimized time field(HOUR, MINUTE, SECOND, MS) extraction from Unix timestamp |
527 | | // Uses lookup_offset to avoid expensive civil_second construction |
528 | | template <typename Impl> |
529 | | class FunctionTimeFieldFromUnixtime : public IFunction { |
530 | | public: |
531 | | static constexpr auto name = Impl::name; |
532 | 8 | static FunctionPtr create() { return std::make_shared<FunctionTimeFieldFromUnixtime<Impl>>(); }_ZN5doris29FunctionTimeFieldFromUnixtimeINS_20HourFromUnixtimeImplEE6createEv Line | Count | Source | 532 | 2 | static FunctionPtr create() { return std::make_shared<FunctionTimeFieldFromUnixtime<Impl>>(); } |
_ZN5doris29FunctionTimeFieldFromUnixtimeINS_22MinuteFromUnixtimeImplEE6createEv Line | Count | Source | 532 | 2 | static FunctionPtr create() { return std::make_shared<FunctionTimeFieldFromUnixtime<Impl>>(); } |
_ZN5doris29FunctionTimeFieldFromUnixtimeINS_22SecondFromUnixtimeImplEE6createEv Line | Count | Source | 532 | 2 | static FunctionPtr create() { return std::make_shared<FunctionTimeFieldFromUnixtime<Impl>>(); } |
_ZN5doris29FunctionTimeFieldFromUnixtimeINS_27MicrosecondFromUnixtimeImplEE6createEv Line | Count | Source | 532 | 2 | static FunctionPtr create() { return std::make_shared<FunctionTimeFieldFromUnixtime<Impl>>(); } |
|
533 | | |
534 | 4 | String get_name() const override { return name; }_ZNK5doris29FunctionTimeFieldFromUnixtimeINS_20HourFromUnixtimeImplEE8get_nameB5cxx11Ev Line | Count | Source | 534 | 1 | String get_name() const override { return name; } |
_ZNK5doris29FunctionTimeFieldFromUnixtimeINS_22MinuteFromUnixtimeImplEE8get_nameB5cxx11Ev Line | Count | Source | 534 | 1 | String get_name() const override { return name; } |
_ZNK5doris29FunctionTimeFieldFromUnixtimeINS_22SecondFromUnixtimeImplEE8get_nameB5cxx11Ev Line | Count | Source | 534 | 1 | String get_name() const override { return name; } |
_ZNK5doris29FunctionTimeFieldFromUnixtimeINS_27MicrosecondFromUnixtimeImplEE8get_nameB5cxx11Ev Line | Count | Source | 534 | 1 | String get_name() const override { return name; } |
|
535 | | |
536 | 0 | size_t get_number_of_arguments() const override { return 1; }Unexecuted instantiation: _ZNK5doris29FunctionTimeFieldFromUnixtimeINS_20HourFromUnixtimeImplEE23get_number_of_argumentsEv Unexecuted instantiation: _ZNK5doris29FunctionTimeFieldFromUnixtimeINS_22MinuteFromUnixtimeImplEE23get_number_of_argumentsEv Unexecuted instantiation: _ZNK5doris29FunctionTimeFieldFromUnixtimeINS_22SecondFromUnixtimeImplEE23get_number_of_argumentsEv Unexecuted instantiation: _ZNK5doris29FunctionTimeFieldFromUnixtimeINS_27MicrosecondFromUnixtimeImplEE23get_number_of_argumentsEv |
537 | | |
538 | 0 | DataTypePtr get_return_type_impl(const ColumnsWithTypeAndName& arguments) const override { |
539 | | // microsecond_from_unixtime returns Int32, others (hour/minute/second) return Int8 |
540 | 0 | if constexpr (Impl::ArgType == PrimitiveType::TYPE_DECIMAL64) { |
541 | 0 | return make_nullable(std::make_shared<DataTypeInt32>()); |
542 | 0 | } else { |
543 | 0 | return make_nullable(std::make_shared<DataTypeInt8>()); |
544 | 0 | } |
545 | 0 | } Unexecuted instantiation: _ZNK5doris29FunctionTimeFieldFromUnixtimeINS_20HourFromUnixtimeImplEE20get_return_type_implERKSt6vectorINS_21ColumnWithTypeAndNameESaIS4_EE Unexecuted instantiation: _ZNK5doris29FunctionTimeFieldFromUnixtimeINS_22MinuteFromUnixtimeImplEE20get_return_type_implERKSt6vectorINS_21ColumnWithTypeAndNameESaIS4_EE Unexecuted instantiation: _ZNK5doris29FunctionTimeFieldFromUnixtimeINS_22SecondFromUnixtimeImplEE20get_return_type_implERKSt6vectorINS_21ColumnWithTypeAndNameESaIS4_EE Unexecuted instantiation: _ZNK5doris29FunctionTimeFieldFromUnixtimeINS_27MicrosecondFromUnixtimeImplEE20get_return_type_implERKSt6vectorINS_21ColumnWithTypeAndNameESaIS4_EE |
546 | | |
547 | | // (UTC 9999-12-31 23:59:59) - 24 * 3600 |
548 | | static const int64_t TIMESTAMP_VALID_MAX = 253402243199L; |
549 | | |
550 | | Status execute_impl(FunctionContext* context, Block& block, const ColumnNumbers& arguments, |
551 | 0 | uint32_t result, size_t input_rows_count) const override { |
552 | 0 | using ArgColType = typename PrimitiveTypeTraits<Impl::ArgType>::ColumnType; |
553 | 0 | using ResColType = std::conditional_t<Impl::ArgType == PrimitiveType::TYPE_DECIMAL64, |
554 | 0 | ColumnInt32, ColumnInt8>; |
555 | 0 | using ResItemType = typename ResColType::value_type; |
556 | 0 | auto res = ResColType::create(); |
557 | |
|
558 | 0 | const auto* ts_col = |
559 | 0 | assert_cast<const ArgColType*>(block.get_by_position(arguments[0]).column.get()); |
560 | 0 | if constexpr (Impl::ArgType == PrimitiveType::TYPE_DECIMAL64) { |
561 | | // microsecond_from_unixtime only |
562 | 0 | const auto scale = static_cast<int32_t>(ts_col->get_scale()); |
563 | |
|
564 | 0 | for (int i = 0; i < input_rows_count; ++i) { |
565 | 0 | const auto seconds = ts_col->get_intergral_part(i); |
566 | 0 | const auto fraction = ts_col->get_fractional_part(i); |
567 | |
|
568 | 0 | if (seconds < 0 || seconds > TIMESTAMP_VALID_MAX) { |
569 | 0 | return Status::InvalidArgument( |
570 | 0 | "The input value of TimeFiled(from_unixtime()) must between 0 and " |
571 | 0 | "253402243199L"); |
572 | 0 | } |
573 | | |
574 | 0 | ResItemType value = Impl::extract_field(fraction, scale); |
575 | 0 | res->insert_value(value); |
576 | 0 | } |
577 | 0 | } else { |
578 | 0 | auto ctz = context->state()->timezone_obj(); |
579 | 0 | for (int i = 0; i < input_rows_count; ++i) { |
580 | 0 | auto date = ts_col->get_element(i); |
581 | |
|
582 | 0 | if (date < 0 || date > TIMESTAMP_VALID_MAX) { |
583 | 0 | return Status::InvalidArgument( |
584 | 0 | "The input value of TimeFiled(from_unixtime()) must between 0 and " |
585 | 0 | "253402243199L"); |
586 | 0 | } |
587 | | |
588 | 0 | ResItemType value = Impl::extract_field(date, ctz); |
589 | 0 | res->insert_value(value); |
590 | 0 | } |
591 | 0 | } |
592 | 0 | block.replace_by_position(result, std::move(res)); |
593 | 0 | return Status::OK(); |
594 | 0 | } Unexecuted instantiation: _ZNK5doris29FunctionTimeFieldFromUnixtimeINS_20HourFromUnixtimeImplEE12execute_implEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjm Unexecuted instantiation: _ZNK5doris29FunctionTimeFieldFromUnixtimeINS_22MinuteFromUnixtimeImplEE12execute_implEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjm Unexecuted instantiation: _ZNK5doris29FunctionTimeFieldFromUnixtimeINS_22SecondFromUnixtimeImplEE12execute_implEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjm Unexecuted instantiation: _ZNK5doris29FunctionTimeFieldFromUnixtimeINS_27MicrosecondFromUnixtimeImplEE12execute_implEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjm |
595 | | }; |
596 | | |
597 | | struct HourFromUnixtimeImpl { |
598 | | static constexpr PrimitiveType ArgType = PrimitiveType::TYPE_BIGINT; |
599 | | static constexpr auto name = "hour_from_unixtime"; |
600 | | |
601 | 0 | static int8_t extract_field(int64_t local_time, const cctz::time_zone& ctz) { |
602 | 0 | static const auto epoch = std::chrono::time_point_cast<cctz::sys_seconds>( |
603 | 0 | std::chrono::system_clock::from_time_t(0)); |
604 | 0 | cctz::time_point<cctz::sys_seconds> t = epoch + cctz::seconds(local_time); |
605 | 0 | int offset = ctz.lookup_offset(t).offset; |
606 | 0 | local_time += offset; |
607 | |
|
608 | 0 | static const libdivide::divider<int64_t> fast_div_3600(3600); |
609 | 0 | static const libdivide::divider<int64_t> fast_div_86400(86400); |
610 | |
|
611 | 0 | int64_t remainder; |
612 | 0 | if (LIKELY(local_time >= 0)) { |
613 | 0 | remainder = local_time - local_time / fast_div_86400 * 86400; |
614 | 0 | } else { |
615 | 0 | remainder = local_time % 86400; |
616 | 0 | if (remainder < 0) { |
617 | 0 | remainder += 86400; |
618 | 0 | } |
619 | 0 | } |
620 | 0 | return static_cast<int8_t>(remainder / fast_div_3600); |
621 | 0 | } |
622 | | }; |
623 | | |
624 | | struct MinuteFromUnixtimeImpl { |
625 | | static constexpr PrimitiveType ArgType = PrimitiveType::TYPE_BIGINT; |
626 | | static constexpr auto name = "minute_from_unixtime"; |
627 | | |
628 | 0 | static int8_t extract_field(int64_t local_time, const cctz::time_zone& /*ctz*/) { |
629 | 0 | static const libdivide::divider<int64_t> fast_div_60(60); |
630 | 0 | static const libdivide::divider<int64_t> fast_div_3600(3600); |
631 | |
|
632 | 0 | local_time = local_time - local_time / fast_div_3600 * 3600; |
633 | |
|
634 | 0 | return static_cast<int8_t>(local_time / fast_div_60); |
635 | 0 | } |
636 | | }; |
637 | | |
638 | | struct SecondFromUnixtimeImpl { |
639 | | static constexpr PrimitiveType ArgType = PrimitiveType::TYPE_BIGINT; |
640 | | static constexpr auto name = "second_from_unixtime"; |
641 | | |
642 | 0 | static int8_t extract_field(int64_t local_time, const cctz::time_zone& /*ctz*/) { |
643 | 0 | return static_cast<int8_t>(local_time % 60); |
644 | 0 | } |
645 | | }; |
646 | | |
647 | | struct MicrosecondFromUnixtimeImpl { |
648 | | static constexpr PrimitiveType ArgType = PrimitiveType::TYPE_DECIMAL64; |
649 | | static constexpr auto name = "microsecond_from_unixtime"; |
650 | | |
651 | 0 | static int32_t extract_field(int64_t fraction, int scale) { |
652 | 0 | if (scale < 6) { |
653 | 0 | fraction *= common::exp10_i64(6 - scale); |
654 | 0 | } |
655 | 0 | return static_cast<int32_t>(fraction); |
656 | 0 | } |
657 | | }; |
658 | | |
659 | | template <PrimitiveType ArgPType> |
660 | | class FunctionTimeFormat : public IFunction { |
661 | | public: |
662 | | using ArgColType = typename PrimitiveTypeTraits<ArgPType>::ColumnType; |
663 | | using ArgCppType = typename PrimitiveTypeTraits<ArgPType>::CppType; |
664 | | |
665 | | static constexpr auto name = "time_format"; |
666 | 3 | String get_name() const override { return name; }_ZNK5doris18FunctionTimeFormatILNS_13PrimitiveTypeE25EE8get_nameB5cxx11Ev Line | Count | Source | 666 | 1 | String get_name() const override { return name; } |
_ZNK5doris18FunctionTimeFormatILNS_13PrimitiveTypeE26EE8get_nameB5cxx11Ev Line | Count | Source | 666 | 1 | String get_name() const override { return name; } |
_ZNK5doris18FunctionTimeFormatILNS_13PrimitiveTypeE27EE8get_nameB5cxx11Ev Line | Count | Source | 666 | 1 | String get_name() const override { return name; } |
|
667 | 6 | static FunctionPtr create() { return std::make_shared<FunctionTimeFormat>(); }_ZN5doris18FunctionTimeFormatILNS_13PrimitiveTypeE25EE6createEv Line | Count | Source | 667 | 2 | static FunctionPtr create() { return std::make_shared<FunctionTimeFormat>(); } |
_ZN5doris18FunctionTimeFormatILNS_13PrimitiveTypeE26EE6createEv Line | Count | Source | 667 | 2 | static FunctionPtr create() { return std::make_shared<FunctionTimeFormat>(); } |
_ZN5doris18FunctionTimeFormatILNS_13PrimitiveTypeE27EE6createEv Line | Count | Source | 667 | 2 | static FunctionPtr create() { return std::make_shared<FunctionTimeFormat>(); } |
|
668 | 3 | DataTypes get_variadic_argument_types_impl() const override { |
669 | 3 | return {std::make_shared<typename PrimitiveTypeTraits<ArgPType>::DataType>(), |
670 | 3 | std::make_shared<DataTypeString>()}; |
671 | 3 | } _ZNK5doris18FunctionTimeFormatILNS_13PrimitiveTypeE25EE32get_variadic_argument_types_implEv Line | Count | Source | 668 | 1 | DataTypes get_variadic_argument_types_impl() const override { | 669 | 1 | return {std::make_shared<typename PrimitiveTypeTraits<ArgPType>::DataType>(), | 670 | 1 | std::make_shared<DataTypeString>()}; | 671 | 1 | } |
_ZNK5doris18FunctionTimeFormatILNS_13PrimitiveTypeE26EE32get_variadic_argument_types_implEv Line | Count | Source | 668 | 1 | DataTypes get_variadic_argument_types_impl() const override { | 669 | 1 | return {std::make_shared<typename PrimitiveTypeTraits<ArgPType>::DataType>(), | 670 | 1 | std::make_shared<DataTypeString>()}; | 671 | 1 | } |
_ZNK5doris18FunctionTimeFormatILNS_13PrimitiveTypeE27EE32get_variadic_argument_types_implEv Line | Count | Source | 668 | 1 | DataTypes get_variadic_argument_types_impl() const override { | 669 | 1 | return {std::make_shared<typename PrimitiveTypeTraits<ArgPType>::DataType>(), | 670 | 1 | std::make_shared<DataTypeString>()}; | 671 | 1 | } |
|
672 | 0 | DataTypePtr get_return_type_impl(const ColumnsWithTypeAndName& arguments) const override { |
673 | 0 | return make_nullable(std::make_shared<DataTypeString>()); |
674 | 0 | } Unexecuted instantiation: _ZNK5doris18FunctionTimeFormatILNS_13PrimitiveTypeE25EE20get_return_type_implERKSt6vectorINS_21ColumnWithTypeAndNameESaIS4_EE Unexecuted instantiation: _ZNK5doris18FunctionTimeFormatILNS_13PrimitiveTypeE26EE20get_return_type_implERKSt6vectorINS_21ColumnWithTypeAndNameESaIS4_EE Unexecuted instantiation: _ZNK5doris18FunctionTimeFormatILNS_13PrimitiveTypeE27EE20get_return_type_implERKSt6vectorINS_21ColumnWithTypeAndNameESaIS4_EE |
675 | 0 | size_t get_number_of_arguments() const override { return 2; }Unexecuted instantiation: _ZNK5doris18FunctionTimeFormatILNS_13PrimitiveTypeE25EE23get_number_of_argumentsEv Unexecuted instantiation: _ZNK5doris18FunctionTimeFormatILNS_13PrimitiveTypeE26EE23get_number_of_argumentsEv Unexecuted instantiation: _ZNK5doris18FunctionTimeFormatILNS_13PrimitiveTypeE27EE23get_number_of_argumentsEv |
676 | | |
677 | | Status execute_impl(FunctionContext* context, Block& block, const ColumnNumbers& arguments, |
678 | 0 | uint32_t result, size_t input_rows_count) const override { |
679 | 0 | auto res_col = ColumnString::create(); |
680 | 0 | ColumnString::Chars& res_chars = res_col->get_chars(); |
681 | 0 | ColumnString::Offsets& res_offsets = res_col->get_offsets(); |
682 | |
|
683 | 0 | auto null_map = ColumnUInt8::create(); |
684 | 0 | auto& null_map_data = null_map->get_data(); |
685 | 0 | null_map_data.resize_fill(input_rows_count, 0); |
686 | |
|
687 | 0 | res_offsets.reserve(input_rows_count); |
688 | |
|
689 | 0 | ColumnPtr arg_col[2]; |
690 | 0 | bool is_const[2]; |
691 | 0 | for (size_t i = 0; i < 2; ++i) { |
692 | 0 | const ColumnPtr& col = block.get_by_position(arguments[i]).column; |
693 | 0 | std::tie(arg_col[i], is_const[i]) = unpack_if_const(col); |
694 | 0 | } |
695 | |
|
696 | 0 | const auto* datetime_col = assert_cast<const ArgColType*>(arg_col[0].get()); |
697 | 0 | const auto* format_col = assert_cast<const ColumnString*>(arg_col[1].get()); |
698 | 0 | for (size_t i = 0; i < input_rows_count; ++i) { |
699 | 0 | const auto& datetime_val = datetime_col->get_element(index_check_const(i, is_const[0])); |
700 | 0 | StringRef format = format_col->get_data_at(index_check_const(i, is_const[1])); |
701 | 0 | TimeValue::TimeType time = get_time_value(datetime_val); |
702 | |
|
703 | 0 | char buf[100 + SAFE_FORMAT_STRING_MARGIN]; |
704 | 0 | if (!TimeValue::to_format_string_conservative(format.data, format.size, buf, |
705 | 0 | 100 + SAFE_FORMAT_STRING_MARGIN, time)) { |
706 | 0 | null_map_data[i] = 1; |
707 | 0 | res_offsets.push_back(res_chars.size()); |
708 | 0 | continue; |
709 | 0 | } |
710 | 0 | res_chars.insert(buf, buf + strlen(buf)); |
711 | 0 | res_offsets.push_back(res_chars.size()); |
712 | 0 | } |
713 | 0 | block.replace_by_position(result, |
714 | 0 | ColumnNullable::create(std::move(res_col), std::move(null_map))); |
715 | 0 | return Status::OK(); |
716 | 0 | } Unexecuted instantiation: _ZNK5doris18FunctionTimeFormatILNS_13PrimitiveTypeE25EE12execute_implEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjm Unexecuted instantiation: _ZNK5doris18FunctionTimeFormatILNS_13PrimitiveTypeE26EE12execute_implEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjm Unexecuted instantiation: _ZNK5doris18FunctionTimeFormatILNS_13PrimitiveTypeE27EE12execute_implEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjm |
717 | | |
718 | | private: |
719 | 0 | TimeValue::TimeType get_time_value(const ArgCppType& datetime_val) const { |
720 | 0 | if constexpr (ArgPType == PrimitiveType::TYPE_TIMEV2) { |
721 | 0 | return static_cast<TimeValue::TimeType>(datetime_val); |
722 | 0 | } else { |
723 | 0 | return TimeValue::make_time(datetime_val.hour(), datetime_val.minute(), |
724 | 0 | datetime_val.second(), datetime_val.microsecond()); |
725 | 0 | } |
726 | 0 | } Unexecuted instantiation: _ZNK5doris18FunctionTimeFormatILNS_13PrimitiveTypeE25EE14get_time_valueERKNS_11DateV2ValueINS_15DateV2ValueTypeEEE Unexecuted instantiation: _ZNK5doris18FunctionTimeFormatILNS_13PrimitiveTypeE26EE14get_time_valueERKNS_11DateV2ValueINS_19DateTimeV2ValueTypeEEE Unexecuted instantiation: _ZNK5doris18FunctionTimeFormatILNS_13PrimitiveTypeE27EE14get_time_valueERKd |
727 | | }; |
728 | | |
729 | | } // namespace doris |
730 | | |
731 | | #if defined(__GNUC__) && (__GNUC__ >= 15) |
732 | | #pragma GCC diagnostic pop |
733 | | #endif |