Skip to content

Commit

Permalink
Update vendored DuckDB sources to c415a33
Browse files Browse the repository at this point in the history
  • Loading branch information
duckdblabs-bot committed Jan 27, 2025
1 parent c415a33 commit 97d9063
Show file tree
Hide file tree
Showing 6 changed files with 38 additions and 10 deletions.
6 changes: 5 additions & 1 deletion src/duckdb/src/common/compressed_file_system.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,11 @@ CompressedFile::CompressedFile(CompressedFileSystem &fs, unique_ptr<FileHandle>
}

CompressedFile::~CompressedFile() {
CompressedFile::Close();
try {
// stream_wrapper->Close() might throw
CompressedFile::Close();
} catch (...) { // NOLINT - cannot throw in exception
}
}

void CompressedFile::Initialize(bool write) {
Expand Down
2 changes: 1 addition & 1 deletion src/duckdb/src/common/multi_file_reader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ bool MultiFileReader::ParseOption(const string &key, const Value &val, MultiFile
"'hive_types' only accepts a STRUCT('name':VARCHAR, ...), but '%s' was provided",
val.type().ToString());
}
// verify that that all the children of the struct value are VARCHAR
// verify that all the children of the struct value are VARCHAR
auto &children = StructValue::GetChildren(val);
for (idx_t i = 0; i < children.size(); i++) {
const Value &child = children[i];
Expand Down
3 changes: 1 addition & 2 deletions src/duckdb/src/execution/index/fixed_size_allocator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -227,8 +227,7 @@ void FixedSizeAllocator::FinalizeVacuum() {

for (auto &buffer_id : vacuum_buffers) {
D_ASSERT(buffers.find(buffer_id) != buffers.end());
auto &buffer = buffers.find(buffer_id)->second;
D_ASSERT(buffer->InMemory());
D_ASSERT(buffers.find(buffer_id)->second->InMemory());
buffers.erase(buffer_id);
}
vacuum_buffers.clear();
Expand Down
3 changes: 2 additions & 1 deletion src/duckdb/src/function/table/read_csv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,8 @@ void CSVComplexFilterPushdown(ClientContext &context, LogicalGet &get, FunctionD
MultiFileReader().ComplexFilterPushdown(context, file_list, data.options.file_options, info, filters);
if (filtered_list) {
data.files = filtered_list->GetAllFiles();
MultiFileReader::PruneReaders(data, file_list);
SimpleMultiFileList simple_filtered_list(data.files);
MultiFileReader::PruneReaders(data, simple_filtered_list);
} else {
data.files = file_list.GetAllFiles();
}
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 "4-dev4987"
#define DUCKDB_PATCH_VERSION "4-dev5006"
#endif
#ifndef DUCKDB_MINOR_VERSION
#define DUCKDB_MINOR_VERSION 1
Expand All @@ -8,10 +8,10 @@
#define DUCKDB_MAJOR_VERSION 1
#endif
#ifndef DUCKDB_VERSION
#define DUCKDB_VERSION "v1.1.4-dev4987"
#define DUCKDB_VERSION "v1.1.4-dev5006"
#endif
#ifndef DUCKDB_SOURCE_ID
#define DUCKDB_SOURCE_ID "dc4b8892e2"
#define DUCKDB_SOURCE_ID "e70015aeac"
#endif
#include "duckdb/function/table/system_functions.hpp"
#include "duckdb/main/database.hpp"
Expand Down
28 changes: 26 additions & 2 deletions src/duckdb/src/parser/transform/expression/transform_function.cpp
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
#include "duckdb/common/enum_util.hpp"
#include "duckdb/common/string_util.hpp"
#include "duckdb/common/to_string.hpp"
#include "duckdb/parser/expression/case_expression.hpp"
#include "duckdb/parser/expression/cast_expression.hpp"
#include "duckdb/parser/expression/constant_expression.hpp"
#include "duckdb/parser/expression/function_expression.hpp"

Expand Down Expand Up @@ -47,6 +45,27 @@ static inline WindowBoundary TransformFrameOption(const int frameOptions, const
}
}

static bool IsExcludableWindowFunction(ExpressionType type) {
switch (type) {
case ExpressionType::WINDOW_FIRST_VALUE:
case ExpressionType::WINDOW_LAST_VALUE:
case ExpressionType::WINDOW_NTH_VALUE:
case ExpressionType::WINDOW_AGGREGATE:
return true;
case ExpressionType::WINDOW_RANK_DENSE:
case ExpressionType::WINDOW_RANK:
case ExpressionType::WINDOW_PERCENT_RANK:
case ExpressionType::WINDOW_ROW_NUMBER:
case ExpressionType::WINDOW_NTILE:
case ExpressionType::WINDOW_CUME_DIST:
case ExpressionType::WINDOW_LEAD:
case ExpressionType::WINDOW_LAG:
return false;
default:
throw InternalException("Unknown excludable window type %s", ExpressionTypeToString(type).c_str());
}
}

void Transformer::TransformWindowFrame(duckdb_libpgquery::PGWindowDef &window_spec, WindowExpression &expr) {
// finally: specifics of bounds
expr.start_expr = TransformExpression(window_spec.startOffset);
Expand Down Expand Up @@ -101,6 +120,11 @@ void Transformer::TransformWindowFrame(duckdb_libpgquery::PGWindowDef &window_sp
} else {
expr.exclude_clause = WindowExcludeMode::NO_OTHER;
}

if (expr.exclude_clause != WindowExcludeMode::NO_OTHER && !expr.arg_orders.empty() &&
!IsExcludableWindowFunction(expr.type)) {
throw ParserException("EXCLUDE is not supported for the window function \"%s\"", expr.function_name.c_str());
}
}

bool Transformer::ExpressionIsEmptyStar(ParsedExpression &expr) {
Expand Down

0 comments on commit 97d9063

Please sign in to comment.