Skip to content

Commit

Permalink
Update vendored DuckDB sources to d5c92d2
Browse files Browse the repository at this point in the history
  • Loading branch information
duckdblabs-bot committed Nov 6, 2024
1 parent d5c92d2 commit ce9f826
Show file tree
Hide file tree
Showing 863 changed files with 66,863 additions and 67,456 deletions.
4 changes: 2 additions & 2 deletions CMakeLists.txt

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions src/duckdb/extension/icu/icu-dateadd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ struct ICUDateAdd : public ICUDateFunc {
LogicalType::INTERVAL));
set.AddFunction(GetDateAddFunction<interval_t, timestamp_t, ICUCalendarAdd>(LogicalType::INTERVAL,
LogicalType::TIMESTAMP_TZ));
ExtensionUtil::AddFunctionOverload(db, set);
ExtensionUtil::RegisterFunction(db, set);
}

template <typename TA, typename OP>
Expand All @@ -269,7 +269,7 @@ struct ICUDateAdd : public ICUDateFunc {
// temporal - temporal
set.AddFunction(GetBinaryAgeFunction<timestamp_t, timestamp_t, ICUCalendarSub>(LogicalType::TIMESTAMP_TZ,
LogicalType::TIMESTAMP_TZ));
ExtensionUtil::AddFunctionOverload(db, set);
ExtensionUtil::RegisterFunction(db, set);
}

static void AddDateAgeFunctions(const string &name, DatabaseInstance &db) {
Expand All @@ -278,7 +278,7 @@ struct ICUDateAdd : public ICUDateFunc {
set.AddFunction(GetBinaryAgeFunction<timestamp_t, timestamp_t, ICUCalendarAge>(LogicalType::TIMESTAMP_TZ,
LogicalType::TIMESTAMP_TZ));
set.AddFunction(GetUnaryAgeFunction<timestamp_t, ICUCalendarAge>(LogicalType::TIMESTAMP_TZ));
ExtensionUtil::AddFunctionOverload(db, set);
ExtensionUtil::RegisterFunction(db, set);
}
};

Expand Down
10 changes: 5 additions & 5 deletions src/duckdb/extension/icu/icu-datepart.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -587,7 +587,7 @@ struct ICUDatePart : public ICUDateFunc {
const LogicalType &result_type = LogicalType::BIGINT) {
ScalarFunctionSet set(name);
set.AddFunction(GetUnaryPartCodeFunction<timestamp_t, RESULT_TYPE>(LogicalType::TIMESTAMP_TZ, result_type));
ExtensionUtil::AddFunctionOverload(db, set);
ExtensionUtil::RegisterFunction(db, set);
}

template <typename INPUT_TYPE, typename RESULT_TYPE>
Expand All @@ -610,7 +610,7 @@ struct ICUDatePart : public ICUDateFunc {
ScalarFunctionSet set(name);
set.AddFunction(GetBinaryPartCodeFunction<timestamp_t, int64_t>(LogicalType::TIMESTAMP_TZ));
set.AddFunction(GetStructFunction<timestamp_t>(LogicalType::TIMESTAMP_TZ));
ExtensionUtil::AddFunctionOverload(db, set);
ExtensionUtil::RegisterFunction(db, set);
}

static duckdb::unique_ptr<FunctionData> BindLastDate(ClientContext &context, ScalarFunction &bound_function,
Expand All @@ -627,7 +627,7 @@ struct ICUDatePart : public ICUDateFunc {
static void AddLastDayFunctions(const string &name, DatabaseInstance &db) {
ScalarFunctionSet set(name);
set.AddFunction(GetLastDayFunction<timestamp_t>(LogicalType::TIMESTAMP_TZ));
ExtensionUtil::AddFunctionOverload(db, set);
ExtensionUtil::RegisterFunction(db, set);
}

static unique_ptr<FunctionData> BindMonthName(ClientContext &context, ScalarFunction &bound_function,
Expand All @@ -644,7 +644,7 @@ struct ICUDatePart : public ICUDateFunc {
static void AddMonthNameFunctions(const string &name, DatabaseInstance &db) {
ScalarFunctionSet set(name);
set.AddFunction(GetMonthNameFunction<timestamp_t>(LogicalType::TIMESTAMP_TZ));
ExtensionUtil::AddFunctionOverload(db, set);
ExtensionUtil::RegisterFunction(db, set);
}

static unique_ptr<FunctionData> BindDayName(ClientContext &context, ScalarFunction &bound_function,
Expand All @@ -661,7 +661,7 @@ struct ICUDatePart : public ICUDateFunc {
static void AddDayNameFunctions(const string &name, DatabaseInstance &db) {
ScalarFunctionSet set(name);
set.AddFunction(GetDayNameFunction<timestamp_t>(LogicalType::TIMESTAMP_TZ));
ExtensionUtil::AddFunctionOverload(db, set);
ExtensionUtil::RegisterFunction(db, set);
}
};

Expand Down
4 changes: 2 additions & 2 deletions src/duckdb/extension/icu/icu-datesub.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ struct ICUCalendarSub : public ICUDateFunc {
static void AddFunctions(const string &name, DatabaseInstance &db) {
ScalarFunctionSet set(name);
set.AddFunction(GetFunction<timestamp_t>(LogicalType::TIMESTAMP_TZ));
ExtensionUtil::AddFunctionOverload(db, set);
ExtensionUtil::RegisterFunction(db, set);
}
};

Expand Down Expand Up @@ -278,7 +278,7 @@ struct ICUCalendarDiff : public ICUDateFunc {
static void AddFunctions(const string &name, DatabaseInstance &db) {
ScalarFunctionSet set(name);
set.AddFunction(GetFunction<timestamp_t>(LogicalType::TIMESTAMP_TZ));
ExtensionUtil::AddFunctionOverload(db, set);
ExtensionUtil::RegisterFunction(db, set);
}
};

Expand Down
2 changes: 1 addition & 1 deletion src/duckdb/extension/icu/icu-datetrunc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ struct ICUDateTrunc : public ICUDateFunc {
static void AddBinaryTimestampFunction(const string &name, DatabaseInstance &db) {
ScalarFunctionSet set(name);
set.AddFunction(GetDateTruncFunction<timestamp_t>(LogicalType::TIMESTAMP_TZ));
ExtensionUtil::AddFunctionOverload(db, set);
ExtensionUtil::RegisterFunction(db, set);
}
};

Expand Down
4 changes: 2 additions & 2 deletions src/duckdb/extension/icu/icu-list-range.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -187,14 +187,14 @@ struct ICUListRange : public ICUDateFunc {
range.AddFunction(ScalarFunction({LogicalType::TIMESTAMP_TZ, LogicalType::TIMESTAMP_TZ, LogicalType::INTERVAL},
LogicalType::LIST(LogicalType::TIMESTAMP_TZ), ICUListRangeFunction<false>,
Bind));
ExtensionUtil::AddFunctionOverload(db, range);
ExtensionUtil::RegisterFunction(db, range);

// generate_series: similar to range, but inclusive instead of exclusive bounds on the RHS
ScalarFunctionSet generate_series("generate_series");
generate_series.AddFunction(
ScalarFunction({LogicalType::TIMESTAMP_TZ, LogicalType::TIMESTAMP_TZ, LogicalType::INTERVAL},
LogicalType::LIST(LogicalType::TIMESTAMP_TZ), ICUListRangeFunction<true>, Bind));
ExtensionUtil::AddFunctionOverload(db, generate_series);
ExtensionUtil::RegisterFunction(db, generate_series);
}
};

Expand Down
2 changes: 1 addition & 1 deletion src/duckdb/extension/icu/icu-strptime.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -434,7 +434,7 @@ struct ICUStrftime : public ICUDateFunc {
ScalarFunctionSet set(name);
set.AddFunction(ScalarFunction({LogicalType::TIMESTAMP_TZ, LogicalType::VARCHAR}, LogicalType::VARCHAR,
ICUStrftimeFunction, Bind));
ExtensionUtil::AddFunctionOverload(db, set);
ExtensionUtil::RegisterFunction(db, set);
}

static string_t CastOperation(icu::Calendar *calendar, timestamp_t input, Vector &result) {
Expand Down
4 changes: 2 additions & 2 deletions src/duckdb/extension/icu/icu-table-range.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ struct ICUTableRange {
nullptr, Bind<false>, nullptr, RangeDateTimeLocalInit);
range_function.in_out_function = ICUTableRangeFunction<false>;
range.AddFunction(range_function);
ExtensionUtil::AddFunctionOverload(db, range);
ExtensionUtil::RegisterFunction(db, range);

// generate_series: similar to range, but inclusive instead of exclusive bounds on the RHS
TableFunctionSet generate_series("generate_series");
Expand All @@ -204,7 +204,7 @@ struct ICUTableRange {
RangeDateTimeLocalInit);
generate_series_function.in_out_function = ICUTableRangeFunction<true>;
generate_series.AddFunction(generate_series_function);
ExtensionUtil::AddFunctionOverload(db, generate_series);
ExtensionUtil::RegisterFunction(db, generate_series);
}
};

Expand Down
2 changes: 1 addition & 1 deletion src/duckdb/extension/icu/icu-timebucket.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -631,7 +631,7 @@ struct ICUTimeBucket : public ICUDateFunc {
LogicalType::TIMESTAMP_TZ, ICUTimeBucketOriginFunction, Bind));
set.AddFunction(ScalarFunction({LogicalType::INTERVAL, LogicalType::TIMESTAMP_TZ, LogicalType::VARCHAR},
LogicalType::TIMESTAMP_TZ, ICUTimeBucketTimeZoneFunction, Bind));
ExtensionUtil::AddFunctionOverload(db, set);
ExtensionUtil::RegisterFunction(db, set);
}
};

Expand Down
2 changes: 1 addition & 1 deletion src/duckdb/extension/icu/icu-timezone.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,7 @@ struct ICUTimeZoneFunc : public ICUDateFunc {
Execute<ICUToNaiveTimestamp, timestamp_t>, Bind));
set.AddFunction(ScalarFunction({LogicalType::VARCHAR, LogicalType::TIME_TZ}, LogicalType::TIME_TZ,
Execute<ICUToTimeTZ, dtime_tz_t>, Bind));
ExtensionUtil::AddFunctionOverload(db, set);
ExtensionUtil::RegisterFunction(db, set);
}
};

Expand Down
3 changes: 1 addition & 2 deletions src/duckdb/extension/json/include/json_scan.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -309,8 +309,7 @@ struct JSONScan {

static double ScanProgress(ClientContext &context, const FunctionData *bind_data_p,
const GlobalTableFunctionState *global_state);
static idx_t GetBatchIndex(ClientContext &context, const FunctionData *bind_data_p,
LocalTableFunctionState *local_state, GlobalTableFunctionState *global_state);
static OperatorPartitionData GetPartitionData(ClientContext &context, TableFunctionGetPartitionInput &input);
static unique_ptr<NodeStatistics> Cardinality(ClientContext &context, const FunctionData *bind_data);
static void ComplexFilterPushdown(ClientContext &context, LogicalGet &get, FunctionData *bind_data_p,
vector<unique_ptr<Expression>> &filters);
Expand Down
15 changes: 8 additions & 7 deletions src/duckdb/extension/json/json_scan.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -144,8 +144,7 @@ string JSONScanData::GetTimestampFormat() const {
}

JSONScanGlobalState::JSONScanGlobalState(ClientContext &context, const JSONScanData &bind_data_p)
: bind_data(bind_data_p), transform_options(bind_data.transform_options),
allocator(BufferManager::GetBufferManager(context).GetBufferAllocator()),
: bind_data(bind_data_p), transform_options(bind_data.transform_options), allocator(BufferAllocator::Get(context)),
buffer_capacity(bind_data.maximum_object_size * 2), file_index(0), batch_index(0),
system_threads(TaskScheduler::GetScheduler(context).NumberOfThreads()),
enable_parallel_scans(bind_data.files.size() < system_threads) {
Expand Down Expand Up @@ -957,10 +956,12 @@ double JSONScan::ScanProgress(ClientContext &, const FunctionData *, const Globa
return progress / double(gstate.json_readers.size());
}

idx_t JSONScan::GetBatchIndex(ClientContext &, const FunctionData *, LocalTableFunctionState *local_state,
GlobalTableFunctionState *) {
auto &lstate = local_state->Cast<JSONLocalTableFunctionState>();
return lstate.GetBatchIndex();
OperatorPartitionData JSONScan::GetPartitionData(ClientContext &, TableFunctionGetPartitionInput &input) {
if (input.partition_info.RequiresPartitionColumns()) {
throw InternalException("JSONScan::GetPartitionData: partition columns not supported");
}
auto &lstate = input.local_state->Cast<JSONLocalTableFunctionState>();
return OperatorPartitionData(lstate.GetBatchIndex());
}

unique_ptr<NodeStatistics> JSONScan::Cardinality(ClientContext &, const FunctionData *bind_data) {
Expand Down Expand Up @@ -1014,7 +1015,7 @@ void JSONScan::TableFunctionDefaults(TableFunction &table_function) {
table_function.named_parameters["compression"] = LogicalType::VARCHAR;

table_function.table_scan_progress = ScanProgress;
table_function.get_batch_index = GetBatchIndex;
table_function.get_partition_data = GetPartitionData;
table_function.cardinality = Cardinality;

table_function.serialize = Serialize;
Expand Down
Loading

0 comments on commit ce9f826

Please sign in to comment.