summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorimunkin <[email protected]>2025-03-27 12:57:36 +0300
committerimunkin <[email protected]>2025-03-27 13:12:58 +0300
commita72aaab01e98f07c44aea4953462027485c1255b (patch)
tree4af192ee284406f673793a5e0bee78e794f77e62
parent2cc4136746579f484d31ad8877cf722e373d0558 (diff)
YQL-18303: Purge BigDateType data type flag
commit_hash:e8348aa080ebfa6e598642c564e06b807cb8e4dd
-rw-r--r--yql/essentials/core/yql_expr_type_annotation.cpp2
-rw-r--r--yql/essentials/minikql/invoke_builtins/mkql_builtins_datetime.h10
-rw-r--r--yql/essentials/minikql/mkql_program_builder.cpp4
-rw-r--r--yql/essentials/public/udf/udf_data_type.h7
-rw-r--r--yql/essentials/udfs/common/datetime2/datetime_udf.cpp24
5 files changed, 20 insertions, 27 deletions
diff --git a/yql/essentials/core/yql_expr_type_annotation.cpp b/yql/essentials/core/yql_expr_type_annotation.cpp
index c968b6fea1c..80207d35bc2 100644
--- a/yql/essentials/core/yql_expr_type_annotation.cpp
+++ b/yql/essentials/core/yql_expr_type_annotation.cpp
@@ -4313,7 +4313,7 @@ bool IsDataTypeTzDate(EDataSlot dataSlot) {
}
bool IsDataTypeBigDate(EDataSlot dataSlot) {
- return (NUdf::GetDataTypeInfo(dataSlot).Features & NUdf::BigDateType);
+ return (NUdf::GetDataTypeInfo(dataSlot).Features & NUdf::ExtDateType);
}
EDataSlot WithTzDate(EDataSlot dataSlot) {
diff --git a/yql/essentials/minikql/invoke_builtins/mkql_builtins_datetime.h b/yql/essentials/minikql/invoke_builtins/mkql_builtins_datetime.h
index c1b90de073f..1cef07bec1b 100644
--- a/yql/essentials/minikql/invoke_builtins/mkql_builtins_datetime.h
+++ b/yql/essentials/minikql/invoke_builtins/mkql_builtins_datetime.h
@@ -160,7 +160,7 @@ NUdf::TDataType<NUdf::TInterval64>::TLayout FromScaledDate<NUdf::TDataType<NUdf:
template<typename TDateType>
inline bool IsBadDateTime(TScaledDate val) {
static_assert(TDateType::Features & (NYql::NUdf::DateType | NYql::NUdf::TzDateType), "Date type expected");
- if constexpr (TDateType::Features & NYql::NUdf::BigDateType) {
+ if constexpr (TDateType::Features & NYql::NUdf::ExtDateType) {
return val < NUdf::MIN_TIMESTAMP64 || val > NUdf::MAX_TIMESTAMP64;
} else {
return val < 0 || val >= TScaledDate(NUdf::MAX_TIMESTAMP);
@@ -170,7 +170,7 @@ inline bool IsBadDateTime(TScaledDate val) {
template<typename TDateType>
inline bool IsBadInterval(TScaledDate val) {
static_assert(TDateType::Features & NYql::NUdf::TimeIntervalType, "Interval type expected");
- if constexpr (TDateType::Features & NYql::NUdf::BigDateType) {
+ if constexpr (TDateType::Features & NYql::NUdf::ExtDateType) {
return val < -NUdf::MAX_INTERVAL64 || val > NUdf::MAX_INTERVAL64;
} else {
return val <= -TScaledDate(NUdf::MAX_TIMESTAMP) || val >= TScaledDate(NUdf::MAX_TIMESTAMP);
@@ -201,7 +201,7 @@ inline Value* GenIsInt64Overflow(Value* value, LLVMContext &context, BasicBlock*
template<typename TDateType>
inline Value* GenIsBadDateTime(Value* val, LLVMContext &context, BasicBlock* block) {
static_assert(TDateType::Features & (NYql::NUdf::DateType | NYql::NUdf::TzDateType), "Date type expected");
- if constexpr (TDateType::Features & NYql::NUdf::BigDateType) {
+ if constexpr (TDateType::Features & NYql::NUdf::ExtDateType) {
auto lt = CmpInst::Create(Instruction::ICmp, ICmpInst::ICMP_SLT, val, ConstantInt::get(Type::getInt64Ty(context), NUdf::MIN_TIMESTAMP64), "lt", block);
auto ge = CmpInst::Create(Instruction::ICmp, ICmpInst::ICMP_SGT, val, ConstantInt::get(Type::getInt64Ty(context), NUdf::MAX_TIMESTAMP64), "ge", block);
return BinaryOperator::CreateOr(lt, ge, "or", block);
@@ -215,10 +215,10 @@ inline Value* GenIsBadDateTime(Value* val, LLVMContext &context, BasicBlock* blo
template<typename TDateType>
inline Value* GenIsBadInterval(Value* val, LLVMContext &context, BasicBlock* block) {
static_assert(TDateType::Features & NYql::NUdf::TimeIntervalType, "Interval type expected");
- constexpr i64 lowerBound = (TDateType::Features & NYql::NUdf::BigDateType)
+ constexpr i64 lowerBound = (TDateType::Features & NYql::NUdf::ExtDateType)
? (-NUdf::MAX_INTERVAL64 - 1)
: -(i64)NUdf::MAX_TIMESTAMP;
- constexpr i64 upperBound = (TDateType::Features & NYql::NUdf::BigDateType)
+ constexpr i64 upperBound = (TDateType::Features & NYql::NUdf::ExtDateType)
? (NUdf::MAX_INTERVAL64 + 1)
: (i64)NUdf::MAX_TIMESTAMP;
auto le = CmpInst::Create(Instruction::ICmp, ICmpInst::ICMP_SLE, val, ConstantInt::get(Type::getInt64Ty(context), lowerBound), "le", block);
diff --git a/yql/essentials/minikql/mkql_program_builder.cpp b/yql/essentials/minikql/mkql_program_builder.cpp
index 27c4229f996..b11a2924c32 100644
--- a/yql/essentials/minikql/mkql_program_builder.cpp
+++ b/yql/essentials/minikql/mkql_program_builder.cpp
@@ -378,7 +378,7 @@ TType* TProgramBuilder::BuildArithmeticCommonType(TType* type1, TType* type2) {
const auto features2 = NUdf::GetDataTypeInfo(*data2->GetDataSlot()).Features;
const bool isOptional = isOptional1 || isOptional2;
if (features1 & features2 & NUdf::EDataTypeFeatures::TimeIntervalType) {
- return NewOptionalType(features1 & NUdf::EDataTypeFeatures::BigDateType ? data1 : data2);
+ return NewOptionalType(features1 & NUdf::EDataTypeFeatures::ExtDateType ? data1 : data2);
} else if (features1 & NUdf::EDataTypeFeatures::TimeIntervalType) {
return NewOptionalType(features2 & NUdf::EDataTypeFeatures::IntegralType ? data1 : data2);
} else if (features2 & NUdf::EDataTypeFeatures::TimeIntervalType) {
@@ -387,7 +387,7 @@ TType* TProgramBuilder::BuildArithmeticCommonType(TType* type1, TType* type2) {
features1 & (NUdf::EDataTypeFeatures::DateType | NUdf::EDataTypeFeatures::TzDateType) &&
features2 & (NUdf::EDataTypeFeatures::DateType | NUdf::EDataTypeFeatures::TzDateType)
) {
- const auto used = ((features1 | features2) & NUdf::EDataTypeFeatures::BigDateType)
+ const auto used = ((features1 | features2) & NUdf::EDataTypeFeatures::ExtDateType)
? NewDataType(NUdf::EDataSlot::Interval64)
: NewDataType(NUdf::EDataSlot::Interval);
return isOptional ? NewOptionalType(used) : used;
diff --git a/yql/essentials/public/udf/udf_data_type.h b/yql/essentials/public/udf/udf_data_type.h
index 9d7e2070328..9d5d4049557 100644
--- a/yql/essentials/public/udf/udf_data_type.h
+++ b/yql/essentials/public/udf/udf_data_type.h
@@ -45,16 +45,9 @@ enum EDataTypeFeatures : ui32 {
TzDateType = 1u << 27,
DecimalType = 1u << 28,
TimeIntervalType = 1u << 29,
- // FIXME: Remove, when no entries in the code are left.
- BigDateType = 1u << 30,
ExtDateType = 1u << 30,
};
-// FIXME: This static assert is vital for renaming BigDateType
-// flag into ExtDateType to be in sync with naming in docs.
-// Remove this assert, only when BigDateType flags is removed.
-static_assert(ExtDateType == BigDateType);
-
template <typename T>
struct TDataType;
diff --git a/yql/essentials/udfs/common/datetime2/datetime_udf.cpp b/yql/essentials/udfs/common/datetime2/datetime_udf.cpp
index daa43038707..c159f63d5e5 100644
--- a/yql/essentials/udfs/common/datetime2/datetime_udf.cpp
+++ b/yql/essentials/udfs/common/datetime2/datetime_udf.cpp
@@ -266,7 +266,7 @@ public:
builder.Args()->Add(argsTuple.GetElementType(0));
const TType* retType;
- if (features & NUdf::BigDateType) {
+ if (features & NUdf::ExtDateType) {
retType = builder.SimpleType<TWResult>();
} else if (features & NUdf::TimeIntervalType) {
retType = builder.SimpleType<TSignedResult>();
@@ -284,7 +284,7 @@ public:
}
builder.Returns(retType);
- if (!(features & NUdf::BigDateType)) {
+ if (!(features & NUdf::ExtDateType)) {
// FIXME: Only non-wide overloads support block rewrite now.
builder.SupportsBlocks();
}
@@ -447,7 +447,7 @@ struct TGetTimeComponent {
}
const auto features = NUdf::GetDataTypeInfo(NUdf::GetDataSlot(data.GetTypeId())).Features;
- if (features & NUdf::BigDateType) {
+ if (features & NUdf::ExtDateType) {
BuildSignature<TFieldStorage, TM64ResourceName, WAccessor>(builder, typesOnly);
return true;
}
@@ -832,7 +832,7 @@ TUnboxedValuePod DoAddYears(const TUnboxedValuePod& date, i64 years, const NUdf:
}
} else {
builder.Args()->Add<TUserDataType>().Flags(ICallablePayload::TArgumentFlags::AutoMap);
- if constexpr (NUdf::TDataType<TUserDataType>::Features & NYql::NUdf::BigDateType) {
+ if constexpr (NUdf::TDataType<TUserDataType>::Features & NYql::NUdf::ExtDateType) {
builder.Returns(builder.Resource(TM64ResourceName));
} else {
builder.Returns(builder.Resource(TMResourceName));
@@ -1360,7 +1360,7 @@ public:
}
const auto features = NUdf::GetDataTypeInfo(NUdf::GetDataSlot(data.GetTypeId())).Features;
- if (features & NUdf::BigDateType) {
+ if (features & NUdf::ExtDateType) {
BuildSignature<TResultWType, TM64ResourceName, WAccessor>(builder, typesOnly);
return true;
}
@@ -1469,7 +1469,7 @@ public:
}
const auto features = NUdf::GetDataTypeInfo(NUdf::GetDataSlot(data.GetTypeId())).Features;
- if (features & NUdf::BigDateType) {
+ if (features & NUdf::ExtDateType) {
BuildSignature<TM64ResourceName, WAccessor>(builder, typesOnly);
return true;
}
@@ -1695,7 +1695,7 @@ TUnboxedValue GetTimezoneName(const IValueBuilder* valueBuilder, const TUnboxedV
}
const auto features = NUdf::GetDataTypeInfo(NUdf::GetDataSlot(data.GetTypeId())).Features;
- if (features & NUdf::BigDateType) {
+ if (features & NUdf::ExtDateType) {
BuildSignature<TM64ResourceName>(builder, typesOnly);
return true;
}
@@ -1932,7 +1932,7 @@ public:
const auto features = NUdf::GetDataTypeInfo(NUdf::GetDataSlot(data.GetTypeId())).Features;
if (features & NUdf::TimeIntervalType) {
- if (features & NUdf::BigDateType) {
+ if (features & NUdf::ExtDateType) {
BuildSignature<TInterval64, TWResult>(builder, typesOnly);
} else {
BuildSignature<TInterval, TResult>(builder, typesOnly);
@@ -2057,7 +2057,7 @@ public:
}
const auto features = NUdf::GetDataTypeInfo(NUdf::GetDataSlot(data.GetTypeId())).Features;
- if (features & NUdf::BigDateType) {
+ if (features & NUdf::ExtDateType) {
BuildSignature<TM64ResourceName, WBoundary>(builder, typesOnly);
return true;
}
@@ -2385,7 +2385,7 @@ public:
}
const auto features = NUdf::GetDataTypeInfo(NUdf::GetDataSlot(data.GetTypeId())).Features;
- if (features & NUdf::BigDateType) {
+ if (features & NUdf::ExtDateType) {
BuildSignature<TM64ResourceName, WBoundary>(builder, typesOnly);
return true;
}
@@ -2507,7 +2507,7 @@ public:
}
const auto features = NUdf::GetDataTypeInfo(NUdf::GetDataSlot(data.GetTypeId())).Features;
- if (features & NUdf::BigDateType) {
+ if (features & NUdf::ExtDateType) {
BuildSignature<TM64ResourceName>(builder, typesOnly);
return true;
}
@@ -2634,7 +2634,7 @@ public:
}
const auto features = NUdf::GetDataTypeInfo(NUdf::GetDataSlot(data.GetTypeId())).Features;
- if (features & NUdf::BigDateType) {
+ if (features & NUdf::ExtDateType) {
BuildSignature<TM64ResourceName, WShifter>(builder, typesOnly);
return true;
}