Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

logical plan #1

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
logical and physical
joker-star-l committed Feb 17, 2024
commit b368c930b4f362d590daf0072bb92cba3869c42f
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1060,11 +1060,11 @@ endif()

if(NOT CLANG_TIDY)
if(${BUILD_UNITTESTS})
add_subdirectory(test)
# add_subdirectory(test)
if(NOT WIN32
AND NOT SUN
AND ${BUILD_BENCHMARKS})
add_subdirectory(benchmark)
# add_subdirectory(benchmark)
endif()
endif()
if (NOT EXTENSION_CONFIG_BUILD)
2 changes: 1 addition & 1 deletion benchmark/benchmark_runner.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include "benchmark_runner.hpp"

#include "duckdb/common/profiler.hpp"
#include "duckdb/common/file_system.hpp"
#include "duckdb/plugin/physical/common/file_system/file_system.hpp"
#include "duckdb/common/string_util.hpp"
#include "duckdb.hpp"
#include "duckdb_benchmark.hpp"
2 changes: 1 addition & 1 deletion examples/embedded-c++/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -4,7 +4,7 @@ project(example-c++)
set(CMAKE_CXX_STANDARD 11)

include_directories(../../src/include)
link_directories(../../build/release/src)
link_directories(../../build/src)

add_executable(example main.cpp)
target_link_libraries(example duckdb)
30 changes: 23 additions & 7 deletions examples/embedded-c++/main.cpp
Original file line number Diff line number Diff line change
@@ -1,14 +1,30 @@
#include <iostream>
#include "duckdb.hpp"
#include "duckdb/common/enums/logical_operator_type.hpp"
#include "duckdb/planner/operator/logical_insert.hpp"

using namespace duckdb;

int main() {
DuckDB db(nullptr);

Connection con(db);
DuckDB db(nullptr);
Connection con(db);

con.Query("CREATE TABLE integers(i INTEGER)");
con.Query("INSERT INTO integers VALUES (3)");
auto result = con.Query("SELECT * FROM integers");
void exec_and_explain(const std::string& sql) {
auto result = con.Query(sql);
std::cout << "=================" << std::endl;
result->Print();
auto plan = con.ExtractPlan(sql);
std::cout << "=================" << std::endl;
plan->Print();

if ((*plan).type == LogicalOperatorType::LOGICAL_INSERT) {
auto& op = (*plan).Cast<LogicalInsert>();
}
}

int main() {
exec_and_explain("CREATE TABLE integers(i INTEGER, j INTEGER);");
exec_and_explain("INSERT INTO integers VALUES (1, 2), (3, 4), (4, 5), (5, 5), (5, 6);");
exec_and_explain("SELECT *, abs(i) FROM integers where j = 5;");

return 0;
}
4 changes: 2 additions & 2 deletions examples/standalone-window/main.cpp
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
#include "duckdb.hpp"
#ifndef DUCKDB_AMALGAMATION
#include "duckdb/execution/operator/aggregate/physical_window.hpp"
#include "duckdb/plugin/physical/execution/operator/aggregate/physical_window.hpp"
#include "duckdb/planner/expression.hpp"
#include "duckdb/planner/expression/bound_window_expression.hpp"
#include "duckdb/planner/expression/bound_constant_expression.hpp"
#include "duckdb/planner/expression/bound_reference_expression.hpp"
#include "duckdb/parallel/thread_context.hpp"
#include "duckdb/plugin/physical/parallel/thread_context.hpp"
#include "duckdb/function/aggregate/distributive_functions.hpp"
#endif

2 changes: 1 addition & 1 deletion extension/autocomplete/autocomplete_extension.cpp
Original file line number Diff line number Diff line change
@@ -6,7 +6,7 @@
#include "duckdb/catalog/catalog_entry/view_catalog_entry.hpp"
#include "duckdb/common/case_insensitive_map.hpp"
#include "duckdb/common/exception.hpp"
#include "duckdb/common/file_opener.hpp"
#include "duckdb/plugin/physical/common/file_system/file_opener.hpp"
#include "duckdb/function/table_function.hpp"
#include "duckdb/main/client_context.hpp"
#include "duckdb/main/client_data.hpp"
4 changes: 2 additions & 2 deletions extension/httpfs/httpfs.cpp
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#include "httpfs.hpp"

#include "duckdb/common/atomic.hpp"
#include "duckdb/common/file_opener.hpp"
#include "duckdb/common/http_state.hpp"
#include "duckdb/plugin/physical/common/file_system/file_opener.hpp"
#include "duckdb/plugin/physical/common/file_system/http_state.hpp"
#include "duckdb/common/thread.hpp"
#include "duckdb/common/types/hash.hpp"
#include "duckdb/function/scalar/strftime_format.hpp"
4 changes: 2 additions & 2 deletions extension/httpfs/include/httpfs.hpp
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
#pragma once

#include "duckdb/common/file_system.hpp"
#include "duckdb/plugin/physical/common/file_system/file_system.hpp"
#include "duckdb/common/pair.hpp"
#include "duckdb/common/unordered_map.hpp"
#include "duckdb/common/case_insensitive_map.hpp"
#include "duckdb/common/http_state.hpp"
#include "duckdb/plugin/physical/common/file_system/http_state.hpp"
#include "duckdb/main/client_data.hpp"
#include "http_metadata_cache.hpp"

4 changes: 2 additions & 2 deletions extension/httpfs/include/s3fs.hpp
Original file line number Diff line number Diff line change
@@ -2,10 +2,10 @@

#include "duckdb/common/atomic.hpp"
#include "duckdb/common/chrono.hpp"
#include "duckdb/common/file_opener.hpp"
#include "duckdb/plugin/physical/common/file_system/file_opener.hpp"
#include "duckdb/common/mutex.hpp"
#include "duckdb/main/config.hpp"
#include "duckdb/storage/buffer_manager.hpp"
#include "duckdb/plugin/physical/storage/buffer_manager.hpp"
#include "httpfs.hpp"

#define CPPHTTPLIB_OPENSSL_SUPPORT
4 changes: 2 additions & 2 deletions extension/httpfs/s3fs.cpp
Original file line number Diff line number Diff line change
@@ -3,14 +3,14 @@
#include "crypto.hpp"
#include "duckdb.hpp"
#ifndef DUCKDB_AMALGAMATION
#include "duckdb/common/http_state.hpp"
#include "duckdb/plugin/physical/common/file_system/http_state.hpp"
#include "duckdb/common/thread.hpp"
#include "duckdb/common/types/timestamp.hpp"
#include "duckdb/function/scalar/strftime_format.hpp"
#endif

#include <duckdb/function/scalar/string_functions.hpp>
#include <duckdb/storage/buffer_manager.hpp>
#include <duckdb/plugin/physical/storage/buffer_manager.hpp>
#include <iostream>
#include <thread>

6 changes: 3 additions & 3 deletions extension/icu/icu-datepart.cpp
Original file line number Diff line number Diff line change
@@ -5,9 +5,9 @@
#include "duckdb/common/enums/date_part_specifier.hpp"
#include "duckdb/common/types/date.hpp"
#include "duckdb/common/types/timestamp.hpp"
#include "duckdb/common/vector_operations/unary_executor.hpp"
#include "duckdb/common/vector_operations/binary_executor.hpp"
#include "duckdb/execution/expression_executor.hpp"
#include "duckdb/plugin/physical/common/types/vector_operations/unary_executor.hpp"
#include "duckdb/plugin/physical/common/types/vector_operations/binary_executor.hpp"
#include "duckdb/plugin/physical/execution/expression_executor.hpp"
#include "duckdb/main/client_context.hpp"
#include "duckdb/parser/parsed_data/create_scalar_function_info.hpp"
#include "duckdb/planner/expression/bound_function_expression.hpp"
2 changes: 1 addition & 1 deletion extension/icu/icu-datetrunc.cpp
Original file line number Diff line number Diff line change
@@ -3,7 +3,7 @@

#include "duckdb/catalog/catalog_entry/scalar_function_catalog_entry.hpp"
#include "duckdb/common/types/timestamp.hpp"
#include "duckdb/common/vector_operations/binary_executor.hpp"
#include "duckdb/plugin/physical/common/types/vector_operations/binary_executor.hpp"
#include "duckdb/main/client_context.hpp"
#include "duckdb/parser/parsed_data/create_scalar_function_info.hpp"
#include "duckdb/planner/expression/bound_function_expression.hpp"
2 changes: 1 addition & 1 deletion extension/icu/icu-list-range.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include "duckdb/common/exception.hpp"
#include "duckdb/common/types/interval.hpp"
#include "duckdb/common/types/timestamp.hpp"
#include "duckdb/common/types/vector.hpp"
#include "duckdb/plugin/physical/common/types/vector/vector.hpp"
#include "duckdb/function/function_set.hpp"
#include "duckdb/function/scalar_function.hpp"
#include "duckdb/main/client_context.hpp"
4 changes: 2 additions & 2 deletions extension/icu/icu-makedate.cpp
Original file line number Diff line number Diff line change
@@ -4,8 +4,8 @@
#include "duckdb/common/types/date.hpp"
#include "duckdb/common/types/time.hpp"
#include "duckdb/common/types/timestamp.hpp"
#include "duckdb/common/vector_operations/senary_executor.hpp"
#include "duckdb/common/vector_operations/septenary_executor.hpp"
#include "duckdb/plugin/physical/common/types/vector_operations/senary_executor.hpp"
#include "duckdb/plugin/physical/common/types/vector_operations/septenary_executor.hpp"
#include "duckdb/function/cast/cast_function_set.hpp"
#include "duckdb/main/extension_util.hpp"
#include "duckdb/parser/parsed_data/create_scalar_function_info.hpp"
4 changes: 2 additions & 2 deletions extension/icu/icu-strptime.cpp
Original file line number Diff line number Diff line change
@@ -7,8 +7,8 @@
#include "duckdb/common/types/date.hpp"
#include "duckdb/common/types/time.hpp"
#include "duckdb/common/types/timestamp.hpp"
#include "duckdb/common/vector_operations/binary_executor.hpp"
#include "duckdb/execution/expression_executor.hpp"
#include "duckdb/plugin/physical/common/types/vector_operations/binary_executor.hpp"
#include "duckdb/plugin/physical/execution/expression_executor.hpp"
#include "duckdb/function/scalar/strftime_format.hpp"
#include "duckdb/main/client_context.hpp"
#include "duckdb/parser/parsed_data/create_scalar_function_info.hpp"
4 changes: 2 additions & 2 deletions extension/icu/icu-timebucket.cpp
Original file line number Diff line number Diff line change
@@ -7,8 +7,8 @@
#include "duckdb/common/types/timestamp.hpp"
#include "duckdb/common/types/value.hpp"
#include "duckdb/main/extension_util.hpp"
#include "duckdb/common/vector_operations/binary_executor.hpp"
#include "duckdb/common/vector_operations/ternary_executor.hpp"
#include "duckdb/plugin/physical/common/types/vector_operations/binary_executor.hpp"
#include "duckdb/plugin/physical/common/types/vector_operations/ternary_executor.hpp"
#include "duckdb/main/client_context.hpp"
#include "duckdb/parser/parsed_data/create_scalar_function_info.hpp"
#include "include/icu-datefunc.hpp"
2 changes: 1 addition & 1 deletion extension/icu/icu-timezone.cpp
Original file line number Diff line number Diff line change
@@ -6,7 +6,7 @@
#include "duckdb/parser/parsed_data/create_scalar_function_info.hpp"
#include "duckdb/parser/parsed_data/create_table_function_info.hpp"
#include "include/icu-datefunc.hpp"
#include "duckdb/transaction/meta_transaction.hpp"
#include "duckdb/plugin/physical/transaction/meta_transaction.hpp"

namespace duckdb {

4 changes: 2 additions & 2 deletions extension/icu/icu_extension.cpp
Original file line number Diff line number Diff line change
@@ -2,8 +2,8 @@

#include "duckdb/catalog/catalog.hpp"
#include "duckdb/common/string_util.hpp"
#include "duckdb/common/vector_operations/unary_executor.hpp"
#include "duckdb/execution/expression_executor.hpp"
#include "duckdb/plugin/physical/common/types/vector_operations/unary_executor.hpp"
#include "duckdb/plugin/physical/execution/expression_executor.hpp"
#include "duckdb/function/scalar_function.hpp"
#include "duckdb/main/config.hpp"
#include "duckdb/main/connection.hpp"
2 changes: 1 addition & 1 deletion extension/inet/inet_functions.cpp
Original file line number Diff line number Diff line change
@@ -4,7 +4,7 @@
#include "duckdb/common/pair.hpp"
#include "duckdb/common/operator/cast_operators.hpp"
#include "duckdb/common/types/cast_helpers.hpp"
#include "duckdb/common/vector_operations/generic_executor.hpp"
#include "duckdb/plugin/physical/common/types/vector_operations/generic_executor.hpp"

namespace duckdb {

2 changes: 1 addition & 1 deletion extension/jemalloc/jemalloc_extension.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#define DUCKDB_EXTENSION_MAIN
#include "jemalloc_extension.hpp"

#include "duckdb/common/allocator.hpp"
#include "duckdb/plugin/physical/common/allocator.hpp"
#include "jemalloc/jemalloc.h"

#ifndef DUCKDB_NO_THREADS
2 changes: 1 addition & 1 deletion extension/json/buffered_json_reader.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include "buffered_json_reader.hpp"

#include "duckdb/common/file_opener.hpp"
#include "duckdb/plugin/physical/common/file_system/file_opener.hpp"
#include "duckdb/common/serializer/deserializer.hpp"
#include "duckdb/common/serializer/serializer.hpp"

4 changes: 2 additions & 2 deletions extension/json/include/buffered_json_reader.hpp
Original file line number Diff line number Diff line change
@@ -11,8 +11,8 @@
#include "duckdb/common/atomic.hpp"
#include "duckdb/common/enum_util.hpp"
#include "duckdb/common/enums/file_compression_type.hpp"
#include "duckdb/common/file_system.hpp"
#include "duckdb/common/multi_file_reader.hpp"
#include "duckdb/plugin/physical/common/file_system/file_system.hpp"
#include "duckdb/plugin/physical/common/file_system/multi_file_reader.hpp"
#include "duckdb/common/mutex.hpp"
#include "json_common.hpp"
#include "json_enums.hpp"
2 changes: 1 addition & 1 deletion extension/json/include/json_executors.hpp
Original file line number Diff line number Diff line change
@@ -8,7 +8,7 @@

#pragma once

#include "duckdb/execution/expression_executor.hpp"
#include "duckdb/plugin/physical/execution/expression_executor.hpp"
#include "json_functions.hpp"

namespace duckdb {
2 changes: 1 addition & 1 deletion extension/json/include/json_scan.hpp
Original file line number Diff line number Diff line change
@@ -10,7 +10,7 @@

#include "buffered_json_reader.hpp"
#include "json_enums.hpp"
#include "duckdb/common/multi_file_reader.hpp"
#include "duckdb/plugin/physical/common/file_system/multi_file_reader.hpp"
#include "duckdb/common/mutex.hpp"
#include "duckdb/common/pair.hpp"
#include "duckdb/common/types/type_map.hpp"
4 changes: 2 additions & 2 deletions extension/json/json_functions.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include "json_functions.hpp"

#include "duckdb/common/file_system.hpp"
#include "duckdb/execution/expression_executor.hpp"
#include "duckdb/plugin/physical/common/file_system/file_system.hpp"
#include "duckdb/plugin/physical/execution/expression_executor.hpp"
#include "duckdb/function/cast/cast_function_set.hpp"
#include "duckdb/function/cast/default_casts.hpp"
#include "duckdb/function/replacement_scan.hpp"
4 changes: 2 additions & 2 deletions extension/json/json_functions/json_serialize_plan.cpp
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#include "duckdb/execution/expression_executor.hpp"
#include "duckdb/plugin/physical/execution/expression_executor.hpp"
#include "duckdb/parser/parsed_data/create_pragma_function_info.hpp"
#include "duckdb/parser/parser.hpp"
#include "duckdb/planner/planner.hpp"
#include "duckdb/optimizer/optimizer.hpp"
#include "duckdb/execution/column_binding_resolver.hpp"
#include "duckdb/plugin/physical/execution/column_binding_resolver.hpp"

#include "json_deserializer.hpp"
#include "json_functions.hpp"
2 changes: 1 addition & 1 deletion extension/json/json_functions/json_serialize_sql.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include "duckdb/execution/expression_executor.hpp"
#include "duckdb/plugin/physical/execution/expression_executor.hpp"
#include "duckdb/parser/parsed_data/create_pragma_function_info.hpp"
#include "duckdb/parser/parser.hpp"
#include "json_deserializer.hpp"
2 changes: 1 addition & 1 deletion extension/json/json_functions/json_transform.cpp
Original file line number Diff line number Diff line change
@@ -4,7 +4,7 @@
#include "duckdb/common/serializer/deserializer.hpp"
#include "duckdb/common/serializer/serializer.hpp"
#include "duckdb/common/types.hpp"
#include "duckdb/execution/expression_executor.hpp"
#include "duckdb/plugin/physical/execution/expression_executor.hpp"
#include "duckdb/function/cast/cast_function_set.hpp"
#include "duckdb/function/cast/default_casts.hpp"
#include "duckdb/function/scalar/nested_functions.hpp"
2 changes: 1 addition & 1 deletion extension/json/json_functions/read_json.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include "duckdb/common/multi_file_reader.hpp"
#include "duckdb/plugin/physical/common/file_system/multi_file_reader.hpp"
#include "json_functions.hpp"
#include "json_scan.hpp"
#include "json_structure.hpp"
6 changes: 3 additions & 3 deletions extension/json/json_scan.cpp
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
#include "json_scan.hpp"

#include "duckdb/common/enum_util.hpp"
#include "duckdb/common/multi_file_reader.hpp"
#include "duckdb/plugin/physical/common/file_system/multi_file_reader.hpp"
#include "duckdb/common/serializer/deserializer.hpp"
#include "duckdb/common/serializer/serializer.hpp"
#include "duckdb/main/extension_helper.hpp"
#include "duckdb/parallel/task_scheduler.hpp"
#include "duckdb/storage/buffer_manager.hpp"
#include "duckdb/plugin/physical/parallel/task_scheduler.hpp"
#include "duckdb/plugin/physical/storage/buffer_manager.hpp"

namespace duckdb {

2 changes: 1 addition & 1 deletion extension/parquet/column_reader.cpp
Original file line number Diff line number Diff line change
@@ -20,7 +20,7 @@
#ifndef DUCKDB_AMALGAMATION
#include "duckdb/common/types/bit.hpp"
#include "duckdb/common/types/blob.hpp"
#include "duckdb/common/types/chunk_collection.hpp"
#include "duckdb/plugin/physical/common/types/chunk_collection.hpp"
#endif

namespace duckdb {
4 changes: 2 additions & 2 deletions extension/parquet/column_writer.cpp
Original file line number Diff line number Diff line change
@@ -13,10 +13,10 @@
#include "duckdb/common/serializer/memory_stream.hpp"
#include "duckdb/common/serializer/write_stream.hpp"
#include "duckdb/common/string_map_set.hpp"
#include "duckdb/common/types/chunk_collection.hpp"
#include "duckdb/plugin/physical/common/types/chunk_collection.hpp"
#include "duckdb/common/types/date.hpp"
#include "duckdb/common/types/hugeint.hpp"
#include "duckdb/common/types/string_heap.hpp"
#include "duckdb/plugin/physical/common/types/string_heap.hpp"
#include "duckdb/common/types/time.hpp"
#include "duckdb/common/types/timestamp.hpp"
#endif
6 changes: 3 additions & 3 deletions extension/parquet/include/column_reader.hpp
Original file line number Diff line number Diff line change
@@ -19,10 +19,10 @@
#ifndef DUCKDB_AMALGAMATION

#include "duckdb/common/operator/cast_operators.hpp"
#include "duckdb/common/types/chunk_collection.hpp"
#include "duckdb/plugin/physical/common/types/chunk_collection.hpp"
#include "duckdb/common/types/string_type.hpp"
#include "duckdb/common/types/vector.hpp"
#include "duckdb/common/types/vector_cache.hpp"
#include "duckdb/plugin/physical/common/types/vector/vector.hpp"
#include "duckdb/plugin/physical/common/types/vector/vector_cache.hpp"
#endif

namespace duckdb {
2 changes: 1 addition & 1 deletion extension/parquet/include/parquet_crypto.hpp
Original file line number Diff line number Diff line change
@@ -11,7 +11,7 @@
#include "parquet_types.h"

#ifndef DUCKDB_AMALGAMATION
#include "duckdb/storage/object_cache.hpp"
#include "duckdb/plugin/physical/storage/object_cache.hpp"
#endif

namespace duckdb {
2 changes: 1 addition & 1 deletion extension/parquet/include/parquet_file_metadata_cache.hpp
Original file line number Diff line number Diff line change
@@ -9,7 +9,7 @@

#include "duckdb.hpp"
#ifndef DUCKDB_AMALGAMATION
#include "duckdb/storage/object_cache.hpp"
#include "duckdb/plugin/physical/storage/object_cache.hpp"
#endif
#include "parquet_types.h"

Loading