Skip to content

Commit

Permalink
Update vendored DuckDB sources to 58cd7ba
Browse files Browse the repository at this point in the history
  • Loading branch information
duckdblabs-bot committed Nov 25, 2024
1 parent 58cd7ba commit 0fb9d3f
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ CSVError CSVError::UnterminatedQuotesError(const CSVReaderOptions &options, idx_
std::ostringstream how_to_fix_it;
how_to_fix_it << "Possible fixes:" << '\n';
how_to_fix_it << "* Enable ignore errors (ignore_errors=true) to skip this row" << '\n';
how_to_fix_it << "* Set quote do empty or to a different value (e.g., quote=\'\')" << '\n';
how_to_fix_it << "* Set quote to empty or to a different value (e.g., quote=\'\')" << '\n';
return CSVError(error.str(), UNTERMINATED_QUOTES, current_column, csv_row, error_info, row_byte_position,
byte_position, options, how_to_fix_it.str(), current_path);
}
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-dev2210"
#define DUCKDB_PATCH_VERSION "4-dev2226"
#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-dev2210"
#define DUCKDB_VERSION "v1.1.4-dev2226"
#endif
#ifndef DUCKDB_SOURCE_ID
#define DUCKDB_SOURCE_ID "1a3d614f0e"
#define DUCKDB_SOURCE_ID "044b919545"
#endif
#include "duckdb/function/table/system_functions.hpp"
#include "duckdb/main/database.hpp"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ class PlanEnumerator {
: query_graph(query_graph), query_graph_manager(query_graph_manager), cost_model(cost_model) {
}

static constexpr idx_t THRESHOLD_TO_SWAP_TO_APPROXIMATE = 12;

//! Perform the join order solving
void SolveJoinOrder();
void InitLeafPlans();
Expand Down
8 changes: 7 additions & 1 deletion src/duckdb/src/main/capi/prepared-c.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,14 @@ duckdb_logical_type duckdb_param_logical_type(duckdb_prepared_statement prepared
if (!wrapper || !wrapper->statement || wrapper->statement->HasError()) {
return nullptr;
}

auto identifier = duckdb_parameter_name_internal(prepared_statement, param_idx);
if (identifier == duckdb::string()) {
return nullptr;
}

LogicalType param_type;
auto identifier = std::to_string(param_idx);

if (wrapper->statement->data->TryGetType(identifier, param_type)) {
return reinterpret_cast<duckdb_logical_type>(new LogicalType(param_type));
}
Expand Down
5 changes: 4 additions & 1 deletion src/duckdb/src/optimizer/empty_result_pullup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,10 @@ namespace duckdb {
unique_ptr<LogicalOperator> EmptyResultPullup::PullUpEmptyJoinChildren(unique_ptr<LogicalOperator> op) {
JoinType join_type = JoinType::INVALID;
D_ASSERT(op->type == LogicalOperatorType::LOGICAL_COMPARISON_JOIN ||
op->type == LogicalOperatorType::LOGICAL_ANY_JOIN || op->type == LogicalOperatorType::LOGICAL_EXCEPT);
op->type == LogicalOperatorType::LOGICAL_ANY_JOIN || op->type == LogicalOperatorType::LOGICAL_DELIM_JOIN ||
op->type == LogicalOperatorType::LOGICAL_EXCEPT);
switch (op->type) {
case LogicalOperatorType::LOGICAL_DELIM_JOIN:
case LogicalOperatorType::LOGICAL_COMPARISON_JOIN:
join_type = op->Cast<LogicalComparisonJoin>().join_type;
break;
Expand Down Expand Up @@ -80,6 +82,7 @@ unique_ptr<LogicalOperator> EmptyResultPullup::Optimize(unique_ptr<LogicalOperat
}
case LogicalOperatorType::LOGICAL_EXCEPT:
case LogicalOperatorType::LOGICAL_ANY_JOIN:
case LogicalOperatorType::LOGICAL_DELIM_JOIN:
case LogicalOperatorType::LOGICAL_COMPARISON_JOIN: {
op = PullUpEmptyJoinChildren(std::move(op));
break;
Expand Down
4 changes: 3 additions & 1 deletion src/duckdb/src/optimizer/join_order/plan_enumerator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -472,7 +472,9 @@ void PlanEnumerator::InitLeafPlans() {
void PlanEnumerator::SolveJoinOrder() {
bool force_no_cross_product = query_graph_manager.context.config.force_no_cross_product;
// first try to solve the join order exactly
if (!SolveJoinOrderExactly()) {
if (query_graph_manager.relation_manager.NumRelations() >= THRESHOLD_TO_SWAP_TO_APPROXIMATE) {
SolveJoinOrderApproximately();
} else if (!SolveJoinOrderExactly()) {
// otherwise, if that times out we resort to a greedy algorithm
SolveJoinOrderApproximately();
}
Expand Down

0 comments on commit 0fb9d3f

Please sign in to comment.