duckdb 0.3.2-dev1288.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-dev1288.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) {
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 "0d3fee81b"
15
- #define DUCKDB_VERSION "v0.3.2-dev1288"
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: