/src/duckdb/extension/parquet/include/parquet_column_schema.hpp
Line | Count | Source (jump to first uncovered line) |
1 | | //===----------------------------------------------------------------------===// |
2 | | // DuckDB |
3 | | // |
4 | | // parquet_column_schema.hpp |
5 | | // |
6 | | // |
7 | | //===----------------------------------------------------------------------===// |
8 | | #pragma once |
9 | | |
10 | | #include "duckdb.hpp" |
11 | | #include "parquet_types.h" |
12 | | |
13 | | namespace duckdb { |
14 | | class ParquetReader; |
15 | | |
16 | | enum class ParquetColumnSchemaType { COLUMN, FILE_ROW_NUMBER, GEOMETRY, EXPRESSION }; |
17 | | |
18 | | enum class ParquetExtraTypeInfo { |
19 | | NONE, |
20 | | IMPALA_TIMESTAMP, |
21 | | UNIT_NS, |
22 | | UNIT_MS, |
23 | | UNIT_MICROS, |
24 | | DECIMAL_BYTE_ARRAY, |
25 | | DECIMAL_INT32, |
26 | | DECIMAL_INT64, |
27 | | FLOAT16 |
28 | | }; |
29 | | |
30 | | struct ParquetColumnSchema { |
31 | 0 | ParquetColumnSchema() = default; |
32 | | ParquetColumnSchema(idx_t max_define, idx_t max_repeat, idx_t schema_index, idx_t file_index, |
33 | | ParquetColumnSchemaType schema_type = ParquetColumnSchemaType::COLUMN); |
34 | | ParquetColumnSchema(string name, LogicalType type, idx_t max_define, idx_t max_repeat, idx_t schema_index, |
35 | | idx_t column_index, ParquetColumnSchemaType schema_type = ParquetColumnSchemaType::COLUMN); |
36 | | ParquetColumnSchema(ParquetColumnSchema parent, LogicalType result_type, ParquetColumnSchemaType schema_type); |
37 | | |
38 | | ParquetColumnSchemaType schema_type; |
39 | | string name; |
40 | | LogicalType type; |
41 | | idx_t max_define; |
42 | | idx_t max_repeat; |
43 | | idx_t schema_index; |
44 | | idx_t column_index; |
45 | | optional_idx parent_schema_index; |
46 | | uint32_t type_length = 0; |
47 | | uint32_t type_scale = 0; |
48 | | duckdb_parquet::Type::type parquet_type = duckdb_parquet::Type::INT32; |
49 | | ParquetExtraTypeInfo type_info = ParquetExtraTypeInfo::NONE; |
50 | | vector<ParquetColumnSchema> children; |
51 | | |
52 | | unique_ptr<BaseStatistics> Stats(ParquetReader &reader, idx_t row_group_idx_p, |
53 | | const vector<duckdb_parquet::ColumnChunk> &columns) const; |
54 | | }; |
55 | | |
56 | | } // namespace duckdb |