Skip to content

Commit b70c03a

Browse files
committed
vendor: Update vendored sources to duckdb/duckdb@318e783
CSV small code Improvements + initialising boolean variable. (duckdb/duckdb#16454) Adding windows code signing using azure (duckdb/duckdb#16444) Bump delta to working commit (duckdb/duckdb#16442)
1 parent 3361654 commit b70c03a

File tree

15 files changed

+30
-26
lines changed

15 files changed

+30
-26
lines changed

src/duckdb/src/execution/operator/csv_scanner/buffer_manager/csv_buffer.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
namespace duckdb {
55

66
CSVBuffer::CSVBuffer(ClientContext &context, idx_t buffer_size_p, CSVFileHandle &file_handle,
7-
idx_t &global_csv_current_position, idx_t file_number_p)
7+
const idx_t &global_csv_current_position, idx_t file_number_p)
88
: context(context), requested_size(buffer_size_p), file_number(file_number_p), can_seek(file_handle.CanSeek()),
99
is_pipe(file_handle.IsPipe()) {
1010
AllocateBuffer(buffer_size_p);
@@ -34,7 +34,7 @@ CSVBuffer::CSVBuffer(CSVFileHandle &file_handle, ClientContext &context, idx_t b
3434
}
3535

3636
shared_ptr<CSVBuffer> CSVBuffer::Next(CSVFileHandle &file_handle, idx_t buffer_size, idx_t file_number_p,
37-
bool &has_seaked) {
37+
bool &has_seaked) const {
3838
if (has_seaked) {
3939
// This means that at some point a reload was done, and we are currently on the incorrect position in our file
4040
// handle

src/duckdb/src/execution/operator/csv_scanner/encode/csv_encoder.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ void CSVEncoderBuffer::Reset() {
3636
actual_encoded_buffer_size = 0;
3737
}
3838

39-
CSVEncoder::CSVEncoder(DBConfig &config, const string &encoding_name_to_find, idx_t buffer_size) {
39+
CSVEncoder::CSVEncoder(const DBConfig &config, const string &encoding_name_to_find, idx_t buffer_size) {
4040
encoding_name = StringUtil::Lower(encoding_name_to_find);
4141
auto function = config.GetEncodeFunction(encoding_name_to_find);
4242
if (!function) {

src/duckdb/src/execution/operator/csv_scanner/scanner/base_scanner.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,10 @@ ScannerResult::ScannerResult(CSVStates &states_p, CSVStateMachine &state_machine
1111

1212
BaseScanner::BaseScanner(shared_ptr<CSVBufferManager> buffer_manager_p, shared_ptr<CSVStateMachine> state_machine_p,
1313
shared_ptr<CSVErrorHandler> error_handler_p, bool sniffing_p,
14-
shared_ptr<CSVFileScan> csv_file_scan_p, CSVIterator iterator_p)
14+
shared_ptr<CSVFileScan> csv_file_scan_p, const CSVIterator &iterator_p)
1515
: csv_file_scan(std::move(csv_file_scan_p)), sniffing(sniffing_p), error_handler(std::move(error_handler_p)),
16-
state_machine(std::move(state_machine_p)), buffer_manager(std::move(buffer_manager_p)), iterator(iterator_p) {
16+
state_machine(std::move(state_machine_p)), states(), buffer_manager(std::move(buffer_manager_p)),
17+
iterator(iterator_p) {
1718
D_ASSERT(buffer_manager);
1819
D_ASSERT(state_machine);
1920
// Initialize current buffer handle

src/duckdb/src/execution/operator/csv_scanner/scanner/csv_schema.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,8 @@ void CSVSchema::MergeSchemas(CSVSchema &other, bool null_padding) {
7676
}
7777
}
7878

79-
CSVSchema::CSVSchema(vector<string> &names, vector<LogicalType> &types, const string &file_path, idx_t rows_read_p,
80-
const bool empty_p)
79+
CSVSchema::CSVSchema(const vector<string> &names, const vector<LogicalType> &types, const string &file_path,
80+
idx_t rows_read_p, const bool empty_p)
8181
: rows_read(rows_read_p), empty(empty_p) {
8282
Initialize(names, types, file_path);
8383
}

src/duckdb/src/execution/operator/csv_scanner/scanner/scanner_boundary.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ CSVBoundary::CSVBoundary(idx_t buffer_idx_p, idx_t buffer_pos_p, idx_t boundary_
1313
CSVBoundary::CSVBoundary() : buffer_idx(0), buffer_pos(0), boundary_idx(0), end_pos(NumericLimits<idx_t>::Maximum()) {
1414
}
1515

16-
CSVIterator::CSVIterator() : is_set(false) {
16+
CSVIterator::CSVIterator() : buffer_size(0), is_set(false) {
1717
}
1818

1919
void CSVBoundary::Print() const {

src/duckdb/src/execution/operator/csv_scanner/scanner/string_value_scanner.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -970,7 +970,8 @@ StringValueScanner::StringValueScanner(idx_t scanner_idx_p, const shared_ptr<CSV
970970
result(states, *state_machine, cur_buffer_handle, BufferAllocator::Get(buffer_manager->context), result_size,
971971
iterator.pos.buffer_pos, *error_handler, iterator,
972972
buffer_manager->context.client_data->debug_set_max_line_length, csv_file_scan, lines_read, sniffing,
973-
buffer_manager->GetFilePath(), scanner_idx_p) {
973+
buffer_manager->GetFilePath(), scanner_idx_p),
974+
start_pos(0) {
974975
iterator.buffer_size = state_machine->options.buffer_size_option.GetValue();
975976
}
976977

@@ -982,7 +983,8 @@ StringValueScanner::StringValueScanner(const shared_ptr<CSVBufferManager> &buffe
982983
result(states, *state_machine, cur_buffer_handle, Allocator::DefaultAllocator(), result_size,
983984
iterator.pos.buffer_pos, *error_handler, iterator,
984985
buffer_manager->context.client_data->debug_set_max_line_length, csv_file_scan, lines_read, sniffing,
985-
buffer_manager->GetFilePath(), 0) {
986+
buffer_manager->GetFilePath(), 0),
987+
start_pos(0) {
986988
iterator.buffer_size = state_machine->options.buffer_size_option.GetValue();
987989
}
988990

src/duckdb/src/execution/operator/csv_scanner/sniffer/type_refinement.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#include "duckdb/execution/operator/csv_scanner/csv_casting.hpp"
33

44
namespace duckdb {
5-
bool CSVSniffer::TryCastVector(Vector &parse_chunk_col, idx_t size, const LogicalType &sql_type) {
5+
bool CSVSniffer::TryCastVector(Vector &parse_chunk_col, idx_t size, const LogicalType &sql_type) const {
66
auto &sniffing_state_machine = best_candidate->GetStateMachine();
77
// try vector-cast from string to sql_type
88
Vector dummy_result(sql_type, size);

src/duckdb/src/function/table/version/pragma_version.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#ifndef DUCKDB_PATCH_VERSION
2-
#define DUCKDB_PATCH_VERSION "1-dev207"
2+
#define DUCKDB_PATCH_VERSION "1-dev214"
33
#endif
44
#ifndef DUCKDB_MINOR_VERSION
55
#define DUCKDB_MINOR_VERSION 2
@@ -8,10 +8,10 @@
88
#define DUCKDB_MAJOR_VERSION 1
99
#endif
1010
#ifndef DUCKDB_VERSION
11-
#define DUCKDB_VERSION "v1.2.1-dev207"
11+
#define DUCKDB_VERSION "v1.2.1-dev214"
1212
#endif
1313
#ifndef DUCKDB_SOURCE_ID
14-
#define DUCKDB_SOURCE_ID "5e6f23a220"
14+
#define DUCKDB_SOURCE_ID "318e783c48"
1515
#endif
1616
#include "duckdb/function/table/system_functions.hpp"
1717
#include "duckdb/main/database.hpp"

src/duckdb/src/include/duckdb/execution/operator/csv_scanner/base_scanner.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ class BaseScanner {
116116
public:
117117
explicit BaseScanner(shared_ptr<CSVBufferManager> buffer_manager, shared_ptr<CSVStateMachine> state_machine,
118118
shared_ptr<CSVErrorHandler> error_handler, bool sniffing = false,
119-
shared_ptr<CSVFileScan> csv_file_scan = nullptr, CSVIterator iterator = {});
119+
shared_ptr<CSVFileScan> csv_file_scan = nullptr, const CSVIterator &iterator = {});
120120

121121
virtual ~BaseScanner() = default;
122122

src/duckdb/src/include/duckdb/execution/operator/csv_scanner/csv_buffer.hpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,14 +45,15 @@ class CSVBuffer {
4545
public:
4646
//! Constructor for Initial Buffer
4747
CSVBuffer(ClientContext &context, idx_t buffer_size_p, CSVFileHandle &file_handle,
48-
idx_t &global_csv_current_position, idx_t file_number);
48+
const idx_t &global_csv_current_position, idx_t file_number);
4949

5050
//! Constructor for `Next()` Buffers
5151
CSVBuffer(CSVFileHandle &file_handle, ClientContext &context, idx_t buffer_size, idx_t global_csv_current_position,
5252
idx_t file_number_p, idx_t buffer_idx);
5353

5454
//! Creates a new buffer with the next part of the CSV File
55-
shared_ptr<CSVBuffer> Next(CSVFileHandle &file_handle, idx_t buffer_size, idx_t file_number, bool &has_seaked);
55+
shared_ptr<CSVBuffer> Next(CSVFileHandle &file_handle, idx_t buffer_size, idx_t file_number,
56+
bool &has_seaked) const;
5657

5758
//! Gets the buffer actual size
5859
idx_t GetBufferSize() const;
@@ -67,12 +68,12 @@ class CSVBuffer {
6768
//! Wrapper for the Pin Function, if it can seek, it means that the buffer might have been destroyed, hence we must
6869
//! Scan it from the disk file again.
6970
shared_ptr<CSVBufferHandle> Pin(CSVFileHandle &file_handle, bool &has_seeked);
70-
//! Wrapper for the unpin
71+
//! Wrapper for unpin
7172
void Unpin();
7273
char *Ptr() {
7374
return char_ptr_cast(handle.Ptr());
7475
}
75-
bool IsUnloaded() {
76+
bool IsUnloaded() const {
7677
return block->IsUnloaded();
7778
}
7879

0 commit comments

Comments
 (0)