]> git.proxmox.com Git - ceph.git/blame - ceph/src/arrow/cpp/src/arrow/array/builder_time.h
import quincy 17.2.0
[ceph.git] / ceph / src / arrow / cpp / src / arrow / array / builder_time.h
CommitLineData
1d09f67e
TL
1// Licensed to the Apache Software Foundation (ASF) under one
2// or more contributor license agreements. See the NOTICE file
3// distributed with this work for additional information
4// regarding copyright ownership. The ASF licenses this file
5// to you under the Apache License, Version 2.0 (the
6// "License"); you may not use this file except in compliance
7// with the License. You may obtain a copy of the License at
8//
9// http://www.apache.org/licenses/LICENSE-2.0
10//
11// Unless required by applicable law or agreed to in writing,
12// software distributed under the License is distributed on an
13// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14// KIND, either express or implied. See the License for the
15// specific language governing permissions and limitations
16// under the License.
17
18// Contains declarations of time related Arrow builder types.
19
20#pragma once
21
22#include <memory>
23
24#include "arrow/array/builder_base.h"
25#include "arrow/array/builder_primitive.h"
26
27namespace arrow {
28
29// TODO(ARROW-7938): this class is untested
30
31class ARROW_EXPORT DayTimeIntervalBuilder : public NumericBuilder<DayTimeIntervalType> {
32 public:
33 using DayMilliseconds = DayTimeIntervalType::DayMilliseconds;
34
35 explicit DayTimeIntervalBuilder(MemoryPool* pool = default_memory_pool())
36 : DayTimeIntervalBuilder(day_time_interval(), pool) {}
37
38 explicit DayTimeIntervalBuilder(std::shared_ptr<DataType> type,
39 MemoryPool* pool = default_memory_pool())
40 : NumericBuilder<DayTimeIntervalType>(type, pool) {}
41};
42
43class ARROW_EXPORT MonthDayNanoIntervalBuilder
44 : public NumericBuilder<MonthDayNanoIntervalType> {
45 public:
46 using MonthDayNanos = MonthDayNanoIntervalType::MonthDayNanos;
47
48 explicit MonthDayNanoIntervalBuilder(MemoryPool* pool = default_memory_pool())
49 : MonthDayNanoIntervalBuilder(month_day_nano_interval(), pool) {}
50
51 explicit MonthDayNanoIntervalBuilder(std::shared_ptr<DataType> type,
52 MemoryPool* pool = default_memory_pool())
53 : NumericBuilder<MonthDayNanoIntervalType>(type, pool) {}
54};
55
56} // namespace arrow