duckdb 0.3.5-dev673.0 → 0.3.5-dev677.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.5-dev673.0",
4
+ "version": "0.3.5-dev677.0",
5
5
  "description": "DuckDB node.js API",
6
6
  "gypfile": true,
7
7
  "dependencies": {
package/src/duckdb.cpp CHANGED
@@ -104365,6 +104365,31 @@ LogicalType GetArrowLogicalType(ArrowSchema &schema,
104365
104365
  }
104366
104366
  }
104367
104367
 
104368
+ // Renames repeated columns and case sensitive columns
104369
+ void RenameArrowColumns(vector<string> &names) {
104370
+ unordered_map<string, idx_t> name_map;
104371
+ for (auto &column_name : names) {
104372
+ // put it all lower_case
104373
+ auto low_column_name = StringUtil::Lower(column_name);
104374
+ if (name_map.find(low_column_name) == name_map.end()) {
104375
+ // Name does not exist yet
104376
+ name_map[low_column_name]++;
104377
+ } else {
104378
+ // Name already exists, we add _x where x is the repetition number
104379
+ string new_column_name = column_name + "_" + std::to_string(name_map[low_column_name]);
104380
+ auto new_column_name_low = StringUtil::Lower(new_column_name);
104381
+ while (name_map.find(new_column_name_low) != name_map.end()) {
104382
+ // This name is already here due to a previous definition
104383
+ name_map[low_column_name]++;
104384
+ new_column_name = column_name + "_" + std::to_string(name_map[low_column_name]);
104385
+ new_column_name_low = StringUtil::Lower(new_column_name);
104386
+ }
104387
+ column_name = new_column_name;
104388
+ name_map[new_column_name_low]++;
104389
+ }
104390
+ }
104391
+ }
104392
+
104368
104393
  unique_ptr<FunctionData> ArrowTableFunction::ArrowScanBind(ClientContext &context, TableFunctionBindInput &input,
104369
104394
  vector<LogicalType> &return_types, vector<string> &names) {
104370
104395
  typedef unique_ptr<ArrowArrayStreamWrapper> (*stream_factory_produce_t)(
@@ -104408,6 +104433,7 @@ unique_ptr<FunctionData> ArrowTableFunction::ArrowScanBind(ClientContext &contex
104408
104433
  }
104409
104434
  names.push_back(name);
104410
104435
  }
104436
+ RenameArrowColumns(names);
104411
104437
  return move(res);
104412
104438
  }
104413
104439
 
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 "064847033"
15
- #define DUCKDB_VERSION "v0.3.5-dev673"
14
+ #define DUCKDB_SOURCE_ID "9dba4e1a0"
15
+ #define DUCKDB_VERSION "v0.3.5-dev677"
16
16
  //===----------------------------------------------------------------------===//
17
17
  // DuckDB
18
18
  //