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