Apache Arrow (C++)
A columnar in-memory analytics layer designed to accelerate big data.
python_to_arrow.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 // Functions for converting between CPython built-in data structures and Arrow
19 // data structures
20 
21 #ifndef ARROW_PYTHON_ADAPTERS_BUILTIN_H
22 #define ARROW_PYTHON_ADAPTERS_BUILTIN_H
23 
24 #include "arrow/python/platform.h"
25 
26 #include <cstdint>
27 #include <memory>
28 
29 #include "arrow/type.h"
30 #include "arrow/util/macros.h"
31 #include "arrow/util/visibility.h"
32 
33 #include "arrow/python/common.h"
34 
35 namespace arrow {
36 
37 class Array;
38 class Status;
39 
40 namespace py {
41 
44 
45  PyConversionOptions(const std::shared_ptr<DataType>& type, int64_t size,
48 
49  // Set to null if to be inferred
50  std::shared_ptr<DataType> type;
51 
52  // Default is -1: infer from data
53  int64_t size;
54 
55  // Memory pool to use for allocations
57 
58  // Default false
60 };
61 
71 ARROW_EXPORT
73  const PyConversionOptions& options,
74  std::shared_ptr<ChunkedArray>* out);
75 
76 ARROW_EXPORT
78  std::shared_ptr<ChunkedArray>* out);
79 
80 } // namespace py
81 } // namespace arrow
82 
83 #endif // ARROW_PYTHON_ADAPTERS_BUILTIN_H
#define NULLPTR
Definition: macros.h:69
std::shared_ptr< DataType > type
Definition: python_to_arrow.h:50
PyConversionOptions(const std::shared_ptr< DataType > &type, int64_t size, MemoryPool *pool, bool from_pandas)
Definition: python_to_arrow.h:45
Definition: status.h:95
MemoryPool * default_memory_pool()
MemoryPool * pool
Definition: python_to_arrow.h:56
Definition: python_to_arrow.h:42
int64_t size
Definition: python_to_arrow.h:53
Top-level namespace for Apache Arrow C++ API.
Definition: adapter.h:32
bool from_pandas
Definition: python_to_arrow.h:59
Base class for memory allocation.
Definition: memory_pool.h:34
_object PyObject
Definition: serialize.h:30
Status ConvertPySequence(PyObject *obj, PyObject *mask, const PyConversionOptions &options, std::shared_ptr< ChunkedArray > *out)
Convert sequence (list, generator, NumPy array with dtype object) of Python objects.
PyConversionOptions()
Definition: python_to_arrow.h:43