iceberg-cpp
Loading...
Searching...
No Matches
transform_util.h
1/*
2 * Licensed to the Apache Software Foundation (ASF) under one
3 * or more contributor license agreements. See the NOTICE file
4 * distributed with this work for additional information
5 * regarding copyright ownership. The ASF licenses this file
6 * to you under the Apache License, Version 2.0 (the
7 * "License"); you may not use this file except in compliance
8 * with the License. You may obtain a copy of the License at
9 *
10 * http://www.apache.org/licenses/LICENSE-2.0
11 *
12 * Unless required by applicable law or agreed to in writing,
13 * software distributed under the License is distributed on an
14 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 * KIND, either express or implied. See the License for the
16 * specific language governing permissions and limitations
17 * under the License.
18 */
19
20#pragma once
21
22#include <string>
23
24#include "iceberg/iceberg_export.h"
25#include "iceberg/result.h"
26
27namespace iceberg {
28
29class ICEBERG_EXPORT TransformUtil {
30 public:
37 static std::string HumanYear(int32_t year);
38
45 static std::string HumanMonth(int32_t month);
46
53 static std::string HumanDay(int32_t day_ordinal);
54
61 static std::string HumanHour(int32_t hour_ordinal);
62
75 static std::string HumanTime(int64_t micros_from_midnight);
76
87 static std::string HumanTimestamp(int64_t timestamp_micros);
88
100 static std::string HumanTimestampWithZone(int64_t timestamp_micros);
101
108 static Result<int32_t> ParseDay(std::string_view str);
109
118 static Result<int64_t> ParseTime(std::string_view str);
119
128 static Result<int64_t> ParseTimestamp(std::string_view str);
129
138 static Result<int64_t> ParseTimestampWithZone(std::string_view str);
139
141 static std::string Base64Encode(std::string_view str_to_encode);
142};
143
144} // namespace iceberg
Definition transform_util.h:29