Skip to content

Commit

Permalink
chore: Update vendored sources to duckdb/duckdb@1a1de41
Browse files Browse the repository at this point in the history
Merge pull request duckdb/duckdb#12086 from gitccl/fix_list_zip
Merge pull request duckdb/duckdb#12158 from lnkuiper/simple_external_join_test
Merge pull request duckdb/duckdb#12155 from Tishj/python_sqllogictest_rm_testdir
Merge pull request duckdb/duckdb#12033 from lnkuiper/json_extract_escape
  • Loading branch information
krlmlr committed May 21, 2024
1 parent b8a4676 commit abe511a
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 8 deletions.
21 changes: 17 additions & 4 deletions src/duckdb/src/core_functions/scalar/map/map_concat.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,14 +61,20 @@ static void MapConcatFunction(DataChunk &args, ExpressionState &state, Vector &r
auto &result_entry = result_data[i];
vector<MapKeyIndexPair> index_to_map;
vector<Value> keys_list;
bool all_null = true;
for (idx_t map_idx = 0; map_idx < map_count; map_idx++) {
if (args.data[map_idx].GetType().id() == LogicalTypeId::SQLNULL) {
continue;
}
auto &map_format = map_formats[map_idx];
auto &keys = MapVector::GetKeys(args.data[map_idx]);

auto &map_format = map_formats[map_idx];
auto index = map_format.sel->get_index(i);
if (!map_format.validity.RowIsValid(index)) {
continue;
}

all_null = false;
auto &keys = MapVector::GetKeys(args.data[map_idx]);
auto entry = UnifiedVectorFormat::GetData<list_entry_t>(map_format)[index];

// Update the list for this row
Expand All @@ -89,6 +95,15 @@ static void MapConcatFunction(DataChunk &args, ExpressionState &state, Vector &r
}
}
}

result_entry.offset = ListVector::GetListSize(result);
result_entry.length = keys_list.size();
if (all_null) {
D_ASSERT(keys_list.empty() && index_to_map.empty());
FlatVector::SetNull(result, i, true);
continue;
}

vector<Value> values_list;
D_ASSERT(keys_list.size() == index_to_map.size());
// Get the values from the mapping
Expand All @@ -98,8 +113,6 @@ static void MapConcatFunction(DataChunk &args, ExpressionState &state, Vector &r
values_list.push_back(values.GetValue(mapping.key_index));
}
D_ASSERT(values_list.size() == keys_list.size());
result_entry.offset = ListVector::GetListSize(result);
result_entry.length = values_list.size();
auto list_entries = GetListEntries(std::move(keys_list), std::move(values_list));
for (auto &list_entry : list_entries) {
ListVector::PushBack(result, list_entry);
Expand Down
4 changes: 3 additions & 1 deletion src/duckdb/src/function/scalar/list/list_zip.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,10 @@ static unique_ptr<FunctionData> ListZipBind(ClientContext &context, ScalarFuncti
case LogicalTypeId::SQLNULL:
struct_children.push_back(make_pair(string(), LogicalTypeId::SQLNULL));
break;
default:
case LogicalTypeId::UNKNOWN:
throw ParameterNotResolvedException();
default:
throw BinderException("Parameter type needs to be List");
}
}
bound_function.return_type = LogicalType::LIST(LogicalType::STRUCT(struct_children));
Expand Down
6 changes: 3 additions & 3 deletions src/duckdb/src/function/table/version/pragma_version.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#ifndef DUCKDB_PATCH_VERSION
#define DUCKDB_PATCH_VERSION "3-dev1395"
#define DUCKDB_PATCH_VERSION "3-dev1409"
#endif
#ifndef DUCKDB_MINOR_VERSION
#define DUCKDB_MINOR_VERSION 10
Expand All @@ -8,10 +8,10 @@
#define DUCKDB_MAJOR_VERSION 0
#endif
#ifndef DUCKDB_VERSION
#define DUCKDB_VERSION "v0.10.3-dev1395"
#define DUCKDB_VERSION "v0.10.3-dev1409"
#endif
#ifndef DUCKDB_SOURCE_ID
#define DUCKDB_SOURCE_ID "a1dc845a19"
#define DUCKDB_SOURCE_ID "1a1de41046"
#endif
#include "duckdb/function/table/system_functions.hpp"
#include "duckdb/main/database.hpp"
Expand Down

0 comments on commit abe511a

Please sign in to comment.