2
2
#include " duckdb/common/exception.hpp"
3
3
#include < parquet_reader.hpp>
4
4
#include " chsql_extension.hpp"
5
- #include < duckdb/common/multi_file_list.hpp>
5
+ #include < duckdb/common/multi_file/ multi_file_list.hpp>
6
6
#include " chsql_parquet_types.h"
7
7
8
8
namespace duckdb {
@@ -35,11 +35,10 @@ namespace duckdb {
35
35
haveAbsentColumns = true ;
36
36
continue ;
37
37
}
38
- columnMap.push_back (schema_column - reader->metadata ->metadata ->schema .begin () - 1 );
39
- reader->reader_data .column_ids .push_back (
40
- schema_column - reader->metadata ->metadata ->schema .begin () - 1 );
41
- reader->reader_data .column_mapping .push_back (
42
- it - returnCols.begin ());
38
+ columnMap.push_back (static_cast <column_t >(schema_column - reader->metadata ->metadata ->schema .begin () - 1 ));
39
+ reader->column_ids .push_back (
40
+ MultiFileLocalColumnId (static_cast <column_t >(schema_column - reader->metadata ->metadata ->schema .begin () - 1 )));
41
+ reader->column_indexes .emplace_back (static_cast <idx_t >(it - returnCols.begin ()));
43
42
}
44
43
auto order_by_column_it = find_if (
45
44
reader->metadata ->metadata ->schema .begin (),
@@ -55,7 +54,7 @@ namespace duckdb {
55
54
}
56
55
void Scan (ClientContext& ctx) {
57
56
chunk->Reset ();
58
- reader->Scan (*scanState, *chunk);
57
+ reader->Scan (ctx, *scanState, *chunk);
59
58
if (!haveAbsentColumns || chunk->size () == 0 ) {
60
59
return ;
61
60
}
@@ -180,7 +179,7 @@ namespace duckdb {
180
179
ParquetOptions po;
181
180
po.binary_as_string = true ;
182
181
set->reader = make_uniq<ParquetReader>(context, file, po, nullptr );
183
- res.push_back (move (set));
182
+ res.push_back (std:: move (set));
184
183
}
185
184
}
186
185
@@ -189,16 +188,16 @@ namespace duckdb {
189
188
Connection conn (*context.db );
190
189
auto res = make_uniq<OrderedReadFunctionData>();
191
190
auto files = ListValue::GetChildren (input.inputs [0 ]);
192
- vector<string> fileNames ;
191
+ vector<OpenFileInfo> fileInfoList ;
193
192
for (auto & file : files) {
194
- fileNames. push_back (file.ToString ());
193
+ fileInfoList. emplace_back (file.ToString ());
195
194
}
196
- GlobMultiFileList fileList (context, fileNames , FileGlobOptions::ALLOW_EMPTY);
197
- string filename ;
195
+ GlobMultiFileList fileList (context, fileInfoList , FileGlobOptions::ALLOW_EMPTY);
196
+ OpenFileInfo file_info ;
198
197
MultiFileListScanData it;
199
198
fileList.InitializeScan (it);
200
- while (fileList.Scan (it, filename )) {
201
- res->files .push_back (filename );
199
+ while (fileList.Scan (it, file_info )) {
200
+ res->files .push_back (file_info. path );
202
201
}
203
202
if (res->files .empty ()) {
204
203
throw InvalidInputException (" No files matched the provided pattern." );
0 commit comments