duckdb 0.7.1-dev157.0 → 0.7.1-dev180.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
@@ -2,7 +2,7 @@
2
2
  "name": "duckdb",
3
3
  "main": "./lib/duckdb.js",
4
4
  "types": "./lib/duckdb.d.ts",
5
- "version": "0.7.1-dev157.0",
5
+ "version": "0.7.1-dev180.0",
6
6
  "description": "DuckDB node.js API",
7
7
  "gypfile": true,
8
8
  "dependencies": {
@@ -150,6 +150,7 @@ HivePartitionedColumnData::HivePartitionedColumnData(const HivePartitionedColumn
150
150
  void HivePartitionedColumnData::ComputePartitionIndices(PartitionedColumnDataAppendState &state, DataChunk &input) {
151
151
  Vector hashes(LogicalType::HASH, input.size());
152
152
  input.Hash(group_by_columns, hashes);
153
+ hashes.Flatten(input.size());
153
154
 
154
155
  for (idx_t i = 0; i < input.size(); i++) {
155
156
  HivePartitionKey key;
@@ -893,6 +893,12 @@ vector<LogicalType> BufferedCSVReader::SniffCSV(const vector<LogicalType> &reque
893
893
  DetectCandidateTypes(type_candidates, format_template_candidates, info_candidates, original_options, best_num_cols,
894
894
  best_sql_types_candidates, best_format_candidates, best_header_row);
895
895
 
896
+ if (best_format_candidates.empty() || best_header_row.size() == 0) {
897
+ throw InvalidInputException(
898
+ "Error in file \"%s\": CSV options could not be auto-detected. Consider setting parser options manually.",
899
+ original_options.file_path);
900
+ }
901
+
896
902
  // #######
897
903
  // ### header detection
898
904
  // #######
@@ -1,8 +1,8 @@
1
1
  #ifndef DUCKDB_VERSION
2
- #define DUCKDB_VERSION "0.7.1-dev157"
2
+ #define DUCKDB_VERSION "0.7.1-dev180"
3
3
  #endif
4
4
  #ifndef DUCKDB_SOURCE_ID
5
- #define DUCKDB_SOURCE_ID "525abf5063"
5
+ #define DUCKDB_SOURCE_ID "88290f2c1c"
6
6
  #endif
7
7
  #include "duckdb/function/table/system_functions.hpp"
8
8
  #include "duckdb/main/database.hpp"
@@ -52,7 +52,15 @@ struct HivePartitionKey {
52
52
 
53
53
  struct Equality {
54
54
  bool operator()(const HivePartitionKey &a, const HivePartitionKey &b) const {
55
- return a.values == b.values;
55
+ if (a.values.size() != b.values.size()) {
56
+ return false;
57
+ }
58
+ for (idx_t i = 0; i < a.values.size(); i++) {
59
+ if (!Value::NotDistinctFrom(a.values[i], b.values[i])) {
60
+ return false;
61
+ }
62
+ }
63
+ return true;
56
64
  }
57
65
  };
58
66
  };
@@ -78,13 +78,13 @@ protected:
78
78
  case 2:
79
79
  case 3:
80
80
  case 4:
81
- return GetBufferSize(1);
81
+ return GetBufferSize(1 << 1);
82
82
  case 5:
83
- return GetBufferSize(2);
83
+ return GetBufferSize(1 << 2);
84
84
  case 6:
85
- return GetBufferSize(3);
85
+ return GetBufferSize(1 << 3);
86
86
  default:
87
- return GetBufferSize(4);
87
+ return GetBufferSize(1 << 4);
88
88
  }
89
89
  }
90
90
  void InitializeAppendStateInternal(PartitionedColumnDataAppendState &state) const override;
@@ -83,12 +83,8 @@ void StatisticsPropagator::PropagateStatistics(LogicalComparisonJoin &join, uniq
83
83
  *node_ptr = std::move(cross_product);
84
84
  return;
85
85
  }
86
- case JoinType::INNER:
87
- case JoinType::LEFT:
88
- case JoinType::RIGHT:
89
- case JoinType::OUTER: {
90
- // inner/left/right/full outer join, replace with cross product
91
- // since the condition is always true, left/right/outer join are equivalent to inner join here
86
+ case JoinType::INNER: {
87
+ // inner, replace with cross product
92
88
  auto cross_product =
93
89
  LogicalCrossProduct::Create(std::move(join.children[0]), std::move(join.children[1]));
94
90
  *node_ptr = std::move(cross_product);
@@ -97,17 +97,20 @@ BoundStatement Binder::BindCopyTo(CopyStatement &stmt) {
97
97
  for (auto &option : original_options) {
98
98
  auto loption = StringUtil::Lower(option.first);
99
99
  if (loption == "use_tmp_file") {
100
- use_tmp_file = option.second[0].CastAs(context, LogicalType::BOOLEAN).GetValue<bool>();
100
+ use_tmp_file =
101
+ option.second.empty() || option.second[0].CastAs(context, LogicalType::BOOLEAN).GetValue<bool>();
101
102
  user_set_use_tmp_file = true;
102
103
  continue;
103
104
  }
104
105
  if (loption == "allow_overwrite") {
105
- allow_overwrite = option.second[0].CastAs(context, LogicalType::BOOLEAN).GetValue<bool>();
106
+ allow_overwrite =
107
+ option.second.empty() || option.second[0].CastAs(context, LogicalType::BOOLEAN).GetValue<bool>();
106
108
  continue;
107
109
  }
108
110
 
109
111
  if (loption == "per_thread_output") {
110
- per_thread_output = option.second[0].CastAs(context, LogicalType::BOOLEAN).GetValue<bool>();
112
+ per_thread_output =
113
+ option.second.empty() || option.second[0].CastAs(context, LogicalType::BOOLEAN).GetValue<bool>();
111
114
  continue;
112
115
  }
113
116
  if (loption == "partition_by") {
@@ -359,12 +359,11 @@ using wstring_view = basic_string_view<wchar_t>;
359
359
  #if FMT_HAS_FEATURE(__cpp_char8_t)
360
360
  typedef char8_t fmt_char8_t;
361
361
  #else
362
- typedef unsigned char fmt_char8_t;
362
+ typedef char fmt_char8_t;
363
363
  #endif
364
364
 
365
365
  /** Specifies if ``T`` is a character type. Can be specialized by users. */
366
366
  template <typename T> struct is_char : std::false_type {};
367
- template <> struct is_char<char> : std::true_type {};
368
367
  template <> struct is_char<wchar_t> : std::true_type {};
369
368
  template <> struct is_char<fmt_char8_t> : std::true_type {};
370
369
  template <> struct is_char<char16_t> : std::true_type {};