duckdb 0.3.3-dev918.0 → 0.3.3-dev948.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/duckdb.cpp +56 -15
- package/src/duckdb.hpp +18 -3
- package/src/parquet-amalgamation.cpp +30602 -30452
- package/src/parquet-amalgamation.hpp +24 -6
|
@@ -7410,12 +7410,16 @@ public:
|
|
|
7410
7410
|
|
|
7411
7411
|
virtual void Skip(idx_t num_values);
|
|
7412
7412
|
|
|
7413
|
-
|
|
7414
|
-
const
|
|
7413
|
+
ParquetReader &Reader();
|
|
7414
|
+
const LogicalType &Type() const;
|
|
7415
|
+
const SchemaElement &Schema() const;
|
|
7416
|
+
idx_t FileIdx() const;
|
|
7417
|
+
idx_t MaxDefine() const;
|
|
7418
|
+
idx_t MaxRepeat() const;
|
|
7415
7419
|
|
|
7416
7420
|
virtual idx_t GroupRowsAvailable();
|
|
7417
7421
|
|
|
7418
|
-
unique_ptr<BaseStatistics> Stats(const std::vector<ColumnChunk> &columns);
|
|
7422
|
+
virtual unique_ptr<BaseStatistics> Stats(const std::vector<ColumnChunk> &columns);
|
|
7419
7423
|
|
|
7420
7424
|
protected:
|
|
7421
7425
|
// readers that use the default Read() need to implement those
|
|
@@ -7574,10 +7578,17 @@ public:
|
|
|
7574
7578
|
: ParquetReader(allocator, move(file_handle_p), vector<LogicalType>(), string()) {
|
|
7575
7579
|
}
|
|
7576
7580
|
|
|
7577
|
-
ParquetReader(ClientContext &context, string file_name, const vector<
|
|
7581
|
+
ParquetReader(ClientContext &context, string file_name, const vector<string> &names,
|
|
7582
|
+
const vector<LogicalType> &expected_types_p, const vector<column_t> &column_ids,
|
|
7578
7583
|
ParquetOptions parquet_options, const string &initial_filename = string());
|
|
7579
7584
|
ParquetReader(ClientContext &context, string file_name, ParquetOptions parquet_options)
|
|
7580
|
-
: ParquetReader(context, move(file_name), vector<
|
|
7585
|
+
: ParquetReader(context, move(file_name), vector<string>(), vector<LogicalType>(), vector<column_t>(),
|
|
7586
|
+
parquet_options, string()) {
|
|
7587
|
+
}
|
|
7588
|
+
ParquetReader(ClientContext &context, string file_name, const vector<LogicalType> &expected_types_p,
|
|
7589
|
+
ParquetOptions parquet_options)
|
|
7590
|
+
: ParquetReader(context, move(file_name), vector<string>(), expected_types_p, vector<column_t>(),
|
|
7591
|
+
parquet_options, string()) {
|
|
7581
7592
|
}
|
|
7582
7593
|
~ParquetReader();
|
|
7583
7594
|
|
|
@@ -7604,7 +7615,8 @@ public:
|
|
|
7604
7615
|
static LogicalType DeriveLogicalType(const SchemaElement &s_ele, bool binary_as_string);
|
|
7605
7616
|
|
|
7606
7617
|
private:
|
|
7607
|
-
void InitializeSchema(const vector<
|
|
7618
|
+
void InitializeSchema(const vector<string> &names, const vector<LogicalType> &expected_types_p,
|
|
7619
|
+
const vector<column_t> &column_ids, const string &initial_filename_p);
|
|
7608
7620
|
bool ScanInternal(ParquetReaderScanState &state, DataChunk &output);
|
|
7609
7621
|
unique_ptr<ColumnReader> CreateReader(const duckdb_parquet::format::FileMetaData *file_meta_data);
|
|
7610
7622
|
|
|
@@ -7623,6 +7635,12 @@ private:
|
|
|
7623
7635
|
|
|
7624
7636
|
private:
|
|
7625
7637
|
unique_ptr<FileHandle> file_handle;
|
|
7638
|
+
//! column-id map, used when reading multiple parquet files since separate parquet files might have columns at
|
|
7639
|
+
//! different positions e.g. the first file might have column "a" at position 0, the second at position 1, etc
|
|
7640
|
+
vector<column_t> column_id_map;
|
|
7641
|
+
//! Map of column_id -> cast, used when reading multiple parquet files when parquet files have diverging types
|
|
7642
|
+
//! for the same column
|
|
7643
|
+
unordered_map<column_t, LogicalType> cast_map;
|
|
7626
7644
|
};
|
|
7627
7645
|
|
|
7628
7646
|
} // namespace duckdb
|