duckdb 0.3.2-dev1262.0 → 0.3.2-dev1292.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "duckdb",
3
3
  "main": "./lib/duckdb.js",
4
- "version": "0.3.2-dev1262.0",
4
+ "version": "0.3.2-dev1292.0",
5
5
  "description": "DuckDB node.js API",
6
6
  "gypfile": true,
7
7
  "dependencies": {
package/src/duckdb.cpp CHANGED
@@ -58342,8 +58342,8 @@ bool BufferedCSVReader::ReadBuffer(idx_t &start) {
58342
58342
  while (remaining > buffer_read_size) {
58343
58343
  buffer_read_size *= 2;
58344
58344
  }
58345
- if (remaining + buffer_read_size > MAXIMUM_CSV_LINE_SIZE) {
58346
- throw InvalidInputException("Maximum line size of %llu bytes exceeded!", MAXIMUM_CSV_LINE_SIZE);
58345
+ if (remaining + buffer_read_size > options.maximum_line_size) {
58346
+ throw InvalidInputException("Maximum line size of %llu bytes exceeded!", options.maximum_line_size);
58347
58347
  }
58348
58348
  buffer = unique_ptr<char[]>(new char[buffer_read_size + remaining + 1]);
58349
58349
  buffer_size = remaining + buffer_read_size;
@@ -91497,6 +91497,8 @@ static bool ParseBaseOption(BufferedCSVReaderOptions &options, string &loption,
91497
91497
  options.compression = FileCompressionTypeFromString(ParseString(set));
91498
91498
  } else if (loption == "skip") {
91499
91499
  options.skip_rows = ParseInteger(set);
91500
+ } else if (loption == "max_line_size" || loption == "maximum_line_size") {
91501
+ options.maximum_line_size = ParseInteger(set);
91500
91502
  } else {
91501
91503
  // unrecognized option in base CSV
91502
91504
  return false;
@@ -92801,6 +92803,8 @@ static unique_ptr<FunctionData> ReadCSVBind(ClientContext &context, vector<Value
92801
92803
  result->include_file_name = BooleanValue::Get(kv.second);
92802
92804
  } else if (loption == "skip") {
92803
92805
  options.skip_rows = kv.second.GetValue<int64_t>();
92806
+ } else if (loption == "max_line_size" || loption == "maximum_line_size") {
92807
+ options.maximum_line_size = kv.second.GetValue<int64_t>();
92804
92808
  } else {
92805
92809
  throw InternalException("Unrecognized parameter %s", kv.first);
92806
92810
  }
@@ -92907,6 +92911,8 @@ static void ReadCSVAddNamedParameters(TableFunction &table_function) {
92907
92911
  table_function.named_parameters["compression"] = LogicalType::VARCHAR;
92908
92912
  table_function.named_parameters["filename"] = LogicalType::BOOLEAN;
92909
92913
  table_function.named_parameters["skip"] = LogicalType::BIGINT;
92914
+ table_function.named_parameters["max_line_size"] = LogicalType::VARCHAR;
92915
+ table_function.named_parameters["maximum_line_size"] = LogicalType::VARCHAR;
92910
92916
  }
92911
92917
 
92912
92918
  double CSVReaderProgress(ClientContext &context, const FunctionData *bind_data_p) {
@@ -167149,8 +167155,8 @@ void UpdateSegment::CleanupUpdate(UpdateInfo *info) {
167149
167155
  //===--------------------------------------------------------------------===//
167150
167156
  // Check for conflicts in update
167151
167157
  //===--------------------------------------------------------------------===//
167152
- static void CheckForConflicts(UpdateInfo *info, Transaction &transaction, row_t *ids, idx_t count, row_t offset,
167153
- UpdateInfo *&node) {
167158
+ static void CheckForConflicts(UpdateInfo *info, Transaction &transaction, row_t *ids, const SelectionVector &sel,
167159
+ idx_t count, row_t offset, UpdateInfo *&node) {
167154
167160
  if (!info) {
167155
167161
  return;
167156
167162
  }
@@ -167162,7 +167168,7 @@ static void CheckForConflicts(UpdateInfo *info, Transaction &transaction, row_t
167162
167168
  // as both ids and info->tuples are sorted, this is similar to a merge join
167163
167169
  idx_t i = 0, j = 0;
167164
167170
  while (true) {
167165
- auto id = ids[i] - offset;
167171
+ auto id = ids[sel.get_index(i)] - offset;
167166
167172
  if (id == info->tuples[j]) {
167167
167173
  throw TransactionException("Conflict on update!");
167168
167174
  } else if (id < info->tuples[j]) {
@@ -167180,7 +167186,7 @@ static void CheckForConflicts(UpdateInfo *info, Transaction &transaction, row_t
167180
167186
  }
167181
167187
  }
167182
167188
  }
167183
- CheckForConflicts(info->next, transaction, ids, count, offset, node);
167189
+ CheckForConflicts(info->next, transaction, ids, sel, count, offset, node);
167184
167190
  }
167185
167191
 
167186
167192
  //===--------------------------------------------------------------------===//
@@ -167713,7 +167719,7 @@ void UpdateSegment::Update(Transaction &transaction, idx_t column_index, Vector
167713
167719
  // there is already a version here, check if there are any conflicts and search for the node that belongs to
167714
167720
  // this transaction in the version chain
167715
167721
  auto base_info = root->info[vector_index]->info.get();
167716
- CheckForConflicts(base_info->next, transaction, ids, count, vector_offset, node);
167722
+ CheckForConflicts(base_info->next, transaction, ids, sel, count, vector_offset, node);
167717
167723
 
167718
167724
  // there are no conflicts
167719
167725
  // first, check if this thread has already done any updates
package/src/duckdb.hpp CHANGED
@@ -11,8 +11,8 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
11
11
  #pragma once
12
12
  #define DUCKDB_AMALGAMATION 1
13
13
  #define DUCKDB_AMALGAMATION_EXTENDED 1
14
- #define DUCKDB_SOURCE_ID "477c52aed"
15
- #define DUCKDB_VERSION "v0.3.2-dev1262"
14
+ #define DUCKDB_SOURCE_ID "e6f479f2f"
15
+ #define DUCKDB_VERSION "v0.3.2-dev1292"
16
16
  //===----------------------------------------------------------------------===//
17
17
  // DuckDB
18
18
  //
@@ -20654,6 +20654,9 @@ struct BufferedCSVReaderOptions {
20654
20654
  idx_t buffer_size = STANDARD_VECTOR_SIZE * 100;
20655
20655
  //! Consider all columns to be of type varchar
20656
20656
  bool all_varchar = false;
20657
+ //! Maximum CSV line size: specified because if we reach this amount, we likely have wrong delimiters (default: 2MB)
20658
+ idx_t maximum_line_size = 2097152;
20659
+
20657
20660
  //! The date format to use (if any is specified)
20658
20661
  std::map<LogicalTypeId, StrpTimeFormat> date_format = {{LogicalTypeId::DATE, {}}, {LogicalTypeId::TIMESTAMP, {}}};
20659
20662
  //! Whether or not a type format is specified
@@ -20670,8 +20673,6 @@ enum class ParserMode : uint8_t { PARSING = 0, SNIFFING_DIALECT = 1, SNIFFING_DA
20670
20673
  class BufferedCSVReader {
20671
20674
  //! Initial buffer read size; can be extended for long lines
20672
20675
  static constexpr idx_t INITIAL_BUFFER_SIZE = 16384;
20673
- //! Maximum CSV line size: specified because if we reach this amount, we likely have the wrong delimiters
20674
- static constexpr idx_t MAXIMUM_CSV_LINE_SIZE = 1048576;
20675
20676
  ParserMode mode;
20676
20677
 
20677
20678
  public: