Apache Arrow (C++)
A columnar in-memory analytics layer designed to accelerate big data.
cast.h
Go to the documentation of this file.
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 #ifndef ARROW_COMPUTE_CAST_H
19 #define ARROW_COMPUTE_CAST_H
20 
21 #include <memory>
22 
23 #include "arrow/status.h"
24 #include "arrow/util/visibility.h"
25 
26 namespace arrow {
27 
28 class Array;
29 class ChunkedArray;
30 class Column;
31 class DataType;
32 
33 namespace compute {
34 
35 class FunctionContext;
36 class UnaryKernel;
37 
38 struct CastOptions {
40 
43 };
44 
47 ARROW_EXPORT
48 Status GetCastFunction(const DataType& in_type, const std::shared_ptr<DataType>& to_type,
49  const CastOptions& options, std::unique_ptr<UnaryKernel>* kernel);
50 
60 ARROW_EXPORT
61 Status Cast(FunctionContext* context, const Array& array,
62  const std::shared_ptr<DataType>& to_type, const CastOptions& options,
63  std::shared_ptr<Array>* out);
64 
74 ARROW_EXPORT
75 Status Cast(FunctionContext* context, const ChunkedArray& array,
76  const std::shared_ptr<DataType>& to_type, const CastOptions& options,
77  std::shared_ptr<ChunkedArray>* out);
78 
88 ARROW_EXPORT
89 Status Cast(FunctionContext* context, const Column& array,
90  const std::shared_ptr<DataType>& to_type, const CastOptions& options,
91  std::shared_ptr<Column>* out);
92 
93 } // namespace compute
94 } // namespace arrow
95 
96 #endif // ARROW_COMPUTE_CAST_H
bool allow_int_overflow
Definition: cast.h:41
Container for variables and options used by function evaluation.
Definition: context.h:37
An immutable column data structure consisting of a field (type metadata) and a logical chunked data a...
Definition: table.h:70
Definition: status.h:106
bool allow_time_truncate
Definition: cast.h:42
Status GetCastFunction(const DataType &in_type, const std::shared_ptr< DataType > &to_type, const CastOptions &options, std::unique_ptr< UnaryKernel > *kernel)
Status Cast(FunctionContext *context, const Array &array, const std::shared_ptr< DataType > &to_type, const CastOptions &options, std::shared_ptr< Array > *out)
Cast from one array type to another.
Top-level namespace for Apache Arrow C++ API.
Definition: allocator.h:29
Array base type Immutable data array with some logical type and some length.
Definition: array.h:180
Definition: cast.h:38
An array-valued function of a single input argument.
Definition: kernel.h:37
A data structure managing a list of primitive Arrow arrays logically as one large array...
Definition: table.h:41
CastOptions()
Definition: cast.h:39
Definition: type.h:150