33namespace iceberg::internal {
35inline constexpr int64_t kNanosPerMicro = 1000;
36inline constexpr int64_t kMicrosPerMilli = 1000;
37inline constexpr int64_t kMicrosPerSecond = 1000 * kMicrosPerMilli;
38inline constexpr int64_t kSecondsPerMinute = 60;
39inline constexpr int64_t kMinutesPerHour = 60;
40inline constexpr int64_t kHoursPerDay = 24;
41inline constexpr int64_t kSecondsPerHour = kMinutesPerHour * kSecondsPerMinute;
42inline constexpr int64_t kSecondsPerDay = kHoursPerDay * kSecondsPerHour;
43inline constexpr int64_t kMicrosPerDay = kSecondsPerDay * kMicrosPerSecond;
44inline constexpr int64_t kNanosPerMilli = kMicrosPerMilli * kNanosPerMicro;
45inline constexpr int64_t kNanosPerSecond = kMicrosPerSecond * kNanosPerMicro;
46inline constexpr int64_t kNanosPerDay = kMicrosPerDay * kNanosPerMicro;
48inline constexpr auto kEpochYmd = std::chrono::year{1970} / std::chrono::January / 1;
49inline constexpr auto kEpochDays = std::chrono::sys_days{kEpochYmd};
Literal is a literal value that is associated with a primitive type.
Definition literal.h:42
Definition temporal_util.h:55
static Result< bool > IsUtcOffset(std::string_view str)
Reports whether a timestamp-with-zone string carries a zero (UTC) offset.
static Result< int64_t > ParseTimestampWithZone(std::string_view str)
Parses a timestamp-with-zone string into microseconds since epoch (UTC).
static Result< int64_t > ParseTimestampNs(std::string_view str)
Parses a timestamp string into nanoseconds since epoch.
static Result< int64_t > ParseTime(std::string_view str)
Parses a time string into microseconds from midnight.
static Result< int64_t > MicrosToNanos(int64_t micros)
Convert microseconds since epoch to nanoseconds, failing on overflow.
static Result< int64_t > ParseTimeNs(std::string_view str)
Parses a time string into nanoseconds from midnight.
static Result< int64_t > ParseTimestampNsWithZone(std::string_view str)
Parses a timestamp-with-zone string into nanoseconds since epoch (UTC).
static int64_t NanosToMicros(int64_t nanos)
Convert nanoseconds since epoch to microseconds using floor division.
static Result< Literal > ExtractMonth(const Literal &literal)
Extract a date or timestamp month, as months from 1970-01-01.
static Result< Literal > ExtractHour(const Literal &literal)
Extract a timestamp hour, as hours from 1970-01-01 00:00:00.
static Result< Literal > ExtractYear(const Literal &literal)
Extract a date or timestamp year, as years from 1970.
static Result< Literal > ExtractDay(const Literal &literal)
Extract a date or timestamp day, as days from 1970-01-01.
static Result< int32_t > ParseDay(std::string_view str)
Parses a date string in "[+-]yyyy-MM-dd" format into days since epoch.
static Result< int64_t > ParseTimestamp(std::string_view str)
Parses a timestamp string into microseconds since epoch.
Define symbol visibility macros for core Iceberg APIs.
Core Apache Iceberg C++ APIs.
Definition arrow_io_util.h:33
std::expected< T, E > Result
Result alias.
Definition result.h:88
Define Result, Status, and error helpers.