duckdb 0.3.2-dev123.0 → 0.3.2-dev125.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-dev123.0",
4
+ "version": "0.3.2-dev125.0",
5
5
  "description": "DuckDB node.js API",
6
6
  "gypfile": true,
7
7
  "dependencies": {
package/src/duckdb.cpp CHANGED
@@ -92554,6 +92554,7 @@ public:
92554
92554
  } // namespace duckdb
92555
92555
 
92556
92556
 
92557
+
92557
92558
  namespace duckdb {
92558
92559
 
92559
92560
  struct StructExtractBindData : public FunctionData {
@@ -92617,12 +92618,12 @@ static unique_ptr<FunctionData> StructExtractBind(ClientContext &context, Scalar
92617
92618
 
92618
92619
  if (key_child->return_type.id() != LogicalTypeId::VARCHAR ||
92619
92620
  key_child->return_type.id() != LogicalTypeId::VARCHAR || !key_child->IsFoldable()) {
92620
- throw Exception("Key name for struct_extract needs to be a constant string");
92621
+ throw BinderException("Key name for struct_extract needs to be a constant string");
92621
92622
  }
92622
92623
  Value key_val = ExpressionExecutor::EvaluateScalar(*key_child.get());
92623
92624
  D_ASSERT(key_val.type().id() == LogicalTypeId::VARCHAR);
92624
92625
  if (key_val.is_null || key_val.str_value.length() < 1) {
92625
- throw Exception("Key name for struct_extract needs to be neither NULL nor empty");
92626
+ throw BinderException("Key name for struct_extract needs to be neither NULL nor empty");
92626
92627
  }
92627
92628
  string key = StringUtil::Lower(key_val.str_value);
92628
92629
 
@@ -92632,15 +92633,23 @@ static unique_ptr<FunctionData> StructExtractBind(ClientContext &context, Scalar
92632
92633
 
92633
92634
  for (size_t i = 0; i < struct_children.size(); i++) {
92634
92635
  auto &child = struct_children[i];
92635
- if (child.first == key) {
92636
+ if (StringUtil::Lower(child.first) == key) {
92636
92637
  found_key = true;
92637
92638
  key_index = i;
92638
92639
  return_type = child.second;
92639
92640
  break;
92640
92641
  }
92641
92642
  }
92643
+
92642
92644
  if (!found_key) {
92643
- throw Exception("Could not find key in struct");
92645
+ vector<string> candidates;
92646
+ candidates.reserve(struct_children.size());
92647
+ for (auto &struct_child : struct_children) {
92648
+ candidates.push_back(struct_child.first);
92649
+ }
92650
+ auto closest_settings = StringUtil::TopNLevenshtein(candidates, key);
92651
+ auto message = StringUtil::CandidatesMessage(closest_settings, "Candidate Entries");
92652
+ throw BinderException("Could not find key \"%s\" in struct\n%s", key, message);
92644
92653
  }
92645
92654
 
92646
92655
  bound_function.return_type = return_type;
@@ -92707,7 +92716,7 @@ static void StructPackFunction(DataChunk &args, ExpressionState &state, Vector &
92707
92716
 
92708
92717
  static unique_ptr<FunctionData> StructPackBind(ClientContext &context, ScalarFunction &bound_function,
92709
92718
  vector<unique_ptr<Expression>> &arguments) {
92710
- unordered_set<string> name_collision_set;
92719
+ case_insensitive_set_t name_collision_set;
92711
92720
 
92712
92721
  // collect names and deconflict, construct return type
92713
92722
  if (arguments.empty()) {
package/src/duckdb.hpp CHANGED
@@ -10,8 +10,8 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
10
10
 
11
11
  #pragma once
12
12
  #define DUCKDB_AMALGAMATION 1
13
- #define DUCKDB_SOURCE_ID "1e8295d66"
14
- #define DUCKDB_VERSION "0.3.2-dev123"
13
+ #define DUCKDB_SOURCE_ID "a13ec3642"
14
+ #define DUCKDB_VERSION "0.3.2-dev125"
15
15
  //===----------------------------------------------------------------------===//
16
16
  // DuckDB
17
17
  //