fix transformer for custom week adapter, add name to ZeroTransform

This commit is contained in:
Yakov Olkhovskiy 2024-11-13 16:22:49 +00:00
parent f7c46114f4
commit b7e7c48842
2 changed files with 3 additions and 2 deletions

View File

@ -64,6 +64,7 @@ constexpr time_t MAX_DATETIME_DAY_NUM = 49710; // 2106-02-07
/// This factor transformation will say that the function is monotone everywhere.
struct ZeroTransform
{
static constexpr auto name = "Zero";
static UInt16 execute(Int64, const DateLUTImpl &) { return 0; }
static UInt16 execute(UInt32, const DateLUTImpl &) { return 0; }
static UInt16 execute(Int32, const DateLUTImpl &) { return 0; }

View File

@ -60,10 +60,10 @@ public:
{
const auto & left_date_time = left.safeGet<DateTime64>();
TransformDateTime64<Transform> transformer_left(left_date_time.getScale());
TransformDateTime64<typename Transform::FactorTransform> transformer_left(left_date_time.getScale());
const auto & right_date_time = right.safeGet<DateTime64>();
TransformDateTime64<Transform> transformer_right(right_date_time.getScale());
TransformDateTime64<typename Transform::FactorTransform> transformer_right(right_date_time.getScale());
return transformer_left.execute(left_date_time.getValue(), date_lut)
== transformer_right.execute(right_date_time.getValue(), date_lut)