Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,6 @@ struct WindowFunnelState {
template <WindowFunnelMode WINDOW_FUNNEL_MODE>
int _match_event_list(size_t& start_row, size_t row_count) const {
int matched_count = 0;
DateValueType start_timestamp;
DateValueType end_timestamp;

if (window < 0) {
Expand Down
6 changes: 6 additions & 0 deletions be/src/vec/core/types.h
Original file line number Diff line number Diff line change
Expand Up @@ -481,6 +481,12 @@ using Decimal64 = Decimal<Int64>;
using Decimal128V2 = Decimal<Int128>;
using Decimal256 = Decimal<wide::Int256>;

static_assert(std::is_trivial_v<Decimal32>, "Decimal32 must be trivial");
static_assert(std::is_trivial_v<Decimal64>, "Decimal64 must be trivial");
static_assert(std::is_trivial_v<Decimal128V2>, "Decimal128V2 must be trivial");
static_assert(std::is_trivial_v<Decimal128V3>, "Decimal128V3 must be trivial");
static_assert(std::is_trivial_v<Decimal256>, "Decimal256 must be trivial");

inline bool operator<(const Decimal256& x, const Decimal256& y) {
return x.value < y.value;
}
Expand Down
2 changes: 0 additions & 2 deletions be/src/vec/runtime/timestamptz_value.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,6 @@ bool TimestampTzValue::from_datetime(const DateV2Value<DateTimeV2ValueType>& ori

auto utc_cs = cctz::convert(local_tp, cctz::utc_time_zone());

DateV2Value<DateTimeV2ValueType> utc_dt;

return _utc_dt.check_range_and_set_time((uint16_t)utc_cs.year(), (uint8_t)utc_cs.month(),
(uint8_t)utc_cs.day(), (uint8_t)utc_cs.hour(),
(uint8_t)utc_cs.minute(), (uint8_t)utc_cs.second(),
Expand Down
13 changes: 12 additions & 1 deletion be/src/vec/runtime/vdatetime_value.h
Original file line number Diff line number Diff line change
Expand Up @@ -230,11 +230,13 @@ struct DateV2ValueType {
uint32_t month_ : 4;
uint32_t year_ : 23;

DateV2ValueType() = default;
DateV2ValueType(uint16_t year, uint8_t month, uint8_t day, uint8_t hour, uint8_t minute,
uint8_t second, uint32_t microsecond)
: day_(day), month_(month), year_(year) {}
};

static_assert(std::is_trivial_v<DateV2ValueType>, "DateV2ValueType must be trivial");
struct DateTimeV2ValueType {
uint64_t microsecond_ : 20;
uint64_t second_ : 6;
Expand All @@ -253,8 +255,11 @@ struct DateTimeV2ValueType {
day_(day),
month_(month),
year_(year) {}
DateTimeV2ValueType() = default;
};

static_assert(std::is_trivial_v<DateTimeV2ValueType>, "DateTimeV2ValueType must be trivial");

template <typename T>
class DateV2Value;

Expand Down Expand Up @@ -811,6 +816,7 @@ class VecDateTimeValue { // Now this type is a temp solution with little changes
_year(year) {}
};

static_assert(std::is_trivially_copyable_v<VecDateTimeValue>, "VecDateTimeValue must be trivial");
inline const VecDateTimeValue VecDateTimeValue::FIRST_DAY(false, TYPE_DATETIME, 0, 0, 0, 1, 1, 1);
inline const VecDateTimeValue VecDateTimeValue::DEFAULT_VALUE(false, TYPE_DATETIME, 0, 0, 0, 1970,
1, 1);
Expand All @@ -822,7 +828,7 @@ class DateV2Value {
using underlying_value = std::conditional_t<is_datetime, uint64_t, uint32_t>;

// Constructor
DateV2Value() : date_v2_value_(0, 0, 0, 0, 0, 0, 0) {}
DateV2Value() = default;

DateV2Value(underlying_value int_val) : int_val_(int_val) {}
template <typename U>
Expand Down Expand Up @@ -1470,6 +1476,11 @@ class DateV2Value {
: date_v2_value_(year, month, day, hour, minute, second, microsecond) {}
};

static_assert(std::is_trivial_v<DateV2Value<DateV2ValueType>>,
"DateV2Value<DateV2ValueType> must be trivial");
static_assert(std::is_trivial_v<DateV2Value<DateTimeV2ValueType>>,
"DateV2Value<DateTimeV2ValueType> must be trivial");

template <typename T>
inline const DateV2Value<T> DateV2Value<T>::FIRST_DAY = DateV2Value<T>(0001, 1, 1, 0, 0, 0, 0);
template <typename T>
Expand Down