Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions vortex-duckdb/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -504,9 +504,6 @@ fn main() {
.flag("-Wall")
.flag("-Wextra")
.flag("-Wpedantic")
// Unused parameter warnings are disabled as we include DuckDB
// headers with implementations that have unused parameters.
.flag("-Wno-unused-parameter")
.cpp(true)
.include(&duckdb_include_path)
.include("cpp/include")
Expand Down
3 changes: 3 additions & 0 deletions vortex-duckdb/cpp/client_context.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,12 @@

#include "duckdb_vx.h"

#include "duckdb_vx/duckdb_diagnostics.h"
DUCKDB_INCLUDES_BEGIN
#include <duckdb/main/client_context.hpp>
#include <duckdb/main/connection.hpp>
#include <duckdb/storage/object_cache.hpp>
DUCKDB_INCLUDES_END

extern "C" duckdb_client_context duckdb_vx_connection_get_client_context(duckdb_connection conn) {
try {
Expand Down
5 changes: 5 additions & 0 deletions vortex-duckdb/cpp/config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,14 @@
// SPDX-FileCopyrightText: Copyright the Vortex contributors

#include "include/duckdb_vx/config.h"

#include "duckdb_vx/duckdb_diagnostics.h"
DUCKDB_INCLUDES_BEGIN
#include "duckdb.hpp"
#include "duckdb/main/capi/capi_internal.hpp"
#include "duckdb/main/config.hpp"
DUCKDB_INCLUDES_END

#include <string>
#include <memory>
#include <cstdlib>
Expand Down
16 changes: 10 additions & 6 deletions vortex-duckdb/cpp/copy_function.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,16 @@

#include "duckdb_vx.h"
#include "duckdb_vx/data.hpp"
#include "duckdb_vx/error.hpp"

#include "duckdb_vx/duckdb_diagnostics.h"
DUCKDB_INCLUDES_BEGIN
#include "duckdb/function/copy_function.hpp"
#include "duckdb/main/capi/capi_internal.hpp"
#include "duckdb/main/client_context.hpp"
#include "duckdb/main/connection.hpp"
#include "duckdb/parser/parsed_data/create_copy_function_info.hpp"
#include "duckdb_vx/error.hpp"
DUCKDB_INCLUDES_END

using namespace duckdb;

Expand Down Expand Up @@ -39,7 +43,7 @@ struct CCopyLocalData final : LocalFunctionData {

static duckdb_vx_copy_func_vtab_t copy_vtab_one;

unique_ptr<FunctionData> c_bind_one(ClientContext &context,
unique_ptr<FunctionData> c_bind_one(ClientContext & /*context*/,
CopyFunctionBindInput &info,
const vector<string> &column_names,
const vector<LogicalType> &column_types) {
Expand Down Expand Up @@ -90,7 +94,7 @@ c_init_global(ClientContext &context, FunctionData &bind_data, const string &fil
return make_uniq<CCopyGlobalData>(unique_ptr<CData>(reinterpret_cast<CData *>(global_data)));
}

unique_ptr<LocalFunctionData> c_init_local(ExecutionContext &context, FunctionData &bind_data) {
unique_ptr<LocalFunctionData> c_init_local(ExecutionContext & /*context*/, FunctionData &bind_data) {
auto &bind = bind_data.Cast<CCopyBindData>();
duckdb_vx_error error_out = nullptr;
auto data = bind.vtab.init_local(bind.ffi_data->DataPtr(), &error_out);
Expand All @@ -101,7 +105,7 @@ unique_ptr<LocalFunctionData> c_init_local(ExecutionContext &context, FunctionDa
return make_uniq<CCopyLocalData>(unique_ptr<CData>(reinterpret_cast<CData *>(data)));
}

void c_copy_to_sink(ExecutionContext &context,
void c_copy_to_sink(ExecutionContext & /*context*/,
FunctionData &bind_data,
GlobalFunctionData &gstate,
LocalFunctionData &lstate,
Expand All @@ -120,7 +124,7 @@ void c_copy_to_sink(ExecutionContext &context,
}
}

void copy_to_finalize(ClientContext &context, FunctionData &bind_data, GlobalFunctionData &gstate) {
void copy_to_finalize(ClientContext & /*context*/, FunctionData &bind_data, GlobalFunctionData &gstate) {
auto &bind = bind_data.Cast<CCopyBindData>();
auto &global = gstate.Cast<CCopyGlobalData>();
duckdb_vx_error error_out = nullptr;
Expand Down Expand Up @@ -152,7 +156,7 @@ extern "C" duckdb_state duckdb_vx_copy_func_register_vtab_one(duckdb_database ff
copy_function.extension = copy_vtab_one.extension;

// TODO(joe): expose this via c our api
copy_function.execution_mode = [](bool preserve_insertion_order, bool supports_batch_index) {
copy_function.execution_mode = [](bool /*preserve_insertion_order*/, bool /*supports_batch_index*/) {
return CopyFunctionExecutionMode::REGULAR_COPY_TO_FILE;
};
// TODO(joe): handle parameters as in table_function
Expand Down
3 changes: 3 additions & 0 deletions vortex-duckdb/cpp/data.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
// SPDX-License-Identifier: Apache-2.0
// SPDX-FileCopyrightText: Copyright the Vortex contributors

#include "duckdb_vx/duckdb_diagnostics.h"
DUCKDB_INCLUDES_BEGIN
#include "duckdb.h"
DUCKDB_INCLUDES_END

#include "duckdb_vx/data.hpp"

Expand Down
3 changes: 3 additions & 0 deletions vortex-duckdb/cpp/data_chunk.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
// SPDX-License-Identifier: Apache-2.0
// SPDX-FileCopyrightText: Copyright the Vortex contributors

#include "duckdb_vx/duckdb_diagnostics.h"
DUCKDB_INCLUDES_BEGIN
#include "duckdb/common/types/data_chunk.hpp"
DUCKDB_INCLUDES_END

#include "duckdb_vx.h"

Expand Down
3 changes: 3 additions & 0 deletions vortex-duckdb/cpp/error.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,12 @@
#include <cassert>
#include <exception>

#include "duckdb_vx/duckdb_diagnostics.h"
DUCKDB_INCLUDES_BEGIN
#include "duckdb/common/exception.hpp"
#include "duckdb/common/types/vector_buffer.hpp"
#include "duckdb/common/types/vector.hpp"
DUCKDB_INCLUDES_END

#include "duckdb_vx.h"

Expand Down
4 changes: 4 additions & 0 deletions vortex-duckdb/cpp/expr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,17 @@
// SPDX-FileCopyrightText: Copyright the Vortex contributors

#include "duckdb_vx.h"

#include "duckdb_vx/duckdb_diagnostics.h"
DUCKDB_INCLUDES_BEGIN
#include "duckdb/planner/expression/bound_between_expression.hpp"
#include "duckdb/planner/expression/bound_columnref_expression.hpp"
#include "duckdb/planner/expression/bound_comparison_expression.hpp"
#include "duckdb/planner/expression/bound_constant_expression.hpp"
#include "duckdb/planner/expression/bound_function_expression.hpp"
#include "duckdb/planner/expression/bound_operator_expression.hpp"
#include "duckdb/planner/expression/bound_conjunction_expression.hpp"
DUCKDB_INCLUDES_END

using namespace duckdb;

Expand Down
3 changes: 3 additions & 0 deletions vortex-duckdb/cpp/file_system.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,13 @@
#include "duckdb_vx.h"
#include "duckdb_vx/error.hpp"

#include "duckdb_vx/duckdb_diagnostics.h"
DUCKDB_INCLUDES_BEGIN
#include <duckdb/common/exception.hpp>
#include <duckdb/common/file_system.hpp>
#include <duckdb/common/helper.hpp>
#include <duckdb/main/client_context.hpp>
DUCKDB_INCLUDES_END

#include <memory>
#include <string>
Expand Down
4 changes: 4 additions & 0 deletions vortex-duckdb/cpp/include/duckdb_vx/client_context.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@

#pragma once

#include "duckdb_vx/duckdb_diagnostics.h"

DUCKDB_INCLUDES_BEGIN
#include "duckdb.h"
DUCKDB_INCLUDES_END

#ifdef __cplusplus /* If compiled as C++, use C ABI */
extern "C" {
Expand Down
4 changes: 4 additions & 0 deletions vortex-duckdb/cpp/include/duckdb_vx/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@

#pragma once

#include "duckdb_vx/duckdb_diagnostics.h"

DUCKDB_INCLUDES_BEGIN
#include "duckdb.h"
DUCKDB_INCLUDES_END

#ifdef __cplusplus
extern "C" {
Expand Down
4 changes: 4 additions & 0 deletions vortex-duckdb/cpp/include/duckdb_vx/data.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@

#pragma once

#include "duckdb_vx/duckdb_diagnostics.h"

DUCKDB_INCLUDES_BEGIN
#include "duckdb.h"
DUCKDB_INCLUDES_END

#ifdef __cplusplus /* If compiled as C++, use C ABI */
extern "C" {
Expand Down
5 changes: 5 additions & 0 deletions vortex-duckdb/cpp/include/duckdb_vx/data_chunk.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,12 @@

#pragma once

#include "duckdb_vx/duckdb_diagnostics.h"

DUCKDB_INCLUDES_BEGIN
#include "duckdb.h"
DUCKDB_INCLUDES_END

#include "error.h"

#ifdef __cplusplus /* If compiled as C++, use C ABI */
Expand Down
26 changes: 26 additions & 0 deletions vortex-duckdb/cpp/include/duckdb_vx/duckdb_diagnostics.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
// SPDX-License-Identifier: Apache-2.0
// SPDX-FileCopyrightText: Copyright the Vortex contributors

// Suppress warnings from DuckDB headers that we include but do not own.
//
// Usage:
// DUCKDB_INCLUDES_BEGIN
// #include "duckdb.h"
// #include "duckdb/main/client_context.hpp"
// DUCKDB_INCLUDES_END

#pragma once

// clang-format off
#if defined(__clang__) || defined(__GNUC__)
#define DUCKDB_INCLUDES_BEGIN \
_Pragma("GCC diagnostic push") \
_Pragma("GCC diagnostic ignored \"-Wall\"") \
_Pragma("GCC diagnostic ignored \"-Wextra\"") \
_Pragma("GCC diagnostic ignored \"-Wpedantic\"")
#define DUCKDB_INCLUDES_END _Pragma("GCC diagnostic pop")
#else
#define DUCKDB_INCLUDES_BEGIN
#define DUCKDB_INCLUDES_END
#endif
// clang-format on
5 changes: 5 additions & 0 deletions vortex-duckdb/cpp/include/duckdb_vx/error.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,12 @@
#include <exception>
#include <string>

#include "duckdb_vx/duckdb_diagnostics.h"

DUCKDB_INCLUDES_BEGIN
#include "duckdb.h"
DUCKDB_INCLUDES_END

#include "duckdb_vx/error.h"

namespace vortex {
Expand Down
5 changes: 5 additions & 0 deletions vortex-duckdb/cpp/include/duckdb_vx/file_system.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,12 @@

#pragma once

#include "duckdb_vx/duckdb_diagnostics.h"

DUCKDB_INCLUDES_BEGIN
#include "duckdb.h"
DUCKDB_INCLUDES_END

#include "duckdb_vx/client_context.h"
#include "duckdb_vx/error.h"

Expand Down
4 changes: 4 additions & 0 deletions vortex-duckdb/cpp/include/duckdb_vx/logical_type.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@

#pragma once

#include "duckdb_vx/duckdb_diagnostics.h"

DUCKDB_INCLUDES_BEGIN
#include "duckdb.h"
DUCKDB_INCLUDES_END

#ifdef __cplusplus /* If compiled as C++, use C ABI */
extern "C" {
Expand Down
5 changes: 5 additions & 0 deletions vortex-duckdb/cpp/include/duckdb_vx/reusable_dict.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,12 @@

#pragma once

#include "duckdb_vx/duckdb_diagnostics.h"

DUCKDB_INCLUDES_BEGIN
#include "duckdb.h"
DUCKDB_INCLUDES_END

#include "duckdb_vx/error.h"

#ifdef __cplusplus /* If compiled as C++, use C ABI */
Expand Down
4 changes: 4 additions & 0 deletions vortex-duckdb/cpp/include/duckdb_vx/scalar_function.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@

#pragma once

#include "duckdb_vx/duckdb_diagnostics.h"

DUCKDB_INCLUDES_BEGIN
#include "duckdb.h"
DUCKDB_INCLUDES_END

#ifdef __cplusplus /* If compiled as C++, use C ABI */
extern "C" {
Expand Down
5 changes: 5 additions & 0 deletions vortex-duckdb/cpp/include/duckdb_vx/table_filter.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,12 @@

#pragma once

#include "duckdb_vx/duckdb_diagnostics.h"

DUCKDB_INCLUDES_BEGIN
#include "duckdb.h"
DUCKDB_INCLUDES_END

#include "duckdb_vx/expr.h"

#ifdef __cplusplus /* If compiled as C++, use C ABI */
Expand Down
5 changes: 5 additions & 0 deletions vortex-duckdb/cpp/include/duckdb_vx/vector.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,12 @@

#pragma once

#include "duckdb_vx/duckdb_diagnostics.h"

DUCKDB_INCLUDES_BEGIN
#include "duckdb.h"
DUCKDB_INCLUDES_END

#include "duckdb_vx/data.h"
#include "duckdb_vx/error.h"
#include "duckdb_vx/vector_buffer.h"
Expand Down
5 changes: 5 additions & 0 deletions vortex-duckdb/cpp/include/duckdb_vx/vector_buffer.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,12 @@

#pragma once

#include "duckdb_vx/duckdb_diagnostics.h"

DUCKDB_INCLUDES_BEGIN
#include "duckdb.h"
DUCKDB_INCLUDES_END

#include "duckdb_vx/data.h"
#include "duckdb_vx/error.h"

Expand Down
4 changes: 4 additions & 0 deletions vortex-duckdb/cpp/include/duckdb_vx/vector_buffer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,12 @@

#pragma once

#include "duckdb_vx/duckdb_diagnostics.h"

DUCKDB_INCLUDES_BEGIN
#include "duckdb/common/vector.hpp"
#include "duckdb/common/types/vector.hpp"
DUCKDB_INCLUDES_END

#include "duckdb_vx/data.hpp"

Expand Down
6 changes: 6 additions & 0 deletions vortex-duckdb/cpp/logical_type.cpp
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
// SPDX-License-Identifier: Apache-2.0
// SPDX-FileCopyrightText: Copyright the Vortex contributors

#include "duckdb_vx/duckdb_diagnostics.h"

DUCKDB_INCLUDES_BEGIN
#include "duckdb/common/types.hpp"
DUCKDB_INCLUDES_END

#include "duckdb_vx.h"
#include "duckdb_vx/logical_type.h"

DUCKDB_INCLUDES_BEGIN
#include "duckdb/common/types.hpp"
DUCKDB_INCLUDES_END
#include <cassert>

duckdb_logical_type duckdb_vx_logical_type_copy(duckdb_logical_type ty) {
Expand Down
4 changes: 4 additions & 0 deletions vortex-duckdb/cpp/object_cache.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@
// SPDX-FileCopyrightText: Copyright the Vortex contributors

#include "duckdb_vx.h"
#include "duckdb_vx/duckdb_diagnostics.h"

DUCKDB_INCLUDES_BEGIN
#include "duckdb/storage/object_cache.hpp"
DUCKDB_INCLUDES_END

#include <iostream>

Expand Down
Loading
Loading