OmniSciDB
85c2d10cdc
|
#include "DateTruncate.h"
#include "ExtractFromTime.h"
#include <cstdlib>
#include <cmath>
#include <ctime>
#include <iostream>
#include <limits>
Go to the source code of this file.
Classes | |
struct | anonymous_namespace{DateTruncate.cpp}::EraTime |
Namespaces | |
anonymous_namespace{DateTruncate.cpp} | |
Variables | |
constexpr unsigned | anonymous_namespace{DateTruncate.cpp}::dtMONDAY = 3 |
constexpr unsigned | anonymous_namespace{DateTruncate.cpp}::dtSUNDAY = 4 |
constexpr unsigned | anonymous_namespace{DateTruncate.cpp}::dtSATURDAY = 5 |
RUNTIME_EXPORT DEVICE int64_t DateDiff | ( | const DatetruncField | datepart, |
const int64_t | startdate, | ||
const int64_t | enddate | ||
) |
Definition at line 396 of file DateTruncate.cpp.
References count, dtDAY, dtHOUR, dtMICROSECOND, dtMILLISECOND, dtMINUTE, dtNANOSECOND, dtQUARTERDAY, dtSECOND, dtWEEK, dtWEEK_SATURDAY, dtWEEK_SUNDAY, kMicroSecsPerSec, kMilliSecsPerSec, kNanoSecsPerSec, kSecsPerDay, kSecsPerHour, and kSecsPerMin.
Referenced by DateDiffHighPrecision(), and DateDiffNullable().
RUNTIME_EXPORT DEVICE int64_t DateDiffHighPrecision | ( | const DatetruncField | datepart, |
const int64_t | startdate, | ||
const int64_t | enddate, | ||
const int32_t | start_dim, | ||
const int32_t | end_dim | ||
) |
Definition at line 426 of file DateTruncate.cpp.
References DateDiff(), dtMICROSECOND, dtMILLISECOND, dtNANOSECOND, and floor_div().
Referenced by DateDiffHighPrecisionNullable().
RUNTIME_EXPORT DEVICE int64_t DateDiffHighPrecisionNullable | ( | const DatetruncField | datepart, |
const int64_t | startdate, | ||
const int64_t | enddate, | ||
const int32_t | start_dim, | ||
const int32_t | end_dim, | ||
const int64_t | null_val | ||
) |
Definition at line 472 of file DateTruncate.cpp.
References DateDiffHighPrecision().
RUNTIME_EXPORT DEVICE int64_t DateDiffNullable | ( | const DatetruncField | datepart, |
const int64_t | startdate, | ||
const int64_t | enddate, | ||
const int64_t | null_val | ||
) |
Definition at line 461 of file DateTruncate.cpp.
References DateDiff().
RUNTIME_EXPORT ALWAYS_INLINE DEVICE int64_t datetrunc_century | ( | int64_t | timeval | ) |
Definition at line 214 of file DateTruncate.cpp.
References floor_div(), kDaysPer400Years, kEpochAdjustedDays, kSecsPerDay, MARJAN, and unsigned_mod().
Referenced by DateTruncate().
RUNTIME_EXPORT ALWAYS_INLINE DEVICE int64_t datetrunc_day | ( | int64_t | timeval | ) |
Definition at line 46 of file DateTruncate.cpp.
References kSecsPerDay, and unsigned_mod().
Referenced by DateTruncate().
RUNTIME_EXPORT ALWAYS_INLINE DEVICE int64_t datetrunc_decade | ( | int64_t | timeval | ) |
Definition at line 195 of file DateTruncate.cpp.
References floor_div(), JANMAR, kDaysPer400Years, kEpochAdjustedDays, kSecsPerDay, MARJAN, and unsigned_mod().
Referenced by DateTruncate().
RUNTIME_EXPORT ALWAYS_INLINE DEVICE int64_t datetrunc_hour | ( | int64_t | timeval | ) |
Definition at line 37 of file DateTruncate.cpp.
References kSecsPerHour, and unsigned_mod().
Referenced by DateTruncate().
RUNTIME_EXPORT ALWAYS_INLINE DEVICE int64_t datetrunc_millennium | ( | int64_t | timeval | ) |
Definition at line 223 of file DateTruncate.cpp.
References floor_div(), kDaysPer400Years, kEpochAdjustedDays, kSecsPerDay, MARJAN, and unsigned_mod().
Referenced by DateTruncate().
RUNTIME_EXPORT ALWAYS_INLINE DEVICE int64_t datetrunc_minute | ( | int64_t | timeval | ) |
Definition at line 33 of file DateTruncate.cpp.
References kSecsPerMin, and unsigned_mod().
Referenced by DateTruncate().
RUNTIME_EXPORT ALWAYS_INLINE DEVICE int64_t datetrunc_month | ( | int64_t | timeval | ) |
Definition at line 78 of file DateTruncate.cpp.
References floor_div(), kDaysPer400Years, kEpochAdjustedDays, kEpochOffsetYear1900, kMonsPerYear, kSecondsPer4YearCycle, kSecondsPerNonLeapYear, kSecsJanToMar1900, kSecsPerDay, kUSecsPerDay, STATIC_QUAL, UINT32_MAX, and unsigned_mod().
Referenced by DateTruncate().
RUNTIME_EXPORT ALWAYS_INLINE DEVICE int64_t datetrunc_quarter | ( | int64_t | timeval | ) |
Definition at line 127 of file DateTruncate.cpp.
References floor_div(), JANMAR, kDaysPer400Years, kEpochAdjustedDays, kEpochOffsetYear1900, kSecondsPer4YearCycle, kSecondsPerNonLeapYear, kSecsJanToMar1900, kSecsPerDay, kUSecsPerDay, STATIC_QUAL, UINT32_MAX, and unsigned_mod().
Referenced by DateTruncate().
RUNTIME_EXPORT ALWAYS_INLINE DEVICE int64_t datetrunc_quarterday | ( | int64_t | timeval | ) |
Definition at line 42 of file DateTruncate.cpp.
References kSecsPerQuarterDay, and unsigned_mod().
Referenced by DateTruncate().
ALWAYS_INLINE DEVICE int64_t datetrunc_week | ( | int64_t | timeval | ) |
Definition at line 58 of file DateTruncate.cpp.
References kSecsPerDay, OFFSET, and unsigned_mod().
RUNTIME_EXPORT ALWAYS_INLINE DEVICE int64_t datetrunc_week_monday | ( | int64_t | timeval | ) |
Definition at line 64 of file DateTruncate.cpp.
Referenced by DateTruncate().
RUNTIME_EXPORT ALWAYS_INLINE DEVICE int64_t datetrunc_week_saturday | ( | int64_t | timeval | ) |
Definition at line 74 of file DateTruncate.cpp.
Referenced by DateTruncate().
RUNTIME_EXPORT ALWAYS_INLINE DEVICE int64_t datetrunc_week_sunday | ( | int64_t | timeval | ) |
Definition at line 69 of file DateTruncate.cpp.
Referenced by DateTruncate().
RUNTIME_EXPORT ALWAYS_INLINE DEVICE int64_t datetrunc_year | ( | int64_t | timeval | ) |
Definition at line 170 of file DateTruncate.cpp.
References floor_div(), JANMAR, kDaysPer400Years, kEpochAdjustedDays, kEpochOffsetYear1900, kSecondsPer4YearCycle, kSecondsPerNonLeapYear, kSecsJanToMar1900, kSecsPerDay, kUSecsPerDay, MARJAN, UINT32_MAX, and unsigned_mod().
Referenced by DateTruncate().
int64_t DateTruncate | ( | DatetruncField | field, |
const int64_t | timeval | ||
) |
Definition at line 241 of file DateTruncate.cpp.
References datetrunc_century(), datetrunc_day(), datetrunc_decade(), datetrunc_hour(), datetrunc_millennium(), datetrunc_minute(), datetrunc_month(), datetrunc_quarter(), datetrunc_quarterday(), datetrunc_week_monday(), datetrunc_week_saturday(), datetrunc_week_sunday(), datetrunc_year(), dtCENTURY, dtDAY, dtDECADE, dtHOUR, dtMICROSECOND, dtMILLENNIUM, dtMILLISECOND, dtMINUTE, dtMONTH, dtNANOSECOND, dtQUARTER, dtQUARTERDAY, dtSECOND, dtWEEK, dtWEEK_SATURDAY, dtWEEK_SUNDAY, and dtYEAR.
Referenced by Analyzer::Constant::do_cast(), anonymous_namespace{ExpressionRange.cpp}::getDateTimePrecisionCastRange(), and DateTimeTranslator::getDateTruncConstantValue().
RUNTIME_EXPORT ALWAYS_INLINE DEVICE int64_t DateTruncateHighPrecisionToDate | ( | const int64_t | timeval, |
const int64_t | scale | ||
) |
Definition at line 285 of file DateTruncate.cpp.
References floor_div(), and kSecsPerDay.
Referenced by DateTruncateHighPrecisionToDateNullable(), and Analyzer::Constant::do_cast().
RUNTIME_EXPORT ALWAYS_INLINE DEVICE int64_t DateTruncateHighPrecisionToDateNullable | ( | const int64_t | timeval, |
const int64_t | scale, | ||
const int64_t | null_val | ||
) |
Definition at line 290 of file DateTruncate.cpp.
References DateTruncateHighPrecisionToDate().