duckdb 0.6.1 → 0.6.2-dev6.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.6.1",
5
+ "version": "0.6.2-dev6.0",
6
6
  "description": "DuckDB node.js API",
7
7
  "gypfile": true,
8
8
  "dependencies": {
package/src/duckdb.cpp CHANGED
@@ -53922,7 +53922,7 @@ string LogicalType::ToString() const {
53922
53922
  string ret = "UNION(";
53923
53923
  size_t count = UnionType::GetMemberCount(*this);
53924
53924
  for (size_t i = 0; i < count; i++) {
53925
- ret += UnionType::GetMemberType(*this, i).ToString();
53925
+ ret += UnionType::GetMemberName(*this, i) + " " + UnionType::GetMemberType(*this, i).ToString();
53926
53926
  if (i < count - 1) {
53927
53927
  ret += ", ";
53928
53928
  }
@@ -103037,18 +103037,9 @@ unique_ptr<BoundCastData> BindUnionToUnionCast(BindCastInput &input, const Logic
103037
103037
  for (idx_t target_idx = 0; target_idx < UnionType::GetMemberCount(target); target_idx++) {
103038
103038
  auto &target_member_name = UnionType::GetMemberName(target, target_idx);
103039
103039
 
103040
- // found a matching member, check if the types are castable
103040
+ // found a matching member
103041
103041
  if (source_member_name == target_member_name) {
103042
103042
  auto &target_member_type = UnionType::GetMemberType(target, target_idx);
103043
-
103044
- if (input.function_set.ImplicitCastCost(source_member_type, target_member_type) < 0) {
103045
- auto message = StringUtil::Format(
103046
- "Type %s can't be cast as %s. The member '%s' can't be implicitly cast from %s to %s",
103047
- source.ToString(), target.ToString(), source_member_name, source_member_type.ToString(),
103048
- target_member_type.ToString());
103049
- throw CastException(message);
103050
- }
103051
-
103052
103043
  tag_map[source_idx] = target_idx;
103053
103044
  member_casts.push_back(input.GetCastFunction(source_member_type, target_member_type));
103054
103045
  found = true;
@@ -103122,6 +103113,14 @@ static bool UnionToUnionCast(Vector &source, Vector &result, idx_t count, CastPa
103122
103113
  }
103123
103114
  } else {
103124
103115
  // Otherwise, use the unified vector format to access the source vector.
103116
+
103117
+ // Ensure that all the result members are flat vectors
103118
+ // This is not always the case, e.g. when a member is cast using the default TryNullCast function
103119
+ // the resulting member vector will be a constant null vector.
103120
+ for (idx_t target_member_idx = 0; target_member_idx < target_member_count; target_member_idx++) {
103121
+ UnionVector::GetMember(result, target_member_idx).Flatten(count);
103122
+ }
103123
+
103125
103124
  // We assume that a union tag vector validity matches the union vector validity.
103126
103125
  UnifiedVectorFormat source_tag_format;
103127
103126
  source_tag_vector.ToUnifiedFormat(count, source_tag_format);
@@ -103134,6 +103133,9 @@ static bool UnionToUnionCast(Vector &source, Vector &result, idx_t count, CastPa
103134
103133
  auto target_tag = cast_data.tag_map[source_tag];
103135
103134
  FlatVector::GetData<union_tag_t>(result_tag_vector)[row_idx] = target_tag;
103136
103135
  } else {
103136
+
103137
+ // Issue: The members of the result is not always flatvectors
103138
+ // In the case of TryNullCast, the result member is constant.
103137
103139
  FlatVector::SetNull(result, row_idx, true);
103138
103140
  }
103139
103141
  }
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 "919cad22e8"
15
- #define DUCKDB_VERSION "v0.6.1"
14
+ #define DUCKDB_SOURCE_ID "8470c7c625"
15
+ #define DUCKDB_VERSION "v0.6.2-dev6"
16
16
  //===----------------------------------------------------------------------===//
17
17
  // DuckDB
18
18
  //