1 | #include "config_formats.h" |
2 | |
3 | #if USE_ORC || USE_PARQUET |
4 | |
5 | #include <DataTypes/IDataType.h> |
6 | #include <DataTypes/DataTypesNumber.h> |
7 | #include <DataTypes/DataTypeDate.h> |
8 | #include <DataTypes/DataTypeDateTime.h> |
9 | #include <DataTypes/DataTypeString.h> |
10 | #include <arrow/type.h> |
11 | #include <Columns/ColumnVector.h> |
12 | #include <arrow/table.h> |
13 | #include <arrow/array.h> |
14 | #include <arrow/buffer.h> |
15 | #include <Processors/Chunk.h> |
16 | #include <Core/Block.h> |
17 | |
18 | namespace DB |
19 | { |
20 | |
21 | class ArrowColumnToCHColumn |
22 | { |
23 | private: |
24 | |
25 | # define FOR_ARROW_NUMERIC_TYPES(M) \ |
26 | M(arrow::Type::UINT8, DB::UInt8) \ |
27 | M(arrow::Type::INT8, DB::Int8) \ |
28 | M(arrow::Type::UINT16, DB::UInt16) \ |
29 | M(arrow::Type::INT16, DB::Int16) \ |
30 | M(arrow::Type::UINT32, DB::UInt32) \ |
31 | M(arrow::Type::INT32, DB::Int32) \ |
32 | M(arrow::Type::UINT64, DB::UInt64) \ |
33 | M(arrow::Type::INT64, DB::Int64) \ |
34 | M(arrow::Type::FLOAT, DB::Float32) \ |
35 | M(arrow::Type::DOUBLE, DB::Float64) |
36 | |
37 | |
38 | public: |
39 | |
40 | static void arrowTableToCHChunk(Chunk &res, std::shared_ptr<arrow::Table> &table, |
41 | arrow::Status &read_status, const Block &, |
42 | int &row_group_current, std::string format_name); |
43 | }; |
44 | } |
45 | #endif |
46 | |