|
|
static int64_t | NanosToMicros (int64_t nanos) |
| | Convert nanoseconds since epoch to microseconds using floor division.
|
| |
|
static Result< int64_t > | MicrosToNanos (int64_t micros) |
| | Convert microseconds since epoch to nanoseconds, failing on overflow.
|
| |
| 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 > | ParseTime (std::string_view str) |
| | Parses a time string into microseconds from midnight.
|
| |
| static Result< int64_t > | ParseTimeNs (std::string_view str) |
| | Parses a time string into nanoseconds from midnight.
|
| |
| static Result< int64_t > | ParseTimestamp (std::string_view str) |
| | Parses a timestamp string into microseconds since epoch.
|
| |
| static Result< int64_t > | ParseTimestampNs (std::string_view str) |
| | Parses a timestamp string into nanoseconds since epoch.
|
| |
| static Result< int64_t > | ParseTimestampWithZone (std::string_view str) |
| | Parses a timestamp-with-zone string into microseconds since epoch (UTC).
|
| |
| static Result< int64_t > | ParseTimestampNsWithZone (std::string_view str) |
| | Parses a timestamp-with-zone string into nanoseconds since epoch (UTC).
|
| |
| static Result< bool > | IsUtcOffset (std::string_view str) |
| | Reports whether a timestamp-with-zone string carries a zero (UTC) offset.
|
| |
|
static Result< Literal > | ExtractYear (const Literal &literal) |
| | Extract a date or timestamp year, as years from 1970.
|
| |
|
static Result< Literal > | ExtractMonth (const Literal &literal) |
| | Extract a date or timestamp month, as months from 1970-01-01.
|
| |
|
static Result< Literal > | ExtractDay (const Literal &literal) |
| | Extract a date or timestamp day, as days from 1970-01-01.
|
| |
|
static Result< Literal > | ExtractHour (const Literal &literal) |
| | Extract a timestamp hour, as hours from 1970-01-01 00:00:00.
|
| |
| Result< bool > iceberg::TemporalUtils::IsUtcOffset |
( |
std::string_view |
str | ) |
|
|
static |
Reports whether a timestamp-with-zone string carries a zero (UTC) offset.
The ParseTimestamp*WithZone parsers accept any offset and silently normalize it to UTC. The spec's JSON single-value form for timestamptz / timestamptz_ns default values is meant to be UTC, so callers that must enforce that rule check the offset here before parsing.
Any zero-offset spelling is treated as UTC: "Z", "+00:00" and "-00:00" all denote a zero offset and are accepted, even though the spec writes the canonical form as "+00:00". Only a genuinely non-zero offset (e.g. "+05:00") is rejected.
- Parameters
-
| str | The timestamp-with-zone string to inspect. |
- Returns
- true if the offset is zero, false if it is a non-zero offset, or an error if the timezone suffix cannot be parsed.