mkql_builtins_datetime.h 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419
  1. #pragma once
  2. #include "mkql_builtins_impl.h" // Y_IGNORE // Y_IGNORE
  3. namespace NKikimr {
  4. namespace NMiniKQL {
  5. using TScaledDate = i64;
  6. constexpr TScaledDate DateScale = 86400000000ll;
  7. constexpr TScaledDate DatetimeScale = 1000000ll;
  8. template<typename TSrc> inline
  9. TScaledDate ToScaledDate(typename TSrc::TLayout src);
  10. template<typename TDst> inline
  11. typename TDst::TLayout FromScaledDate(TScaledDate src);
  12. template<> inline
  13. TScaledDate ToScaledDate<NUdf::TDataType<NUdf::TDate>>(typename NUdf::TDataType<NUdf::TDate>::TLayout src) {
  14. return src * DateScale;
  15. }
  16. template<> inline
  17. NUdf::TDataType<NUdf::TDate>::TLayout FromScaledDate<NUdf::TDataType<NUdf::TDate>>(TScaledDate src) {
  18. return src / DateScale;
  19. }
  20. template<> inline
  21. TScaledDate ToScaledDate<NUdf::TDataType<NUdf::TDatetime>>(typename NUdf::TDataType<NUdf::TDatetime>::TLayout src) {
  22. return src * DatetimeScale;
  23. }
  24. template<> inline
  25. NUdf::TDataType<NUdf::TDatetime>::TLayout FromScaledDate<NUdf::TDataType<NUdf::TDatetime>>(TScaledDate src) {
  26. return src / DatetimeScale;
  27. }
  28. template<> inline
  29. TScaledDate ToScaledDate<NUdf::TDataType<NUdf::TTimestamp>>(typename NUdf::TDataType<NUdf::TTimestamp>::TLayout src) {
  30. return src;
  31. }
  32. template<> inline
  33. NUdf::TDataType<NUdf::TTimestamp>::TLayout FromScaledDate<NUdf::TDataType<NUdf::TTimestamp>>(TScaledDate src) {
  34. return src;
  35. }
  36. template<> inline
  37. TScaledDate ToScaledDate<NUdf::TDataType<NUdf::TInterval>>(typename NUdf::TDataType<NUdf::TInterval>::TLayout src) {
  38. return src;
  39. }
  40. template<> inline
  41. NUdf::TDataType<NUdf::TInterval>::TLayout FromScaledDate<NUdf::TDataType<NUdf::TInterval>>(TScaledDate src) {
  42. return src;
  43. }
  44. template<> inline
  45. TScaledDate ToScaledDate<NUdf::TDataType<NUdf::TTzDate>>(typename NUdf::TDataType<NUdf::TTzDate>::TLayout src) {
  46. return src * DateScale;
  47. }
  48. template<> inline
  49. NUdf::TDataType<NUdf::TTzDate>::TLayout FromScaledDate<NUdf::TDataType<NUdf::TTzDate>>(TScaledDate src) {
  50. return src / DateScale;
  51. }
  52. template<> inline
  53. TScaledDate ToScaledDate<NUdf::TDataType<NUdf::TTzDatetime>>(typename NUdf::TDataType<NUdf::TTzDatetime>::TLayout src) {
  54. return src * DatetimeScale;
  55. }
  56. template<> inline
  57. NUdf::TDataType<NUdf::TTzDatetime>::TLayout FromScaledDate<NUdf::TDataType<NUdf::TTzDatetime>>(TScaledDate src) {
  58. return src / DatetimeScale;
  59. }
  60. template<> inline
  61. TScaledDate ToScaledDate<NUdf::TDataType<NUdf::TTzTimestamp>>(typename NUdf::TDataType<NUdf::TTzTimestamp>::TLayout src) {
  62. return src;
  63. }
  64. template<> inline
  65. NUdf::TDataType<NUdf::TTzTimestamp>::TLayout FromScaledDate<NUdf::TDataType<NUdf::TTzTimestamp>>(TScaledDate src) {
  66. return src;
  67. }
  68. template<> inline
  69. TScaledDate ToScaledDate<NUdf::TDataType<NUdf::TDate32>>(typename NUdf::TDataType<NUdf::TDate32>::TLayout src) {
  70. return src * DateScale;
  71. }
  72. template<> inline
  73. NUdf::TDataType<NUdf::TDate32>::TLayout FromScaledDate<NUdf::TDataType<NUdf::TDate32>>(TScaledDate src) {
  74. return src / DateScale;
  75. }
  76. template<> inline
  77. TScaledDate ToScaledDate<NUdf::TDataType<NUdf::TDatetime64>>(typename NUdf::TDataType<NUdf::TDatetime64>::TLayout src) {
  78. return src * DatetimeScale;
  79. }
  80. template<> inline
  81. NUdf::TDataType<NUdf::TDatetime64>::TLayout FromScaledDate<NUdf::TDataType<NUdf::TDatetime64>>(TScaledDate src) {
  82. return src / DatetimeScale;
  83. }
  84. template<> inline
  85. TScaledDate ToScaledDate<NUdf::TDataType<NUdf::TTimestamp64>>(typename NUdf::TDataType<NUdf::TTimestamp64>::TLayout src) {
  86. return src;
  87. }
  88. template<> inline
  89. NUdf::TDataType<NUdf::TTimestamp64>::TLayout FromScaledDate<NUdf::TDataType<NUdf::TTimestamp64>>(TScaledDate src) {
  90. return src;
  91. }
  92. template<> inline
  93. TScaledDate ToScaledDate<NUdf::TDataType<NUdf::TTzDate32>>(typename NUdf::TDataType<NUdf::TTzDate32>::TLayout src) {
  94. return src * DateScale;
  95. }
  96. template<> inline
  97. NUdf::TDataType<NUdf::TTzDate32>::TLayout FromScaledDate<NUdf::TDataType<NUdf::TTzDate32>>(TScaledDate src) {
  98. return src / DateScale;
  99. }
  100. template<> inline
  101. TScaledDate ToScaledDate<NUdf::TDataType<NUdf::TTzDatetime64>>(typename NUdf::TDataType<NUdf::TTzDatetime64>::TLayout src) {
  102. return src * DatetimeScale;
  103. }
  104. template<> inline
  105. NUdf::TDataType<NUdf::TTzDatetime64>::TLayout FromScaledDate<NUdf::TDataType<NUdf::TTzDatetime64>>(TScaledDate src) {
  106. return src / DatetimeScale;
  107. }
  108. template<> inline
  109. TScaledDate ToScaledDate<NUdf::TDataType<NUdf::TTzTimestamp64>>(typename NUdf::TDataType<NUdf::TTzTimestamp64>::TLayout src) {
  110. return src;
  111. }
  112. template<> inline
  113. NUdf::TDataType<NUdf::TTzTimestamp64>::TLayout FromScaledDate<NUdf::TDataType<NUdf::TTzTimestamp64>>(TScaledDate src) {
  114. return src;
  115. }
  116. template<> inline
  117. TScaledDate ToScaledDate<NUdf::TDataType<NUdf::TInterval64>>(typename NUdf::TDataType<NUdf::TInterval64>::TLayout src) {
  118. return src;
  119. }
  120. template<> inline
  121. NUdf::TDataType<NUdf::TInterval64>::TLayout FromScaledDate<NUdf::TDataType<NUdf::TInterval64>>(TScaledDate src) {
  122. return src;
  123. }
  124. template<typename TDateType>
  125. inline bool IsBadDateTime(TScaledDate val) {
  126. static_assert(TDateType::Features & (NYql::NUdf::DateType | NYql::NUdf::TzDateType), "Date type expected");
  127. if constexpr (TDateType::Features & NYql::NUdf::BigDateType) {
  128. return val < NUdf::MIN_TIMESTAMP64 || val > NUdf::MAX_TIMESTAMP64;
  129. } else {
  130. return val < 0 || val >= TScaledDate(NUdf::MAX_TIMESTAMP);
  131. }
  132. }
  133. template<typename TDateType>
  134. inline bool IsBadInterval(TScaledDate val) {
  135. static_assert(TDateType::Features & NYql::NUdf::TimeIntervalType, "Interval type expected");
  136. if constexpr (TDateType::Features & NYql::NUdf::BigDateType) {
  137. return val < -NUdf::MAX_INTERVAL64 || val > NUdf::MAX_INTERVAL64;
  138. } else {
  139. return val <= -TScaledDate(NUdf::MAX_TIMESTAMP) || val >= TScaledDate(NUdf::MAX_TIMESTAMP);
  140. }
  141. }
  142. template<typename TDateType>
  143. inline bool IsBadScaledDate(TScaledDate val) {
  144. if constexpr (TDateType::Features & NYql::NUdf::TimeIntervalType) {
  145. return IsBadInterval<TDateType>(val);
  146. } else {
  147. return IsBadDateTime<TDateType>(val);
  148. }
  149. }
  150. #ifndef MKQL_DISABLE_CODEGEN
  151. template<typename TLayout>
  152. inline Value* GenIsInt64Overflow(Value* value, LLVMContext &context, BasicBlock* block) {
  153. if constexpr (std::is_same_v<ui64, TLayout>) {
  154. const auto i64Max = ConstantInt::get(value->getType(), static_cast<ui64>(std::numeric_limits<i64>::max()));
  155. return CmpInst::Create(Instruction::ICmp, ICmpInst::ICMP_UGT, value, i64Max, "ugt", block);
  156. } else {
  157. return ConstantInt::getFalse(context);
  158. }
  159. }
  160. template<typename TDateType>
  161. inline Value* GenIsBadDateTime(Value* val, LLVMContext &context, BasicBlock* block) {
  162. static_assert(TDateType::Features & (NYql::NUdf::DateType | NYql::NUdf::TzDateType), "Date type expected");
  163. if constexpr (TDateType::Features & NYql::NUdf::BigDateType) {
  164. auto lt = CmpInst::Create(Instruction::ICmp, ICmpInst::ICMP_SLT, val, ConstantInt::get(Type::getInt64Ty(context), NUdf::MIN_TIMESTAMP64), "lt", block);
  165. auto ge = CmpInst::Create(Instruction::ICmp, ICmpInst::ICMP_SGT, val, ConstantInt::get(Type::getInt64Ty(context), NUdf::MAX_TIMESTAMP64), "ge", block);
  166. return BinaryOperator::CreateOr(lt, ge, "or", block);
  167. } else {
  168. auto lt = CmpInst::Create(Instruction::ICmp, ICmpInst::ICMP_SLT, val, ConstantInt::get(Type::getInt64Ty(context), 0), "lt", block);
  169. auto ge = CmpInst::Create(Instruction::ICmp, ICmpInst::ICMP_SGE, val, ConstantInt::get(Type::getInt64Ty(context), NUdf::MAX_TIMESTAMP), "ge", block);
  170. return BinaryOperator::CreateOr(lt, ge, "or", block);
  171. }
  172. }
  173. template<typename TDateType>
  174. inline Value* GenIsBadInterval(Value* val, LLVMContext &context, BasicBlock* block) {
  175. static_assert(TDateType::Features & NYql::NUdf::TimeIntervalType, "Interval type expected");
  176. constexpr i64 lowerBound = (TDateType::Features & NYql::NUdf::BigDateType)
  177. ? (-NUdf::MAX_INTERVAL64 - 1)
  178. : -(i64)NUdf::MAX_TIMESTAMP;
  179. constexpr i64 upperBound = (TDateType::Features & NYql::NUdf::BigDateType)
  180. ? (NUdf::MAX_INTERVAL64 + 1)
  181. : (i64)NUdf::MAX_TIMESTAMP;
  182. auto le = CmpInst::Create(Instruction::ICmp, ICmpInst::ICMP_SLE, val, ConstantInt::get(Type::getInt64Ty(context), lowerBound), "le", block);
  183. auto ge = CmpInst::Create(Instruction::ICmp, ICmpInst::ICMP_SGE, val, ConstantInt::get(Type::getInt64Ty(context), upperBound), "ge", block);
  184. return BinaryOperator::CreateOr(le, ge, "or", block);
  185. }
  186. template<typename TDateType>
  187. inline Value* GenIsBadScaledDate(Value* val, LLVMContext &context, BasicBlock* block) {
  188. if constexpr (TDateType::Features & NYql::NUdf::TimeIntervalType) {
  189. return GenIsBadInterval<TDateType>(val, context, block);
  190. } else {
  191. return GenIsBadDateTime<TDateType>(val, context, block);
  192. }
  193. }
  194. template<typename TSrc> inline
  195. Value* GenToScaledDate(Value* value, LLVMContext &context, BasicBlock* block);
  196. template<typename TDst> inline
  197. Value* GenFromScaledDate(Value* value, LLVMContext &context, BasicBlock* block);
  198. template<> inline
  199. Value* GenToScaledDate<NUdf::TDataType<NUdf::TDate>>(Value* value, LLVMContext &context, BasicBlock* block) {
  200. const auto cast = StaticCast<NUdf::TDataType<NUdf::TDate>::TLayout, TScaledDate>(value, context, block);
  201. const auto mul = BinaryOperator::CreateMul(cast, ConstantInt::get(cast->getType(), DateScale), "mul", block);
  202. return mul;
  203. }
  204. template<> inline
  205. Value* GenFromScaledDate<NUdf::TDataType<NUdf::TDate>>(Value* value, LLVMContext &context, BasicBlock* block) {
  206. const auto div = BinaryOperator::CreateSDiv(value, ConstantInt::get(value->getType(), DateScale), "div", block);
  207. const auto cast = StaticCast<TScaledDate, NUdf::TDataType<NUdf::TDate>::TLayout>(div, context, block);
  208. return cast;
  209. }
  210. template<> inline
  211. Value* GenToScaledDate<NUdf::TDataType<NUdf::TDatetime>>(Value* value, LLVMContext &context, BasicBlock* block) {
  212. const auto cast = StaticCast<NUdf::TDataType<NUdf::TDatetime>::TLayout, TScaledDate>(value, context, block);
  213. const auto mul = BinaryOperator::CreateMul(cast, ConstantInt::get(cast->getType(), DatetimeScale), "mul", block);
  214. return mul;
  215. }
  216. template<> inline
  217. Value* GenFromScaledDate<NUdf::TDataType<NUdf::TDatetime>>(Value* value, LLVMContext &context, BasicBlock* block) {
  218. const auto div = BinaryOperator::CreateSDiv(value, ConstantInt::get(value->getType(), DatetimeScale), "div", block);
  219. const auto cast = StaticCast<TScaledDate, NUdf::TDataType<NUdf::TDatetime>::TLayout>(div, context, block);
  220. return cast;
  221. }
  222. template<> inline
  223. Value* GenToScaledDate<NUdf::TDataType<NUdf::TTimestamp>>(Value* value, LLVMContext &context, BasicBlock* block) {
  224. return StaticCast<NUdf::TDataType<NUdf::TTimestamp>::TLayout, TScaledDate>(value, context, block);
  225. }
  226. template<> inline
  227. Value* GenFromScaledDate<NUdf::TDataType<NUdf::TTimestamp>>(Value* value, LLVMContext &context, BasicBlock* block) {
  228. return StaticCast<TScaledDate, NUdf::TDataType<NUdf::TTimestamp>::TLayout>(value, context, block);
  229. }
  230. template<> inline
  231. Value* GenToScaledDate<NUdf::TDataType<NUdf::TInterval>>(Value* value, LLVMContext &context, BasicBlock* block) {
  232. return StaticCast<NUdf::TDataType<NUdf::TInterval>::TLayout, TScaledDate>(value, context, block);
  233. }
  234. template<> inline
  235. Value* GenFromScaledDate<NUdf::TDataType<NUdf::TInterval>>(Value* value, LLVMContext &context, BasicBlock* block) {
  236. return StaticCast<TScaledDate, NUdf::TDataType<NUdf::TInterval>::TLayout>(value, context, block);
  237. }
  238. template<> inline
  239. Value* GenToScaledDate<NUdf::TDataType<NUdf::TTzDate>>(Value* value, LLVMContext &context, BasicBlock* block) {
  240. const auto cast = StaticCast<NUdf::TDataType<NUdf::TTzDate>::TLayout, TScaledDate>(value, context, block);
  241. const auto mul = BinaryOperator::CreateMul(cast, ConstantInt::get(cast->getType(), DateScale), "mul", block);
  242. return mul;
  243. }
  244. template<> inline
  245. Value* GenFromScaledDate<NUdf::TDataType<NUdf::TTzDate>>(Value* value, LLVMContext &context, BasicBlock* block) {
  246. const auto div = BinaryOperator::CreateSDiv(value, ConstantInt::get(value->getType(), DateScale), "div", block);
  247. const auto cast = StaticCast<TScaledDate, NUdf::TDataType<NUdf::TTzDate>::TLayout>(div, context, block);
  248. return cast;
  249. }
  250. template<> inline
  251. Value* GenToScaledDate<NUdf::TDataType<NUdf::TTzDatetime>>(Value* value, LLVMContext &context, BasicBlock* block) {
  252. const auto cast = StaticCast<NUdf::TDataType<NUdf::TTzDatetime>::TLayout, TScaledDate>(value, context, block);
  253. const auto mul = BinaryOperator::CreateMul(cast, ConstantInt::get(cast->getType(), DatetimeScale), "mul", block);
  254. return mul;
  255. }
  256. template<> inline
  257. Value* GenFromScaledDate<NUdf::TDataType<NUdf::TTzDatetime>>(Value* value, LLVMContext &context, BasicBlock* block) {
  258. const auto div = BinaryOperator::CreateSDiv(value, ConstantInt::get(value->getType(), DatetimeScale), "div", block);
  259. const auto cast = StaticCast<TScaledDate, NUdf::TDataType<NUdf::TTzDatetime>::TLayout>(div, context, block);
  260. return cast;
  261. }
  262. template<> inline
  263. Value* GenToScaledDate<NUdf::TDataType<NUdf::TTzTimestamp>>(Value* value, LLVMContext &context, BasicBlock* block) {
  264. return StaticCast<NUdf::TDataType<NUdf::TTzTimestamp>::TLayout, TScaledDate>(value, context, block);
  265. }
  266. template<> inline
  267. Value* GenFromScaledDate<NUdf::TDataType<NUdf::TTzTimestamp>>(Value* value, LLVMContext &context, BasicBlock* block) {
  268. return StaticCast<TScaledDate, NUdf::TDataType<NUdf::TTzTimestamp>::TLayout>(value, context, block);
  269. }
  270. template<> inline
  271. Value* GenToScaledDate<NUdf::TDataType<NUdf::TDate32>>(Value* value, LLVMContext &context, BasicBlock* block) {
  272. const auto cast = StaticCast<NUdf::TDataType<NUdf::TDate32>::TLayout, TScaledDate>(value, context, block);
  273. const auto mul = BinaryOperator::CreateMul(cast, ConstantInt::get(cast->getType(), DateScale), "mul", block);
  274. return mul;
  275. }
  276. template<> inline
  277. Value* GenFromScaledDate<NUdf::TDataType<NUdf::TDate32>>(Value* value, LLVMContext &context, BasicBlock* block) {
  278. const auto div = BinaryOperator::CreateSDiv(value, ConstantInt::get(value->getType(), DateScale), "div", block);
  279. const auto cast = StaticCast<TScaledDate, NUdf::TDataType<NUdf::TDate32>::TLayout>(div, context, block);
  280. return cast;
  281. }
  282. template<> inline
  283. Value* GenToScaledDate<NUdf::TDataType<NUdf::TDatetime64>>(Value* value, LLVMContext &context, BasicBlock* block) {
  284. const auto cast = StaticCast<NUdf::TDataType<NUdf::TDatetime64>::TLayout, TScaledDate>(value, context, block);
  285. const auto mul = BinaryOperator::CreateMul(cast, ConstantInt::get(cast->getType(), DatetimeScale), "mul", block);
  286. return mul;
  287. }
  288. template<> inline
  289. Value* GenFromScaledDate<NUdf::TDataType<NUdf::TDatetime64>>(Value* value, LLVMContext &context, BasicBlock* block) {
  290. const auto div = BinaryOperator::CreateSDiv(value, ConstantInt::get(value->getType(), DatetimeScale), "div", block);
  291. const auto cast = StaticCast<TScaledDate, NUdf::TDataType<NUdf::TDatetime64>::TLayout>(div, context, block);
  292. return cast;
  293. }
  294. template<> inline
  295. Value* GenToScaledDate<NUdf::TDataType<NUdf::TTimestamp64>>(Value* value, LLVMContext &context, BasicBlock* block) {
  296. return StaticCast<NUdf::TDataType<NUdf::TTimestamp64>::TLayout, TScaledDate>(value, context, block);
  297. }
  298. template<> inline
  299. Value* GenFromScaledDate<NUdf::TDataType<NUdf::TTimestamp64>>(Value* value, LLVMContext &context, BasicBlock* block) {
  300. return StaticCast<TScaledDate, NUdf::TDataType<NUdf::TTimestamp64>::TLayout>(value, context, block);
  301. }
  302. template<> inline
  303. Value* GenToScaledDate<NUdf::TDataType<NUdf::TTzDate32>>(Value* value, LLVMContext &context, BasicBlock* block) {
  304. const auto cast = StaticCast<NUdf::TDataType<NUdf::TTzDate32>::TLayout, TScaledDate>(value, context, block);
  305. const auto mul = BinaryOperator::CreateMul(cast, ConstantInt::get(cast->getType(), DateScale), "mul", block);
  306. return mul;
  307. }
  308. template<> inline
  309. Value* GenFromScaledDate<NUdf::TDataType<NUdf::TTzDate32>>(Value* value, LLVMContext &context, BasicBlock* block) {
  310. const auto div = BinaryOperator::CreateSDiv(value, ConstantInt::get(value->getType(), DateScale), "div", block);
  311. const auto cast = StaticCast<TScaledDate, NUdf::TDataType<NUdf::TTzDate32>::TLayout>(div, context, block);
  312. return cast;
  313. }
  314. template<> inline
  315. Value* GenToScaledDate<NUdf::TDataType<NUdf::TTzDatetime64>>(Value* value, LLVMContext &context, BasicBlock* block) {
  316. const auto cast = StaticCast<NUdf::TDataType<NUdf::TTzDatetime64>::TLayout, TScaledDate>(value, context, block);
  317. const auto mul = BinaryOperator::CreateMul(cast, ConstantInt::get(cast->getType(), DatetimeScale), "mul", block);
  318. return mul;
  319. }
  320. template<> inline
  321. Value* GenFromScaledDate<NUdf::TDataType<NUdf::TTzDatetime64>>(Value* value, LLVMContext &context, BasicBlock* block) {
  322. const auto div = BinaryOperator::CreateSDiv(value, ConstantInt::get(value->getType(), DatetimeScale), "div", block);
  323. const auto cast = StaticCast<TScaledDate, NUdf::TDataType<NUdf::TTzDatetime64>::TLayout>(div, context, block);
  324. return cast;
  325. }
  326. template<> inline
  327. Value* GenToScaledDate<NUdf::TDataType<NUdf::TTzTimestamp64>>(Value* value, LLVMContext &context, BasicBlock* block) {
  328. return StaticCast<NUdf::TDataType<NUdf::TTzTimestamp64>::TLayout, TScaledDate>(value, context, block);
  329. }
  330. template<> inline
  331. Value* GenFromScaledDate<NUdf::TDataType<NUdf::TTzTimestamp64>>(Value* value, LLVMContext &context, BasicBlock* block) {
  332. return StaticCast<TScaledDate, NUdf::TDataType<NUdf::TTzTimestamp64>::TLayout>(value, context, block);
  333. }
  334. template<> inline
  335. Value* GenToScaledDate<NUdf::TDataType<NUdf::TInterval64>>(Value* value, LLVMContext &context, BasicBlock* block) {
  336. return StaticCast<NUdf::TDataType<NUdf::TInterval64>::TLayout, TScaledDate>(value, context, block);
  337. }
  338. template<> inline
  339. Value* GenFromScaledDate<NUdf::TDataType<NUdf::TInterval64>>(Value* value, LLVMContext &context, BasicBlock* block) {
  340. return StaticCast<TScaledDate, NUdf::TDataType<NUdf::TInterval64>::TLayout>(value, context, block);
  341. }
  342. #endif
  343. }
  344. }