├── .github ├── .gitignore ├── versions-matrix.R └── workflows │ ├── pkgdown-build │ └── action.yml │ ├── roxygenize │ └── action.yml │ ├── custom │ └── before-install │ │ └── action.yml │ ├── git-identity │ └── action.yml │ ├── pkgdown-deploy │ └── action.yml │ ├── dep-suggests-matrix │ └── action.yml │ ├── rate-limit │ └── action.yml │ ├── versions-matrix │ └── action.yml │ ├── get-extra │ └── action.yml │ └── matrix-check │ └── action.yml ├── revdep ├── .gitignore ├── failures.md ├── README.md └── cran.md ├── src ├── duckdb │ ├── third_party │ │ ├── thrift │ │ │ └── thrift │ │ │ │ ├── stdcxx.h │ │ │ │ └── thrift_export.h │ │ ├── mbedtls │ │ │ ├── include │ │ │ │ ├── mbedtls │ │ │ │ │ ├── entropy.h │ │ │ │ │ ├── aria.h │ │ │ │ │ ├── sha512.h │ │ │ │ │ ├── camellia.h │ │ │ │ │ ├── cmac.h │ │ │ │ │ ├── md5.h │ │ │ │ │ ├── sha3.h │ │ │ │ │ ├── aes_alt.h │ │ │ │ │ ├── aria_alt.h │ │ │ │ │ ├── ccm_alt.h │ │ │ │ │ ├── chacha20.h │ │ │ │ │ ├── ecdsa.h │ │ │ │ │ ├── gcm_alt.h │ │ │ │ │ ├── nist_kw.h │ │ │ │ │ ├── pkcs12.h │ │ │ │ │ ├── pkcs5.h │ │ │ │ │ ├── psa_util.h │ │ │ │ │ ├── ripemd160.h │ │ │ │ │ ├── threading.h │ │ │ │ │ ├── timing.h │ │ │ │ │ ├── block_cipher.h │ │ │ │ │ ├── camellia_alt.h │ │ │ │ │ ├── chachapoly.h │ │ │ │ │ ├── config_psa.h │ │ │ │ │ ├── config_adjust_ssl.h │ │ │ │ │ ├── config_adjust_x509.h │ │ │ │ │ ├── config_adjust_legacy_crypto.h │ │ │ │ │ └── private_access.h │ │ │ │ ├── psa │ │ │ │ │ ├── crypto_se_driver.h │ │ │ │ │ ├── crypto.h │ │ │ │ │ ├── crypto_config.h │ │ │ │ │ └── build_info.h │ │ │ │ ├── des_alt.h │ │ │ │ ├── rsa_alt.h │ │ │ │ ├── platform_alt.h │ │ │ │ ├── sha1_alt.h │ │ │ │ ├── sha256_alt.h │ │ │ │ ├── sha512_alt.h │ │ │ │ └── ssl_misc.h │ │ │ └── library │ │ │ │ ├── aes_alt.h │ │ │ │ ├── ecp_alt.h │ │ │ │ ├── ccm_alt.h │ │ │ │ ├── gcm_alt.h │ │ │ │ ├── cipher_invasive.h │ │ │ │ └── md_psa.h │ │ ├── parquet │ │ │ └── windows_compatibility.h │ │ ├── snappy │ │ │ └── snappy_version.hpp │ │ ├── re2 │ │ │ └── util │ │ │ │ └── strutil.h │ │ └── brotli │ │ │ ├── enc │ │ │ └── dictionary_hash.h │ │ │ └── common │ │ │ └── platform.cpp │ ├── ub_src_common_crypto.cpp │ ├── ub_src_main_http.cpp │ ├── ub_src_function_cast_union.cpp │ ├── ub_src_function_scalar_date.cpp │ ├── ub_src_function_scalar_map.cpp │ ├── ub_src_function_scalar_sequence.cpp │ ├── ub_src_optimizer_matcher.cpp │ ├── ub_src_function_aggregate.cpp │ ├── ub_src_function_table_version.cpp │ ├── ub_src_execution_operator_filter.cpp │ ├── ub_extension_core_functions_scalar_bit.cpp │ ├── ub_extension_core_functions_scalar_math.cpp │ ├── ub_src_common_value_operations.cpp │ ├── ub_src_parser_transform_constraint.cpp │ ├── ub_extension_core_functions_scalar_debug.cpp │ ├── ub_extension_core_functions_scalar_enum.cpp │ ├── ub_extension_core_functions_scalar_operators.cpp │ ├── ub_src_common_adbc.cpp │ ├── ub_src_execution_operator_csv_scanner_encode.cpp │ ├── ub_src_main_capi_cast.cpp │ ├── ub_src_function_pragma.cpp │ ├── ub_src_main_settings.cpp │ ├── ub_src_execution_sample.cpp │ ├── ub_src_storage_compression_alp.cpp │ ├── ub_src_execution_operator_order.cpp │ ├── ub_src_main_chunk_scan_state.cpp │ ├── ub_extension_core_functions_scalar_blob.cpp │ ├── ub_extension_core_functions_scalar_random.cpp │ ├── ub_src_function_scalar_string_regexp.cpp │ ├── ub_src_execution_nested_loop_join.cpp │ ├── ub_extension_core_functions_scalar_array.cpp │ ├── ub_extension_core_functions_scalar_struct.cpp │ ├── ub_src_common_operator.cpp │ ├── ub_src_storage_metadata.cpp │ ├── src │ │ ├── function │ │ │ ├── aggregate_function.cpp │ │ │ ├── scalar │ │ │ │ └── pragma_functions.cpp │ │ │ └── cast │ │ │ │ └── pointer_cast.cpp │ │ ├── include │ │ │ ├── duckdb │ │ │ │ ├── function │ │ │ │ │ ├── cast │ │ │ │ │ │ └── nested_to_varchar_cast.hpp │ │ │ │ │ └── table │ │ │ │ │ │ ├── arrow │ │ │ │ │ │ └── enum │ │ │ │ │ │ │ ├── arrow_type_info_type.hpp │ │ │ │ │ │ │ ├── arrow_variable_size_type.hpp │ │ │ │ │ │ │ └── arrow_datetime_type.hpp │ │ │ │ │ │ ├── list.hpp │ │ │ │ │ │ └── summary.hpp │ │ │ │ ├── original │ │ │ │ │ └── std │ │ │ │ │ │ ├── locale.hpp │ │ │ │ │ │ ├── sstream.hpp │ │ │ │ │ │ └── memory.hpp │ │ │ │ ├── parser │ │ │ │ │ ├── query_node │ │ │ │ │ │ └── list.hpp │ │ │ │ │ ├── constraints │ │ │ │ │ │ └── list.hpp │ │ │ │ │ ├── tableref │ │ │ │ │ │ └── list.hpp │ │ │ │ │ └── parser_options.hpp │ │ │ │ ├── planner │ │ │ │ │ ├── query_node │ │ │ │ │ │ └── list.hpp │ │ │ │ │ ├── constraints │ │ │ │ │ │ └── list.hpp │ │ │ │ │ └── filter │ │ │ │ │ │ └── list.hpp │ │ │ │ ├── common │ │ │ │ │ ├── windows.hpp │ │ │ │ │ ├── memory_safety.hpp │ │ │ │ │ ├── algorithm.hpp │ │ │ │ │ ├── to_string.hpp │ │ │ │ │ ├── exception │ │ │ │ │ │ └── list.hpp │ │ │ │ │ ├── list.hpp │ │ │ │ │ ├── array.hpp │ │ │ │ │ ├── deque.hpp │ │ │ │ │ ├── stack.hpp │ │ │ │ │ ├── swap.hpp │ │ │ │ │ ├── bitset.hpp │ │ │ │ │ ├── thread.hpp │ │ │ │ │ ├── queue.hpp │ │ │ │ │ ├── unordered_map.hpp │ │ │ │ │ ├── unordered_set.hpp │ │ │ │ │ ├── map.hpp │ │ │ │ │ ├── set.hpp │ │ │ │ │ ├── common.hpp │ │ │ │ │ ├── pair.hpp │ │ │ │ │ ├── enums │ │ │ │ │ │ ├── set_type.hpp │ │ │ │ │ │ ├── collation_type.hpp │ │ │ │ │ │ ├── copy_option_mode.hpp │ │ │ │ │ │ ├── thread_pin_mode.hpp │ │ │ │ │ │ ├── explain_format.hpp │ │ │ │ │ │ ├── output_type.hpp │ │ │ │ │ │ ├── access_mode.hpp │ │ │ │ │ │ ├── on_entry_not_found.hpp │ │ │ │ │ │ ├── ordinality_request_type.hpp │ │ │ │ │ │ ├── preserve_order.hpp │ │ │ │ │ │ ├── profiler_format.hpp │ │ │ │ │ │ ├── debug_initialize.hpp │ │ │ │ │ │ ├── prepared_statement_mode.hpp │ │ │ │ │ │ ├── set_operation_type.hpp │ │ │ │ │ │ ├── set_scope.hpp │ │ │ │ │ │ ├── function_errors.hpp │ │ │ │ │ │ ├── quantile_enum.hpp │ │ │ │ │ │ ├── scan_vector_type.hpp │ │ │ │ │ │ ├── checkpoint_abort.hpp │ │ │ │ │ │ ├── pending_execution_result.hpp │ │ │ │ │ │ ├── copy_overwrite_mode.hpp │ │ │ │ │ │ ├── cte_materialize.hpp │ │ │ │ │ │ ├── filter_propagate_result.hpp │ │ │ │ │ │ ├── stream_execution_result.hpp │ │ │ │ │ │ ├── debug_vector_verification.hpp │ │ │ │ │ │ └── undo_flags.hpp │ │ │ │ │ ├── mutex.hpp │ │ │ │ │ ├── arrow │ │ │ │ │ │ └── nanoarrow │ │ │ │ │ │ │ └── nanoarrow.hpp │ │ │ │ │ ├── checksum.hpp │ │ │ │ │ ├── fstream.hpp │ │ │ │ │ ├── sorting │ │ │ │ │ │ └── sort_projection_column.hpp │ │ │ │ │ ├── adbc │ │ │ │ │ │ └── wrappers.hpp │ │ │ │ │ ├── named_parameter_map.hpp │ │ │ │ │ ├── types │ │ │ │ │ │ └── sel_cache.hpp │ │ │ │ │ ├── likely.hpp │ │ │ │ │ ├── progress_bar │ │ │ │ │ │ └── progress_bar_display.hpp │ │ │ │ │ ├── cgroups.hpp │ │ │ │ │ └── enum_class_hash.hpp │ │ │ │ ├── main │ │ │ │ │ └── extension_util.hpp │ │ │ │ ├── storage │ │ │ │ │ ├── compression │ │ │ │ │ │ ├── patas │ │ │ │ │ │ │ └── shared.hpp │ │ │ │ │ │ └── bitpacking.hpp │ │ │ │ │ └── table │ │ │ │ │ │ ├── update_state.hpp │ │ │ │ │ │ ├── column_segment_tree.hpp │ │ │ │ │ │ └── delete_state.hpp │ │ │ │ ├── catalog │ │ │ │ │ └── catalog_entry │ │ │ │ │ │ └── table_column_type.hpp │ │ │ │ ├── transaction │ │ │ │ │ └── append_info.hpp │ │ │ │ └── optimizer │ │ │ │ │ └── regex_range_filter.hpp │ │ │ └── duckdb.hpp │ │ ├── planner │ │ │ ├── operator │ │ │ │ ├── logical_set.cpp │ │ │ │ ├── logical_reset.cpp │ │ │ │ ├── logical_pragma.cpp │ │ │ │ ├── logical_prepare.cpp │ │ │ │ ├── logical_any_join.cpp │ │ │ │ ├── logical_delim_get.cpp │ │ │ │ ├── logical_dummy_scan.cpp │ │ │ │ ├── logical_set_operation.cpp │ │ │ │ ├── logical_expression_get.cpp │ │ │ │ ├── logical_materialized_cte.cpp │ │ │ │ ├── logical_simple.cpp │ │ │ │ └── logical_top_n.cpp │ │ │ └── binder │ │ │ │ ├── tableref │ │ │ │ ├── plan_basetableref.cpp │ │ │ │ ├── bind_emptytableref.cpp │ │ │ │ ├── plan_dummytableref.cpp │ │ │ │ ├── bind_bound_table_ref.cpp │ │ │ │ ├── plan_delimgetref.cpp │ │ │ │ ├── plan_pivotref.cpp │ │ │ │ ├── plan_cteref.cpp │ │ │ │ ├── bind_delimgetref.cpp │ │ │ │ ├── plan_subqueryref.cpp │ │ │ │ └── plan_column_data_ref.cpp │ │ │ │ ├── expression │ │ │ │ └── bind_constant_expression.cpp │ │ │ │ └── statement │ │ │ │ ├── bind_select.cpp │ │ │ │ └── bind_relation.cpp │ │ ├── storage │ │ │ ├── compression │ │ │ │ ├── chimp │ │ │ │ │ ├── bit_reader.cpp │ │ │ │ │ ├── flag_buffer.cpp │ │ │ │ │ ├── leading_zero_buffer.cpp │ │ │ │ │ └── chimp_constants.cpp │ │ │ │ ├── alp │ │ │ │ │ └── alp_constants.cpp │ │ │ │ └── empty_validity.cpp │ │ │ ├── table │ │ │ │ └── persistent_table_data.cpp │ │ │ ├── statistics │ │ │ │ └── segment_statistics.cpp │ │ │ └── index.cpp │ │ ├── transaction │ │ │ └── transaction_manager.cpp │ │ ├── common │ │ │ ├── tree_renderer │ │ │ │ └── tree_renderer.cpp │ │ │ ├── assert.cpp │ │ │ ├── types │ │ │ │ ├── conflict_info.cpp │ │ │ │ └── vector_constants.cpp │ │ │ └── arrow │ │ │ │ └── appender │ │ │ │ └── null_data.cpp │ │ ├── execution │ │ │ ├── operator │ │ │ │ ├── scan │ │ │ │ │ ├── physical_empty_result.cpp │ │ │ │ │ └── physical_dummy_scan.cpp │ │ │ │ └── helper │ │ │ │ │ ├── physical_pragma.cpp │ │ │ │ │ └── physical_prepare.cpp │ │ │ └── physical_plan │ │ │ │ ├── plan_reset.cpp │ │ │ │ ├── plan_pragma.cpp │ │ │ │ ├── plan_create_secret.cpp │ │ │ │ ├── plan_dummy_scan.cpp │ │ │ │ ├── plan_copy_database.cpp │ │ │ │ ├── plan_empty_result.cpp │ │ │ │ ├── plan_pivot.cpp │ │ │ │ ├── plan_cross_product.cpp │ │ │ │ ├── plan_unnest.cpp │ │ │ │ ├── plan_delim_get.cpp │ │ │ │ └── plan_column_data_get.cpp │ │ ├── parser │ │ │ ├── constraint.cpp │ │ │ ├── tableref │ │ │ │ └── emptytableref.cpp │ │ │ ├── transform │ │ │ │ └── statement │ │ │ │ │ ├── transform_call.cpp │ │ │ │ │ ├── transform_import.cpp │ │ │ │ │ └── transform_detach.cpp │ │ │ ├── constraints │ │ │ │ ├── not_null_constraint.cpp │ │ │ │ └── check_constraint.cpp │ │ │ ├── statement │ │ │ │ ├── load_statement.cpp │ │ │ │ ├── alter_statement.cpp │ │ │ │ ├── attach_statement.cpp │ │ │ │ ├── create_statement.cpp │ │ │ │ ├── detach_statement.cpp │ │ │ │ ├── copy_statement.cpp │ │ │ │ ├── drop_statement.cpp │ │ │ │ ├── pragma_statement.cpp │ │ │ │ ├── relation_statement.cpp │ │ │ │ ├── extension_statement.cpp │ │ │ │ └── vacuum_statement.cpp │ │ │ └── parsed_data │ │ │ │ ├── create_copy_function_info.cpp │ │ │ │ └── extra_drop_info.cpp │ │ ├── parallel │ │ │ ├── base_pipeline_event.cpp │ │ │ ├── pipeline_complete_event.cpp │ │ │ └── task_notifier.cpp │ │ ├── catalog │ │ │ └── catalog_entry │ │ │ │ ├── copy_function_catalog_entry.cpp │ │ │ │ └── pragma_function_catalog_entry.cpp │ │ └── optimizer │ │ │ └── statistics │ │ │ └── expression │ │ │ └── propagate_columnref.cpp │ ├── ub_src_function_cast_variant.cpp │ ├── ub_src_function_scalar_generic.cpp │ ├── ub_src_main_buffered_data.cpp │ ├── ub_src_function_scalar_compressed_materialization.cpp │ ├── ub_src_execution_operator_set.cpp │ ├── ub_src_function_scalar_variant.cpp │ ├── ub_src_function_table_arrow.cpp │ ├── ub_src_main_secret.cpp │ ├── ub_src_common_progress_bar.cpp │ ├── ub_src_common_sorting.cpp │ ├── ub_src_execution_operator_csv_scanner_state_machine.cpp │ ├── ub_src_function_aggregate_distributive.cpp │ ├── ub_src_storage_compression_dict_fsst.cpp │ ├── ub_src_logging.cpp │ ├── ub_extension_core_functions_scalar_union.cpp │ ├── ub_src_parser_query_node.cpp │ ├── ub_extension_parquet_reader_variant.cpp │ ├── ub_extension_core_functions_aggregate_nested.cpp │ ├── ub_src_common_exception.cpp │ ├── ub_src_execution_operator_csv_scanner_util.cpp │ ├── ub_src_function_scalar_operator.cpp │ ├── ub_src_common_adbc_nanoarrow.cpp │ ├── ub_src_catalog_catalog_entry_dependency.cpp │ ├── ub_src_parser_constraints.cpp │ ├── ub_src_storage_checkpoint.cpp │ ├── ub_src_planner_subquery.cpp │ ├── ub_src_storage_compression_dictionary.cpp │ ├── ub_src_execution_operator_csv_scanner_buffer_manager.cpp │ ├── ub_src_execution_operator_csv_scanner_table_function.cpp │ ├── ub_src_storage_buffer.cpp │ ├── ub_src_execution_index.cpp │ ├── ub_extension_core_functions_aggregate_algebraic.cpp │ ├── ub_src_common_sort.cpp │ ├── ub_src_execution_operator_projection.cpp │ ├── ub_src_optimizer_pullup.cpp │ ├── ub_src_function_scalar.cpp │ ├── ub_src_function_scalar_list.cpp │ ├── ub_src_storage_compression_roaring.cpp │ ├── ub_src_function_scalar_struct.cpp │ ├── ub_src_storage_compression_chimp.cpp │ ├── ub_src_optimizer_compressed_materialization.cpp │ ├── ub_src_common_types_column.cpp │ ├── ub_src_catalog_default.cpp │ ├── ub_src_common_arrow_appender.cpp │ ├── ub_src_common_serializer.cpp │ ├── ub_src_common_multi_file.cpp │ ├── ub_src_common_tree_renderer.cpp │ ├── ub_src_function_scalar_system.cpp │ ├── ub_extension_parquet_decoder.cpp │ ├── extension │ │ ├── parquet │ │ │ └── include │ │ │ │ ├── parquet_float16.hpp │ │ │ │ └── parquet_extension.hpp │ │ └── core_functions │ │ │ ├── include │ │ │ ├── core_functions │ │ │ │ └── function_list.hpp │ │ │ └── core_functions_extension.hpp │ │ │ ├── aggregate │ │ │ └── algebraic │ │ │ │ └── corr.cpp │ │ │ └── scalar │ │ │ └── generic │ │ │ └── hash.cpp │ ├── ub_src_execution_operator_scan.cpp │ ├── ub_src_planner_filter.cpp │ ├── ub_extension_parquet_writer.cpp │ ├── ub_extension_core_functions_aggregate_holistic.cpp │ ├── ub_src_parser_transform_helpers.cpp │ ├── ub_extension_parquet_reader.cpp │ ├── ub_extension_core_functions_scalar_map.cpp │ ├── ub_src_common_row_operations.cpp │ ├── ub_src_execution_operator_csv_scanner_scanner.cpp │ ├── ub_src_parser_transform_tableref.cpp │ ├── ub_src_storage_statistics.cpp │ ├── ub_extension_core_functions_aggregate_regression.cpp │ ├── ub_src_common_arrow.cpp │ ├── ub_src_execution_operator_csv_scanner_sniffer.cpp │ ├── ub_src_catalog.cpp │ ├── ub_src_common_types_row.cpp │ ├── ub_src_execution.cpp │ └── ub_src_optimizer_join_order.cpp ├── signal.dd ├── rfuns.dd ├── librstrtmgr.a.gz ├── cpp11.dd ├── convert.dd ├── database.dd ├── scan.dd ├── types.dd ├── transform.dd ├── connection.dd ├── register.dd ├── utils.dd ├── statement.dd ├── include │ ├── glue.mk │ ├── deps.mk │ ├── from-tar.mk │ ├── to-tar.mk │ ├── to-tar-win.mk │ └── r_progress_bar_display.hpp ├── relational.dd ├── altrepdataframe_relation.dd └── reltoaltrep.dd ├── .gitattributes ├── .clangd ├── LICENSE ├── inst ├── icons │ └── duckdb.png ├── rstudio │ ├── connections.dcf │ └── connections │ │ └── DuckDB.R └── include │ ├── duckdb_types.hpp │ └── cpp11 │ └── altrep.hpp ├── man ├── figures │ └── logo.png ├── duckdb_explain-class.Rd └── deprecated.Rd ├── tests ├── testthat.R └── testthat │ ├── data │ ├── userdata1.parquet │ └── binary_string.parquet │ ├── test-null_byte.R │ ├── test-duckdb-extensions.R │ ├── test-fetch.R │ ├── test-ambiguous_prepare.R │ ├── helper-arrow.R │ ├── test-extension_path.R │ ├── test-rfuns.R │ ├── test-date.R │ ├── test-register_readonly.R │ ├── test-dbinfo.R │ ├── test-dbwritetable.R │ └── helper-skip.R ├── R ├── re2.R ├── release.R ├── cpp12.R ├── duckdb-package.R ├── version.R ├── dbIsValid__duckdb_result.R ├── show__duckdb_driver.R ├── dbDataType__duckdb_connection.R ├── dbCommit__duckdb_connection.R ├── dbBegin__duckdb_connection.R ├── dbRollback__duckdb_connection.R ├── dbGetRowCount__duckdb_result.R ├── dbGetStatement__duckdb_result.R ├── show__duckdb_connection.R ├── show__duckdb_result.R ├── dbGetInfo__duckdb_result.R ├── dbListTables__duckdb_connection.R ├── dbColumnInfo__duckdb_result.R ├── dbClearResult__duckdb_result.R ├── dbGetRowsAffected__duckdb_result.R ├── is_interactive.R ├── dbListFields__duckdb_connection_character.R ├── dbIsValid__duckdb_connection.R ├── print__duckdb_explain.R ├── dbHasCompleted__duckdb_result.R ├── dbGetInfo__duckdb_driver.R ├── rethrow.R ├── dbRemoveTable__duckdb_connection_character.R └── dbGetInfo__duckdb_connection.R ├── docker ├── r-debug-strictbarrier.sh ├── r-debug-threadcheck.sh ├── Dockerfile.r-debug-threadcheck ├── Dockerfile.r-debug-strictbarrier └── deps.R ├── pkgdown └── favicon │ ├── favicon.ico │ ├── favicon-16x16.png │ ├── favicon-32x32.png │ ├── apple-touch-icon.png │ ├── mstile-150x150.png │ ├── android-chrome-192x192.png │ ├── android-chrome-384x384.png │ ├── android-chrome-512x512.png │ └── safari-pinned-tab.svg ├── cran-comments.md ├── .Rprofile ├── CMakeLists.txt ├── cleanup.win ├── cleanup ├── duckdb.Rproj ├── Makefile └── scripts └── python_helpers.py /.github/.gitignore: -------------------------------------------------------------------------------- 1 | /pkg.lock 2 | -------------------------------------------------------------------------------- /revdep/.gitignore: -------------------------------------------------------------------------------- 1 | /cloud.noindex/ 2 | -------------------------------------------------------------------------------- /revdep/failures.md: -------------------------------------------------------------------------------- 1 | *Wow, no problems at all. :)* -------------------------------------------------------------------------------- /src/duckdb/third_party/thrift/thrift/stdcxx.h: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | src/duckdb/** linguist-vendored 2 | -------------------------------------------------------------------------------- /.clangd: -------------------------------------------------------------------------------- 1 | Diagnostics: 2 | Suppress: unused-includes 3 | -------------------------------------------------------------------------------- /src/duckdb/third_party/mbedtls/include/mbedtls/entropy.h: -------------------------------------------------------------------------------- 1 | // 2 | -------------------------------------------------------------------------------- /src/duckdb/third_party/mbedtls/library/aes_alt.h: -------------------------------------------------------------------------------- 1 | // dummy 2 | -------------------------------------------------------------------------------- /src/duckdb/third_party/mbedtls/library/ecp_alt.h: -------------------------------------------------------------------------------- 1 | // dummy 2 | -------------------------------------------------------------------------------- /src/duckdb/third_party/mbedtls/include/mbedtls/aria.h: -------------------------------------------------------------------------------- 1 | // dummy 2 | -------------------------------------------------------------------------------- /src/duckdb/third_party/mbedtls/include/mbedtls/sha512.h: -------------------------------------------------------------------------------- 1 | // dummy 2 | -------------------------------------------------------------------------------- /src/duckdb/third_party/mbedtls/library/ccm_alt.h: -------------------------------------------------------------------------------- 1 | // dummy file 2 | -------------------------------------------------------------------------------- /src/duckdb/third_party/mbedtls/library/gcm_alt.h: -------------------------------------------------------------------------------- 1 | // dummy file 2 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | YEAR: 2018 2 | COPYRIGHT HOLDER: Stichting DuckDB Foundation 3 | -------------------------------------------------------------------------------- /src/duckdb/third_party/mbedtls/include/mbedtls/camellia.h: -------------------------------------------------------------------------------- 1 | // dummy 2 | -------------------------------------------------------------------------------- /src/duckdb/third_party/mbedtls/library/cipher_invasive.h: -------------------------------------------------------------------------------- 1 | // dummy file 2 | -------------------------------------------------------------------------------- /src/signal.dd: -------------------------------------------------------------------------------- 1 | signal.o: \ 2 | include/signal.hpp \ 3 | signal.cpp \ 4 | -------------------------------------------------------------------------------- /src/duckdb/third_party/mbedtls/include/psa/crypto_se_driver.h: -------------------------------------------------------------------------------- 1 | // dummy file 2 | -------------------------------------------------------------------------------- /src/duckdb/ub_src_common_crypto.cpp: -------------------------------------------------------------------------------- 1 | #include "src/common/crypto/md5.cpp" 2 | 3 | -------------------------------------------------------------------------------- /src/duckdb/ub_src_main_http.cpp: -------------------------------------------------------------------------------- 1 | #include "src/main/http/http_util.cpp" 2 | 3 | -------------------------------------------------------------------------------- /src/rfuns.dd: -------------------------------------------------------------------------------- 1 | rfuns.o: \ 2 | include/rfuns_extension.hpp \ 3 | rfuns.cpp \ 4 | -------------------------------------------------------------------------------- /inst/icons/duckdb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/duckdb/duckdb-r/HEAD/inst/icons/duckdb.png -------------------------------------------------------------------------------- /man/figures/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/duckdb/duckdb-r/HEAD/man/figures/logo.png -------------------------------------------------------------------------------- /src/duckdb/third_party/mbedtls/include/des_alt.h: -------------------------------------------------------------------------------- 1 | // dummy file to make amalgamation happy 2 | -------------------------------------------------------------------------------- /src/duckdb/third_party/mbedtls/include/rsa_alt.h: -------------------------------------------------------------------------------- 1 | // dummy file to make amalgamation happy 2 | -------------------------------------------------------------------------------- /src/duckdb/third_party/mbedtls/library/md_psa.h: -------------------------------------------------------------------------------- 1 | // dummy file to make amalgamation happy 2 | -------------------------------------------------------------------------------- /src/librstrtmgr.a.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/duckdb/duckdb-r/HEAD/src/librstrtmgr.a.gz -------------------------------------------------------------------------------- /tests/testthat.R: -------------------------------------------------------------------------------- 1 | library("testthat") 2 | library("DBI") 3 | 4 | test_check("duckdb") 5 | -------------------------------------------------------------------------------- /R/re2.R: -------------------------------------------------------------------------------- 1 | # Set to TRUE to run tests that have triggered re2 in the past 2 | TEST_RE2 <- FALSE 3 | -------------------------------------------------------------------------------- /src/cpp11.dd: -------------------------------------------------------------------------------- 1 | cpp11.o: \ 2 | cpp11.cpp \ 3 | include/convert.hpp \ 4 | include/rapi.hpp \ 5 | -------------------------------------------------------------------------------- /src/duckdb/third_party/mbedtls/include/mbedtls/cmac.h: -------------------------------------------------------------------------------- 1 | // dummy file to make amalgamation happy 2 | -------------------------------------------------------------------------------- /src/duckdb/third_party/mbedtls/include/mbedtls/md5.h: -------------------------------------------------------------------------------- 1 | // dummy file to make amalgamation happy 2 | -------------------------------------------------------------------------------- /src/duckdb/third_party/mbedtls/include/mbedtls/sha3.h: -------------------------------------------------------------------------------- 1 | // dummy file to make amalgamation happy 2 | -------------------------------------------------------------------------------- /src/duckdb/third_party/mbedtls/include/platform_alt.h: -------------------------------------------------------------------------------- 1 | // dummy file to make amalgamation happy 2 | -------------------------------------------------------------------------------- /src/duckdb/third_party/mbedtls/include/psa/crypto.h: -------------------------------------------------------------------------------- 1 | // dummy file to make amalgamation happy 2 | -------------------------------------------------------------------------------- /src/duckdb/third_party/mbedtls/include/sha1_alt.h: -------------------------------------------------------------------------------- 1 | // dummy file to make amalgamation happy 2 | -------------------------------------------------------------------------------- /src/duckdb/third_party/mbedtls/include/sha256_alt.h: -------------------------------------------------------------------------------- 1 | // dummy file to make amalgamation happy 2 | -------------------------------------------------------------------------------- /src/duckdb/third_party/mbedtls/include/sha512_alt.h: -------------------------------------------------------------------------------- 1 | // dummy file to make amalgamation happy 2 | -------------------------------------------------------------------------------- /src/duckdb/third_party/mbedtls/include/ssl_misc.h: -------------------------------------------------------------------------------- 1 | // dummy file to make amalgamation happy 2 | -------------------------------------------------------------------------------- /src/duckdb/third_party/mbedtls/include/mbedtls/aes_alt.h: -------------------------------------------------------------------------------- 1 | // dummy file to make amalgamation happy 2 | -------------------------------------------------------------------------------- /src/duckdb/third_party/mbedtls/include/mbedtls/aria_alt.h: -------------------------------------------------------------------------------- 1 | // dummy file to make amalgamation happy 2 | -------------------------------------------------------------------------------- /src/duckdb/third_party/mbedtls/include/mbedtls/ccm_alt.h: -------------------------------------------------------------------------------- 1 | // dummy file to make amalgamation happy 2 | -------------------------------------------------------------------------------- /src/duckdb/third_party/mbedtls/include/mbedtls/chacha20.h: -------------------------------------------------------------------------------- 1 | // dummy file to make amalgamation happy 2 | -------------------------------------------------------------------------------- /src/duckdb/third_party/mbedtls/include/mbedtls/ecdsa.h: -------------------------------------------------------------------------------- 1 | // dummy file to make amalgamation happy 2 | -------------------------------------------------------------------------------- /src/duckdb/third_party/mbedtls/include/mbedtls/gcm_alt.h: -------------------------------------------------------------------------------- 1 | // dummy file to make amalgamation happy 2 | -------------------------------------------------------------------------------- /src/duckdb/third_party/mbedtls/include/mbedtls/nist_kw.h: -------------------------------------------------------------------------------- 1 | // dummy file to make amalgamation happy 2 | -------------------------------------------------------------------------------- /src/duckdb/third_party/mbedtls/include/mbedtls/pkcs12.h: -------------------------------------------------------------------------------- 1 | // dummy file to make amalgamation happy 2 | -------------------------------------------------------------------------------- /src/duckdb/third_party/mbedtls/include/mbedtls/pkcs5.h: -------------------------------------------------------------------------------- 1 | // dummy file to make amalgamation happy 2 | -------------------------------------------------------------------------------- /src/duckdb/third_party/mbedtls/include/mbedtls/psa_util.h: -------------------------------------------------------------------------------- 1 | // dummy file to make amalgamation happy 2 | -------------------------------------------------------------------------------- /src/duckdb/third_party/mbedtls/include/mbedtls/ripemd160.h: -------------------------------------------------------------------------------- 1 | // dummy file to make amalgamation happy 2 | -------------------------------------------------------------------------------- /src/duckdb/third_party/mbedtls/include/mbedtls/threading.h: -------------------------------------------------------------------------------- 1 | // dummy file to make amalgamation happy 2 | -------------------------------------------------------------------------------- /src/duckdb/third_party/mbedtls/include/mbedtls/timing.h: -------------------------------------------------------------------------------- 1 | // dummy file to make amalgamation happy 2 | -------------------------------------------------------------------------------- /src/duckdb/third_party/mbedtls/include/psa/crypto_config.h: -------------------------------------------------------------------------------- 1 | // dummy file to make amalgamation happy 2 | -------------------------------------------------------------------------------- /src/duckdb/ub_src_function_cast_union.cpp: -------------------------------------------------------------------------------- 1 | #include "src/function/cast/union/from_struct.cpp" 2 | 3 | -------------------------------------------------------------------------------- /src/duckdb/ub_src_function_scalar_date.cpp: -------------------------------------------------------------------------------- 1 | #include "src/function/scalar/date/strftime.cpp" 2 | 3 | -------------------------------------------------------------------------------- /src/duckdb/ub_src_function_scalar_map.cpp: -------------------------------------------------------------------------------- 1 | #include "src/function/scalar/map/map_contains.cpp" 2 | 3 | -------------------------------------------------------------------------------- /docker/r-debug-strictbarrier.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | cd `dirname $0` 4 | 5 | RDstrictbarrier -q -f deps.R 6 | -------------------------------------------------------------------------------- /docker/r-debug-threadcheck.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | cd `dirname $0` 4 | 5 | RDthreadcheck -q -f deps.R 6 | -------------------------------------------------------------------------------- /pkgdown/favicon/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/duckdb/duckdb-r/HEAD/pkgdown/favicon/favicon.ico -------------------------------------------------------------------------------- /src/convert.dd: -------------------------------------------------------------------------------- 1 | convert.o: \ 2 | convert.cpp \ 3 | include/convert.hpp \ 4 | include/rapi.hpp \ 5 | -------------------------------------------------------------------------------- /src/database.dd: -------------------------------------------------------------------------------- 1 | database.o: \ 2 | database.cpp \ 3 | include/convert.hpp \ 4 | include/rapi.hpp \ 5 | -------------------------------------------------------------------------------- /src/duckdb/third_party/mbedtls/include/mbedtls/block_cipher.h: -------------------------------------------------------------------------------- 1 | // dummy file to make amalgamation happy 2 | -------------------------------------------------------------------------------- /src/duckdb/third_party/mbedtls/include/mbedtls/camellia_alt.h: -------------------------------------------------------------------------------- 1 | // dummy file to make amalgamation happy 2 | -------------------------------------------------------------------------------- /src/duckdb/third_party/mbedtls/include/mbedtls/chachapoly.h: -------------------------------------------------------------------------------- 1 | // dummy file to make amalgamation happy 2 | -------------------------------------------------------------------------------- /src/duckdb/third_party/mbedtls/include/mbedtls/config_psa.h: -------------------------------------------------------------------------------- 1 | // dummy file to make amalgamation happy 2 | -------------------------------------------------------------------------------- /src/duckdb/ub_src_function_scalar_sequence.cpp: -------------------------------------------------------------------------------- 1 | #include "src/function/scalar/sequence/nextval.cpp" 2 | 3 | -------------------------------------------------------------------------------- /src/duckdb/ub_src_optimizer_matcher.cpp: -------------------------------------------------------------------------------- 1 | #include "src/optimizer/matcher/expression_matcher.cpp" 2 | 3 | -------------------------------------------------------------------------------- /src/duckdb/third_party/mbedtls/include/mbedtls/config_adjust_ssl.h: -------------------------------------------------------------------------------- 1 | // dummy file to make amalgamation happy 2 | -------------------------------------------------------------------------------- /src/duckdb/third_party/mbedtls/include/mbedtls/config_adjust_x509.h: -------------------------------------------------------------------------------- 1 | // dummy file to make amalgamation happy 2 | -------------------------------------------------------------------------------- /src/duckdb/ub_src_function_aggregate.cpp: -------------------------------------------------------------------------------- 1 | #include "src/function/aggregate/sorted_aggregate_function.cpp" 2 | 3 | -------------------------------------------------------------------------------- /src/duckdb/ub_src_function_table_version.cpp: -------------------------------------------------------------------------------- 1 | #include "src/function/table/version/pragma_version.cpp" 2 | 3 | -------------------------------------------------------------------------------- /inst/rstudio/connections.dcf: -------------------------------------------------------------------------------- 1 | Name: DuckDB 2 | Icon: icons/duckdb.png 3 | HelpUrl: https://duckdb.org/docs/api/r 4 | -------------------------------------------------------------------------------- /pkgdown/favicon/favicon-16x16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/duckdb/duckdb-r/HEAD/pkgdown/favicon/favicon-16x16.png -------------------------------------------------------------------------------- /pkgdown/favicon/favicon-32x32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/duckdb/duckdb-r/HEAD/pkgdown/favicon/favicon-32x32.png -------------------------------------------------------------------------------- /src/duckdb/ub_src_execution_operator_filter.cpp: -------------------------------------------------------------------------------- 1 | #include "src/execution/operator/filter/physical_filter.cpp" 2 | 3 | -------------------------------------------------------------------------------- /cran-comments.md: -------------------------------------------------------------------------------- 1 | duckdb 1.4.3 2 | 3 | ## Cran Repository Policy 4 | 5 | - [x] Reviewed CRP last edited 2024-08-27. 6 | -------------------------------------------------------------------------------- /pkgdown/favicon/apple-touch-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/duckdb/duckdb-r/HEAD/pkgdown/favicon/apple-touch-icon.png -------------------------------------------------------------------------------- /pkgdown/favicon/mstile-150x150.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/duckdb/duckdb-r/HEAD/pkgdown/favicon/mstile-150x150.png -------------------------------------------------------------------------------- /src/duckdb/third_party/mbedtls/include/mbedtls/config_adjust_legacy_crypto.h: -------------------------------------------------------------------------------- 1 | // dummy file to make amalgamation happy 2 | -------------------------------------------------------------------------------- /src/duckdb/ub_extension_core_functions_scalar_bit.cpp: -------------------------------------------------------------------------------- 1 | #include "extension/core_functions/scalar/bit/bitstring.cpp" 2 | 3 | -------------------------------------------------------------------------------- /src/duckdb/ub_extension_core_functions_scalar_math.cpp: -------------------------------------------------------------------------------- 1 | #include "extension/core_functions/scalar/math/numeric.cpp" 2 | 3 | -------------------------------------------------------------------------------- /src/duckdb/ub_src_common_value_operations.cpp: -------------------------------------------------------------------------------- 1 | #include "src/common/value_operations/comparison_operations.cpp" 2 | 3 | -------------------------------------------------------------------------------- /src/scan.dd: -------------------------------------------------------------------------------- 1 | scan.o: \ 2 | include/convert.hpp \ 3 | include/rapi.hpp \ 4 | include/typesr.hpp \ 5 | scan.cpp \ 6 | -------------------------------------------------------------------------------- /.github/versions-matrix.R: -------------------------------------------------------------------------------- 1 | # Add even earlier Windows versions 2 | data.frame(os = "windows-latest", r = r_versions[4:6]) 3 | -------------------------------------------------------------------------------- /src/duckdb/ub_src_parser_transform_constraint.cpp: -------------------------------------------------------------------------------- 1 | #include "src/parser/transform/constraint/transform_constraint.cpp" 2 | 3 | -------------------------------------------------------------------------------- /src/types.dd: -------------------------------------------------------------------------------- 1 | types.o: \ 2 | include/convert.hpp \ 3 | include/rapi.hpp \ 4 | include/typesr.hpp \ 5 | types.cpp \ 6 | -------------------------------------------------------------------------------- /tests/testthat/data/userdata1.parquet: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/duckdb/duckdb-r/HEAD/tests/testthat/data/userdata1.parquet -------------------------------------------------------------------------------- /src/duckdb/ub_extension_core_functions_scalar_debug.cpp: -------------------------------------------------------------------------------- 1 | #include "extension/core_functions/scalar/debug/vector_type.cpp" 2 | 3 | -------------------------------------------------------------------------------- /src/duckdb/ub_extension_core_functions_scalar_enum.cpp: -------------------------------------------------------------------------------- 1 | #include "extension/core_functions/scalar/enum/enum_functions.cpp" 2 | 3 | -------------------------------------------------------------------------------- /src/duckdb/ub_extension_core_functions_scalar_operators.cpp: -------------------------------------------------------------------------------- 1 | #include "extension/core_functions/scalar/operators/bitwise.cpp" 2 | 3 | -------------------------------------------------------------------------------- /src/duckdb/ub_src_common_adbc.cpp: -------------------------------------------------------------------------------- 1 | #include "src/common/adbc/adbc.cpp" 2 | 3 | #include "src/common/adbc/driver_manager.cpp" 4 | 5 | -------------------------------------------------------------------------------- /tests/testthat/data/binary_string.parquet: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/duckdb/duckdb-r/HEAD/tests/testthat/data/binary_string.parquet -------------------------------------------------------------------------------- /pkgdown/favicon/android-chrome-192x192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/duckdb/duckdb-r/HEAD/pkgdown/favicon/android-chrome-192x192.png -------------------------------------------------------------------------------- /pkgdown/favicon/android-chrome-384x384.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/duckdb/duckdb-r/HEAD/pkgdown/favicon/android-chrome-384x384.png -------------------------------------------------------------------------------- /pkgdown/favicon/android-chrome-512x512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/duckdb/duckdb-r/HEAD/pkgdown/favicon/android-chrome-512x512.png -------------------------------------------------------------------------------- /src/duckdb/ub_src_execution_operator_csv_scanner_encode.cpp: -------------------------------------------------------------------------------- 1 | #include "src/execution/operator/csv_scanner/encode/csv_encoder.cpp" 2 | 3 | -------------------------------------------------------------------------------- /src/transform.dd: -------------------------------------------------------------------------------- 1 | transform.o: \ 2 | include/convert.hpp \ 3 | include/rapi.hpp \ 4 | include/typesr.hpp \ 5 | transform.cpp \ 6 | -------------------------------------------------------------------------------- /src/duckdb/ub_src_main_capi_cast.cpp: -------------------------------------------------------------------------------- 1 | #include "src/main/capi/cast/from_decimal-c.cpp" 2 | 3 | #include "src/main/capi/cast/utils-c.cpp" 4 | 5 | -------------------------------------------------------------------------------- /src/connection.dd: -------------------------------------------------------------------------------- 1 | connection.o: \ 2 | connection.cpp \ 3 | include/convert.hpp \ 4 | include/r_progress_bar_display.hpp \ 5 | include/rapi.hpp \ 6 | -------------------------------------------------------------------------------- /src/duckdb/ub_src_function_pragma.cpp: -------------------------------------------------------------------------------- 1 | #include "src/function/pragma/pragma_functions.cpp" 2 | 3 | #include "src/function/pragma/pragma_queries.cpp" 4 | 5 | -------------------------------------------------------------------------------- /src/duckdb/ub_src_main_settings.cpp: -------------------------------------------------------------------------------- 1 | #include "src/main/settings/custom_settings.cpp" 2 | 3 | #include "src/main/settings/autogenerated_settings.cpp" 4 | 5 | -------------------------------------------------------------------------------- /src/register.dd: -------------------------------------------------------------------------------- 1 | register.o: \ 2 | include/convert.hpp \ 3 | include/rapi.hpp \ 4 | include/signal.hpp \ 5 | include/typesr.hpp \ 6 | register.cpp \ 7 | -------------------------------------------------------------------------------- /src/utils.dd: -------------------------------------------------------------------------------- 1 | utils.o: \ 2 | include/convert.hpp \ 3 | include/rapi.hpp \ 4 | include/rfuns_extension.hpp \ 5 | include/typesr.hpp \ 6 | utils.cpp \ 7 | -------------------------------------------------------------------------------- /tests/testthat/test-null_byte.R: -------------------------------------------------------------------------------- 1 | test_that("test null bytes in strings", { 2 | con <- local_con() 3 | expect_error(dbGetQuery(con, "SELECT chr(0)")) 4 | }) 5 | -------------------------------------------------------------------------------- /R/release.R: -------------------------------------------------------------------------------- 1 | release_bullets <- function() { 2 | c( 3 | "Pay attention to valgrind warnings", 4 | "Ensure that extensions can be installed" 5 | ) 6 | } 7 | -------------------------------------------------------------------------------- /src/duckdb/ub_src_execution_sample.cpp: -------------------------------------------------------------------------------- 1 | #include "src/execution/sample/base_reservoir_sample.cpp" 2 | 3 | #include "src/execution/sample/reservoir_sample.cpp" 4 | 5 | -------------------------------------------------------------------------------- /src/duckdb/ub_src_storage_compression_alp.cpp: -------------------------------------------------------------------------------- 1 | #include "src/storage/compression/alp/alp_constants.cpp" 2 | 3 | #include "src/storage/compression/alp/alp.cpp" 4 | 5 | -------------------------------------------------------------------------------- /src/statement.dd: -------------------------------------------------------------------------------- 1 | statement.o: \ 2 | include/convert.hpp \ 3 | include/rapi.hpp \ 4 | include/signal.hpp \ 5 | include/typesr.hpp \ 6 | statement.cpp \ 7 | -------------------------------------------------------------------------------- /src/duckdb/ub_src_execution_operator_order.cpp: -------------------------------------------------------------------------------- 1 | #include "src/execution/operator/order/physical_order.cpp" 2 | 3 | #include "src/execution/operator/order/physical_top_n.cpp" 4 | 5 | -------------------------------------------------------------------------------- /src/duckdb/ub_src_main_chunk_scan_state.cpp: -------------------------------------------------------------------------------- 1 | #include "src/main/chunk_scan_state/query_result.cpp" 2 | 3 | #include "src/main/chunk_scan_state/batched_data_collection.cpp" 4 | 5 | -------------------------------------------------------------------------------- /inst/include/duckdb_types.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "rapi.hpp" 4 | 5 | // Silence warning about include not used directly 6 | namespace { 7 | using duckdb::conn_eptr_t; 8 | } 9 | -------------------------------------------------------------------------------- /src/duckdb/ub_extension_core_functions_scalar_blob.cpp: -------------------------------------------------------------------------------- 1 | #include "extension/core_functions/scalar/blob/base64.cpp" 2 | 3 | #include "extension/core_functions/scalar/blob/encode.cpp" 4 | 5 | -------------------------------------------------------------------------------- /src/duckdb/ub_extension_core_functions_scalar_random.cpp: -------------------------------------------------------------------------------- 1 | #include "extension/core_functions/scalar/random/random.cpp" 2 | 3 | #include "extension/core_functions/scalar/random/setseed.cpp" 4 | 5 | -------------------------------------------------------------------------------- /src/duckdb/ub_src_function_scalar_string_regexp.cpp: -------------------------------------------------------------------------------- 1 | #include "src/function/scalar/string/regexp/regexp_util.cpp" 2 | 3 | #include "src/function/scalar/string/regexp/regexp_extract_all.cpp" 4 | 5 | -------------------------------------------------------------------------------- /src/duckdb/ub_src_execution_nested_loop_join.cpp: -------------------------------------------------------------------------------- 1 | #include "src/execution/nested_loop_join/nested_loop_join_inner.cpp" 2 | 3 | #include "src/execution/nested_loop_join/nested_loop_join_mark.cpp" 4 | 5 | -------------------------------------------------------------------------------- /src/include/glue.mk: -------------------------------------------------------------------------------- 1 | GLUE=rfuns.o database.o connection.o statement.o register.o relational.o scan.o signal.o transform.o utils.o reltoaltrep.o altrepdataframe_relation.o types.o convert.o cpp11.o 2 | -------------------------------------------------------------------------------- /src/relational.dd: -------------------------------------------------------------------------------- 1 | relational.o: \ 2 | include/convert.hpp \ 3 | include/rapi.hpp \ 4 | include/reltoaltrep.hpp \ 5 | include/signal.hpp \ 6 | include/typesr.hpp \ 7 | relational.cpp \ 8 | -------------------------------------------------------------------------------- /src/duckdb/third_party/parquet/windows_compatibility.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #ifdef _WIN32 4 | #undef CREATE_NEW 5 | #undef OPTIONAL 6 | #undef Realloc 7 | #undef min 8 | #undef max 9 | #endif 10 | -------------------------------------------------------------------------------- /src/duckdb/ub_extension_core_functions_scalar_array.cpp: -------------------------------------------------------------------------------- 1 | #include "extension/core_functions/scalar/array/array_functions.cpp" 2 | 3 | #include "extension/core_functions/scalar/array/array_value.cpp" 4 | 5 | -------------------------------------------------------------------------------- /src/duckdb/ub_extension_core_functions_scalar_struct.cpp: -------------------------------------------------------------------------------- 1 | #include "extension/core_functions/scalar/struct/struct_insert.cpp" 2 | 3 | #include "extension/core_functions/scalar/struct/struct_update.cpp" 4 | 5 | -------------------------------------------------------------------------------- /tests/testthat/test-duckdb-extensions.R: -------------------------------------------------------------------------------- 1 | test_that("Install DuckDB extension", { 2 | skip_on_dev_version() 3 | skip_on_cran_except_r_universe() 4 | 5 | expect_no_error(sql_exec("INSTALL icu")) 6 | }) 7 | -------------------------------------------------------------------------------- /src/duckdb/ub_src_common_operator.cpp: -------------------------------------------------------------------------------- 1 | #include "src/common/operator/cast_operators.cpp" 2 | 3 | #include "src/common/operator/convert_to_string.cpp" 4 | 5 | #include "src/common/operator/string_cast.cpp" 6 | 7 | -------------------------------------------------------------------------------- /R/cpp12.R: -------------------------------------------------------------------------------- 1 | # allow_materialization = TRUE: compatibility with duckplyr <= 0.4.1 2 | rapi_rel_to_altrep <- function(rel, n_row = Inf, n_cells = Inf) { 3 | .Call(`_duckdb_rapi_rel_to_altrep`, rel, n_row, n_cells) 4 | } 5 | -------------------------------------------------------------------------------- /src/duckdb/ub_src_storage_metadata.cpp: -------------------------------------------------------------------------------- 1 | #include "src/storage/metadata/metadata_manager.cpp" 2 | 3 | #include "src/storage/metadata/metadata_reader.cpp" 4 | 5 | #include "src/storage/metadata/metadata_writer.cpp" 6 | 7 | -------------------------------------------------------------------------------- /src/duckdb/src/function/aggregate_function.cpp: -------------------------------------------------------------------------------- 1 | #include "duckdb/function/aggregate_function.hpp" 2 | 3 | namespace duckdb { 4 | 5 | AggregateFunctionInfo::~AggregateFunctionInfo() { 6 | } 7 | 8 | } // namespace duckdb 9 | -------------------------------------------------------------------------------- /src/duckdb/ub_src_function_cast_variant.cpp: -------------------------------------------------------------------------------- 1 | #include "src/function/cast/variant/from_variant.cpp" 2 | 3 | #include "src/function/cast/variant/to_variant.cpp" 4 | 5 | #include "src/function/cast/variant/to_json.cpp" 6 | 7 | -------------------------------------------------------------------------------- /.Rprofile: -------------------------------------------------------------------------------- 1 | # Generate R/rethrow-gen.R if needed 2 | invisible(source("scripts/rethrow.R", local = TRUE)) 3 | 4 | # Forward to default .Rprofile 5 | if (file.exists("~/.Rprofile")) { 6 | source("~/.Rprofile", chdir = TRUE) 7 | } 8 | -------------------------------------------------------------------------------- /src/altrepdataframe_relation.dd: -------------------------------------------------------------------------------- 1 | altrepdataframe_relation.o: \ 2 | altrepdataframe_relation.cpp \ 3 | include/altrepdataframe_relation.hpp \ 4 | include/convert.hpp \ 5 | include/rapi.hpp \ 6 | include/reltoaltrep.hpp \ 7 | -------------------------------------------------------------------------------- /src/duckdb/ub_src_function_scalar_generic.cpp: -------------------------------------------------------------------------------- 1 | #include "src/function/scalar/generic/constant_or_null.cpp" 2 | 3 | #include "src/function/scalar/generic/error.cpp" 4 | 5 | #include "src/function/scalar/generic/getvariable.cpp" 6 | 7 | -------------------------------------------------------------------------------- /src/duckdb/ub_src_main_buffered_data.cpp: -------------------------------------------------------------------------------- 1 | #include "src/main/buffered_data/buffered_data.cpp" 2 | 3 | #include "src/main/buffered_data/simple_buffered_data.cpp" 4 | 5 | #include "src/main/buffered_data/batched_buffered_data.cpp" 6 | 7 | -------------------------------------------------------------------------------- /src/duckdb/ub_src_function_scalar_compressed_materialization.cpp: -------------------------------------------------------------------------------- 1 | #include "src/function/scalar/compressed_materialization/compress_integral.cpp" 2 | 3 | #include "src/function/scalar/compressed_materialization/compress_string.cpp" 4 | 5 | -------------------------------------------------------------------------------- /src/duckdb/ub_src_execution_operator_set.cpp: -------------------------------------------------------------------------------- 1 | #include "src/execution/operator/set/physical_union.cpp" 2 | 3 | #include "src/execution/operator/set/physical_recursive_cte.cpp" 4 | 5 | #include "src/execution/operator/set/physical_cte.cpp" 6 | 7 | -------------------------------------------------------------------------------- /src/duckdb/ub_src_function_scalar_variant.cpp: -------------------------------------------------------------------------------- 1 | #include "src/function/scalar/variant/variant_utils.cpp" 2 | 3 | #include "src/function/scalar/variant/variant_extract.cpp" 4 | 5 | #include "src/function/scalar/variant/variant_typeof.cpp" 6 | 7 | -------------------------------------------------------------------------------- /src/duckdb/ub_src_function_table_arrow.cpp: -------------------------------------------------------------------------------- 1 | #include "src/function/table/arrow/arrow_duck_schema.cpp" 2 | 3 | #include "src/function/table/arrow/arrow_array_scan_state.cpp" 4 | 5 | #include "src/function/table/arrow/arrow_type_info.cpp" 6 | 7 | -------------------------------------------------------------------------------- /src/duckdb/ub_src_main_secret.cpp: -------------------------------------------------------------------------------- 1 | #include "src/main/secret/secret.cpp" 2 | 3 | #include "src/main/secret/secret_manager.cpp" 4 | 5 | #include "src/main/secret/secret_storage.cpp" 6 | 7 | #include "src/main/secret/default_secrets.cpp" 8 | 9 | -------------------------------------------------------------------------------- /src/reltoaltrep.dd: -------------------------------------------------------------------------------- 1 | reltoaltrep.o: \ 2 | include/altrepdataframe_relation.hpp \ 3 | include/convert.hpp \ 4 | include/rapi.hpp \ 5 | include/reltoaltrep.hpp \ 6 | include/signal.hpp \ 7 | include/typesr.hpp \ 8 | reltoaltrep.cpp \ 9 | -------------------------------------------------------------------------------- /src/duckdb/ub_src_common_progress_bar.cpp: -------------------------------------------------------------------------------- 1 | #include "src/common/progress_bar/progress_bar.cpp" 2 | 3 | #include "src/common/progress_bar/terminal_progress_bar_display.cpp" 4 | 5 | #include "src/common/progress_bar/unscented_kalman_filter.cpp" 6 | 7 | -------------------------------------------------------------------------------- /.github/workflows/pkgdown-build/action.yml: -------------------------------------------------------------------------------- 1 | name: "Action to build a pkgdown website" 2 | 3 | runs: 4 | using: "composite" 5 | steps: 6 | - name: Build site 7 | run: | 8 | pkgdown::build_site() 9 | shell: Rscript {0} 10 | -------------------------------------------------------------------------------- /src/duckdb/src/include/duckdb/function/cast/nested_to_varchar_cast.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace duckdb { 4 | 5 | struct NestedToVarcharCast { 6 | public: 7 | static const bool LOOKUP_TABLE[256]; 8 | }; 9 | 10 | } // namespace duckdb 11 | -------------------------------------------------------------------------------- /src/duckdb/ub_src_common_sorting.cpp: -------------------------------------------------------------------------------- 1 | #include "src/common/sorting/hashed_sort.cpp" 2 | 3 | #include "src/common/sorting/sort.cpp" 4 | 5 | #include "src/common/sorting/sorted_run.cpp" 6 | 7 | #include "src/common/sorting/sorted_run_merger.cpp" 8 | 9 | -------------------------------------------------------------------------------- /src/duckdb/ub_src_execution_operator_csv_scanner_state_machine.cpp: -------------------------------------------------------------------------------- 1 | #include "src/execution/operator/csv_scanner/state_machine/csv_state_machine.cpp" 2 | 3 | #include "src/execution/operator/csv_scanner/state_machine/csv_state_machine_cache.cpp" 4 | 5 | -------------------------------------------------------------------------------- /src/duckdb/src/include/duckdb/original/std/locale.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | #define DUCKDB_BASE_STD 7 | 8 | namespace duckdb_base_std { 9 | using ::std::isspace; 10 | } // namespace duckdb_base_std 11 | -------------------------------------------------------------------------------- /src/duckdb/ub_src_function_aggregate_distributive.cpp: -------------------------------------------------------------------------------- 1 | #include "src/function/aggregate/distributive/count.cpp" 2 | 3 | #include "src/function/aggregate/distributive/first_last_any.cpp" 4 | 5 | #include "src/function/aggregate/distributive/minmax.cpp" 6 | 7 | -------------------------------------------------------------------------------- /src/duckdb/ub_src_storage_compression_dict_fsst.cpp: -------------------------------------------------------------------------------- 1 | #include "src/storage/compression/dict_fsst/analyze.cpp" 2 | 3 | #include "src/storage/compression/dict_fsst/compression.cpp" 4 | 5 | #include "src/storage/compression/dict_fsst/decompression.cpp" 6 | 7 | -------------------------------------------------------------------------------- /docker/Dockerfile.r-debug-threadcheck: -------------------------------------------------------------------------------- 1 | FROM wch1/r-debug 2 | 3 | WORKDIR /root 4 | 5 | COPY docker/r-debug-threadcheck.sh docker/deps.R DESCRIPTION . 6 | 7 | RUN ./r-debug-threadcheck.sh 8 | 9 | WORKDIR /root/workspace 10 | 11 | ENTRYPOINT /bin/bash 12 | -------------------------------------------------------------------------------- /src/duckdb/src/planner/operator/logical_set.cpp: -------------------------------------------------------------------------------- 1 | #include "duckdb/planner/operator/logical_set.hpp" 2 | 3 | namespace duckdb { 4 | 5 | idx_t LogicalSet::EstimateCardinality(ClientContext &context) { 6 | return 1; 7 | } 8 | 9 | } // namespace duckdb 10 | -------------------------------------------------------------------------------- /.github/workflows/roxygenize/action.yml: -------------------------------------------------------------------------------- 1 | name: "Action to create documentation with roxygen2" 2 | 3 | runs: 4 | using: "composite" 5 | steps: 6 | - name: Roxygenize 7 | run: | 8 | try(roxygen2::roxygenize()) 9 | shell: Rscript {0} 10 | -------------------------------------------------------------------------------- /docker/Dockerfile.r-debug-strictbarrier: -------------------------------------------------------------------------------- 1 | FROM wch1/r-debug 2 | 3 | WORKDIR /root 4 | 5 | COPY docker/r-debug-strictbarrier.sh docker/deps.R DESCRIPTION . 6 | 7 | RUN ./r-debug-strictbarrier.sh 8 | 9 | WORKDIR /root/workspace 10 | 11 | ENTRYPOINT /bin/bash 12 | -------------------------------------------------------------------------------- /src/duckdb/src/planner/operator/logical_reset.cpp: -------------------------------------------------------------------------------- 1 | #include "duckdb/planner/operator/logical_reset.hpp" 2 | 3 | namespace duckdb { 4 | 5 | idx_t LogicalReset::EstimateCardinality(ClientContext &context) { 6 | return 1; 7 | } 8 | 9 | } // namespace duckdb 10 | -------------------------------------------------------------------------------- /src/duckdb/ub_src_logging.cpp: -------------------------------------------------------------------------------- 1 | #include "src/logging/log_manager.cpp" 2 | 3 | #include "src/logging/log_storage.cpp" 4 | 5 | #include "src/logging/log_types.cpp" 6 | 7 | #include "src/logging/logger.cpp" 8 | 9 | #include "src/logging/logging.cpp" 10 | 11 | -------------------------------------------------------------------------------- /src/duckdb/src/planner/operator/logical_pragma.cpp: -------------------------------------------------------------------------------- 1 | #include "duckdb/planner/operator/logical_pragma.hpp" 2 | 3 | namespace duckdb { 4 | 5 | idx_t LogicalPragma::EstimateCardinality(ClientContext &context) { 6 | return 1; 7 | } 8 | 9 | } // namespace duckdb 10 | -------------------------------------------------------------------------------- /src/duckdb/src/planner/operator/logical_prepare.cpp: -------------------------------------------------------------------------------- 1 | #include "duckdb/planner/operator/logical_prepare.hpp" 2 | 3 | namespace duckdb { 4 | 5 | idx_t LogicalPrepare::EstimateCardinality(ClientContext &context) { 6 | return 1; 7 | } 8 | 9 | } // namespace duckdb 10 | -------------------------------------------------------------------------------- /src/duckdb/ub_extension_core_functions_scalar_union.cpp: -------------------------------------------------------------------------------- 1 | #include "extension/core_functions/scalar/union/union_extract.cpp" 2 | 3 | #include "extension/core_functions/scalar/union/union_value.cpp" 4 | 5 | #include "extension/core_functions/scalar/union/union_tag.cpp" 6 | 7 | -------------------------------------------------------------------------------- /src/duckdb/ub_src_parser_query_node.cpp: -------------------------------------------------------------------------------- 1 | #include "src/parser/query_node/recursive_cte_node.cpp" 2 | 3 | #include "src/parser/query_node/cte_node.cpp" 4 | 5 | #include "src/parser/query_node/select_node.cpp" 6 | 7 | #include "src/parser/query_node/set_operation_node.cpp" 8 | 9 | -------------------------------------------------------------------------------- /src/duckdb/src/storage/compression/chimp/bit_reader.cpp: -------------------------------------------------------------------------------- 1 | #include "duckdb/storage/compression/chimp/algorithm/bit_reader.hpp" 2 | 3 | namespace duckdb { 4 | 5 | constexpr uint8_t BitReader::REMAINDER_MASKS[]; 6 | constexpr uint8_t BitReader::MASKS[]; 7 | 8 | } // namespace duckdb 9 | -------------------------------------------------------------------------------- /src/duckdb/ub_extension_parquet_reader_variant.cpp: -------------------------------------------------------------------------------- 1 | #include "extension/parquet/reader/variant/variant_binary_decoder.cpp" 2 | 3 | #include "extension/parquet/reader/variant/variant_value.cpp" 4 | 5 | #include "extension/parquet/reader/variant/variant_shredded_conversion.cpp" 6 | 7 | -------------------------------------------------------------------------------- /R/duckdb-package.R: -------------------------------------------------------------------------------- 1 | ## usethis namespace: start 2 | #' @useDynLib duckdb, .registration = TRUE 3 | ## usethis namespace: end 4 | #' @name duckdb-package 5 | #' @keywords internal 6 | "_PACKAGE" 7 | NULL 8 | 9 | ## usethis namespace: start 10 | ## usethis namespace: end 11 | NULL 12 | -------------------------------------------------------------------------------- /R/version.R: -------------------------------------------------------------------------------- 1 | # Generated by rconfigure.py, do not edit by hand 2 | # DuckDB version information 3 | 4 | duckdb_version <- "1.4.4-dev6" 5 | 6 | # Function to get DuckDB version without establishing a connection 7 | get_duckdb_version <- function() { 8 | duckdb_version 9 | } 10 | -------------------------------------------------------------------------------- /src/duckdb/src/include/duckdb/parser/query_node/list.hpp: -------------------------------------------------------------------------------- 1 | #include "duckdb/parser/query_node/recursive_cte_node.hpp" 2 | #include "duckdb/parser/query_node/cte_node.hpp" 3 | #include "duckdb/parser/query_node/select_node.hpp" 4 | #include "duckdb/parser/query_node/set_operation_node.hpp" 5 | -------------------------------------------------------------------------------- /src/duckdb/ub_extension_core_functions_aggregate_nested.cpp: -------------------------------------------------------------------------------- 1 | #include "extension/core_functions/aggregate/nested/binned_histogram.cpp" 2 | 3 | #include "extension/core_functions/aggregate/nested/list.cpp" 4 | 5 | #include "extension/core_functions/aggregate/nested/histogram.cpp" 6 | 7 | -------------------------------------------------------------------------------- /src/duckdb/ub_src_common_exception.cpp: -------------------------------------------------------------------------------- 1 | #include "src/common/exception/binder_exception.cpp" 2 | 3 | #include "src/common/exception/catalog_exception.cpp" 4 | 5 | #include "src/common/exception/conversion_exception.cpp" 6 | 7 | #include "src/common/exception/parser_exception.cpp" 8 | 9 | -------------------------------------------------------------------------------- /src/duckdb/ub_src_execution_operator_csv_scanner_util.cpp: -------------------------------------------------------------------------------- 1 | #include "src/execution/operator/csv_scanner/util/csv_error.cpp" 2 | 3 | #include "src/execution/operator/csv_scanner/util/csv_reader_options.cpp" 4 | 5 | #include "src/execution/operator/csv_scanner/util/csv_validator.cpp" 6 | 7 | -------------------------------------------------------------------------------- /src/duckdb/ub_src_function_scalar_operator.cpp: -------------------------------------------------------------------------------- 1 | #include "src/function/scalar/operator/add.cpp" 2 | 3 | #include "src/function/scalar/operator/arithmetic.cpp" 4 | 5 | #include "src/function/scalar/operator/multiply.cpp" 6 | 7 | #include "src/function/scalar/operator/subtract.cpp" 8 | 9 | -------------------------------------------------------------------------------- /src/duckdb/src/include/duckdb/function/table/arrow/enum/arrow_type_info_type.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace duckdb { 6 | 7 | enum class ArrowTypeInfoType : uint8_t { LIST, STRUCT, DATE_TIME, STRING, ARRAY, DECIMAL }; 8 | 9 | } // namespace duckdb 10 | -------------------------------------------------------------------------------- /src/duckdb/ub_src_common_adbc_nanoarrow.cpp: -------------------------------------------------------------------------------- 1 | #include "src/common/adbc/nanoarrow/metadata.cpp" 2 | 3 | #include "src/common/adbc/nanoarrow/schema.cpp" 4 | 5 | #include "src/common/adbc/nanoarrow/allocator.cpp" 6 | 7 | #include "src/common/adbc/nanoarrow/single_batch_array_stream.cpp" 8 | 9 | -------------------------------------------------------------------------------- /src/duckdb/src/storage/compression/chimp/flag_buffer.cpp: -------------------------------------------------------------------------------- 1 | #include "duckdb/storage/compression/chimp/algorithm/flag_buffer.hpp" 2 | 3 | namespace duckdb { 4 | 5 | constexpr uint8_t FlagBufferConstants::MASKS[]; 6 | constexpr uint8_t FlagBufferConstants::SHIFTS[]; 7 | 8 | } // namespace duckdb 9 | -------------------------------------------------------------------------------- /src/duckdb/src/include/duckdb/function/table/list.hpp: -------------------------------------------------------------------------------- 1 | #include "duckdb/function/table/read_csv.hpp" 2 | #include "duckdb/function/table/system_functions.hpp" 3 | #include "duckdb/function/table/range.hpp" 4 | #include "duckdb/function/table/summary.hpp" 5 | #include "duckdb/function/table/files.hpp" 6 | -------------------------------------------------------------------------------- /src/duckdb/ub_src_catalog_catalog_entry_dependency.cpp: -------------------------------------------------------------------------------- 1 | #include "src/catalog/catalog_entry/dependency/dependency_entry.cpp" 2 | 3 | #include "src/catalog/catalog_entry/dependency/dependency_subject_entry.cpp" 4 | 5 | #include "src/catalog/catalog_entry/dependency/dependency_dependent_entry.cpp" 6 | 7 | -------------------------------------------------------------------------------- /src/duckdb/ub_src_parser_constraints.cpp: -------------------------------------------------------------------------------- 1 | #include "src/parser/constraints/check_constraint.cpp" 2 | 3 | #include "src/parser/constraints/not_null_constraint.cpp" 4 | 5 | #include "src/parser/constraints/unique_constraint.cpp" 6 | 7 | #include "src/parser/constraints/foreign_key_constraint.cpp" 8 | 9 | -------------------------------------------------------------------------------- /CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Generated by cynkrathis::use_cmakelists(), do not edit by hand 2 | # 3 | # Call: 4 | # quote(cynkrathis::use_cmakelists()) 5 | 6 | cmake_minimum_required(VERSION 3.14) 7 | project(duckdb VERSION 0.1.0) 8 | 9 | set(CMAKE_EXPORT_COMPILE_COMMANDS ON) 10 | 11 | add_subdirectory(src) 12 | -------------------------------------------------------------------------------- /src/duckdb/src/function/scalar/pragma_functions.cpp: -------------------------------------------------------------------------------- 1 | #include "duckdb/function/pragma/pragma_functions.hpp" 2 | 3 | namespace duckdb { 4 | 5 | void BuiltinFunctions::RegisterPragmaFunctions() { 6 | Register(); 7 | Register(); 8 | } 9 | 10 | } // namespace duckdb 11 | -------------------------------------------------------------------------------- /src/duckdb/ub_src_storage_checkpoint.cpp: -------------------------------------------------------------------------------- 1 | #include "src/storage/checkpoint/row_group_writer.cpp" 2 | 3 | #include "src/storage/checkpoint/table_data_writer.cpp" 4 | 5 | #include "src/storage/checkpoint/table_data_reader.cpp" 6 | 7 | #include "src/storage/checkpoint/write_overflow_strings_to_disk.cpp" 8 | 9 | -------------------------------------------------------------------------------- /src/duckdb/src/include/duckdb/original/std/sstream.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | #define DUCKDB_BASE_STD 6 | 7 | namespace duckdb_base_std { 8 | using ::std::basic_stringstream; 9 | using ::std::stringstream; 10 | using ::std::wstringstream; 11 | } // namespace duckdb_base_std 12 | -------------------------------------------------------------------------------- /src/duckdb/src/include/duckdb/parser/constraints/list.hpp: -------------------------------------------------------------------------------- 1 | #include "duckdb/parser/constraints/check_constraint.hpp" 2 | #include "duckdb/parser/constraints/not_null_constraint.hpp" 3 | #include "duckdb/parser/constraints/unique_constraint.hpp" 4 | #include "duckdb/parser/constraints/foreign_key_constraint.hpp" 5 | -------------------------------------------------------------------------------- /src/duckdb/ub_src_planner_subquery.cpp: -------------------------------------------------------------------------------- 1 | #include "src/planner/subquery/flatten_dependent_join.cpp" 2 | 3 | #include "src/planner/subquery/has_correlated_expressions.cpp" 4 | 5 | #include "src/planner/subquery/rewrite_correlated_expressions.cpp" 6 | 7 | #include "src/planner/subquery/rewrite_cte_scan.cpp" 8 | 9 | -------------------------------------------------------------------------------- /tests/testthat/test-fetch.R: -------------------------------------------------------------------------------- 1 | test_that("dbFetch() can fetch RETURNING statements (#3875)", { 2 | con <- local_con() 3 | 4 | dbCreateTable(con, "x", list(a = "int")) 5 | 6 | expect_silent(out <- dbGetQuery(con, "INSERT INTO x VALUES (1) RETURNING (a)")) 7 | expect_equal(out, data.frame(a = 1L)) 8 | }) 9 | -------------------------------------------------------------------------------- /src/duckdb/src/include/duckdb/planner/query_node/list.hpp: -------------------------------------------------------------------------------- 1 | #include "duckdb/planner/query_node/bound_recursive_cte_node.hpp" 2 | #include "duckdb/planner/query_node/bound_cte_node.hpp" 3 | #include "duckdb/planner/query_node/bound_select_node.hpp" 4 | #include "duckdb/planner/query_node/bound_set_operation_node.hpp" 5 | -------------------------------------------------------------------------------- /src/duckdb/src/transaction/transaction_manager.cpp: -------------------------------------------------------------------------------- 1 | #include "duckdb/transaction/transaction_manager.hpp" 2 | 3 | namespace duckdb { 4 | 5 | TransactionManager::TransactionManager(AttachedDatabase &db) : db(db) { 6 | } 7 | 8 | TransactionManager::~TransactionManager() { 9 | } 10 | 11 | } // namespace duckdb 12 | -------------------------------------------------------------------------------- /.github/workflows/custom/before-install/action.yml: -------------------------------------------------------------------------------- 1 | name: 'Custom steps to run before R packages are installed' 2 | 3 | runs: 4 | using: "composite" 5 | steps: 6 | - name: Define R CMD check error condition 7 | run: | 8 | echo '_R_CHECK_PKG_SIZES_=FALSE' | tee -a $GITHUB_ENV 9 | shell: bash 10 | -------------------------------------------------------------------------------- /revdep/README.md: -------------------------------------------------------------------------------- 1 | # Revdeps 2 | 3 | ## New problems (2) 4 | 5 | |package |version |error |warning |note | 6 | |:-----------|:-------|:------|:-------|:----| 7 | |[duckspatial](problems.md#duckspatial)|0.2.0 |__+1__ | | | 8 | |[motherduck](problems.md#motherduck)|0.2.0 |__+1__ | |1 | 9 | 10 | -------------------------------------------------------------------------------- /src/duckdb/src/storage/compression/chimp/leading_zero_buffer.cpp: -------------------------------------------------------------------------------- 1 | #include "duckdb/storage/compression/chimp/algorithm/leading_zero_buffer.hpp" 2 | 3 | namespace duckdb { 4 | 5 | constexpr uint32_t LeadingZeroBufferConstants::MASKS[]; 6 | constexpr uint8_t LeadingZeroBufferConstants::SHIFTS[]; 7 | 8 | } // namespace duckdb 9 | -------------------------------------------------------------------------------- /src/duckdb/ub_src_storage_compression_dictionary.cpp: -------------------------------------------------------------------------------- 1 | #include "src/storage/compression/dictionary/common.cpp" 2 | 3 | #include "src/storage/compression/dictionary/analyze.cpp" 4 | 5 | #include "src/storage/compression/dictionary/compression.cpp" 6 | 7 | #include "src/storage/compression/dictionary/decompression.cpp" 8 | 9 | -------------------------------------------------------------------------------- /tests/testthat/test-ambiguous_prepare.R: -------------------------------------------------------------------------------- 1 | test_that("Test ambiguous prepare statements", { 2 | con <- local_con() 3 | 4 | res <- dbGetQuery(con, "select ?", 42) 5 | expect_identical(res[[1]], 42) 6 | 7 | res <- dbGetQuery(con, "select ?", "hello world") 8 | expect_identical(res[[1]], "hello world") 9 | }) 10 | -------------------------------------------------------------------------------- /src/duckdb/src/include/duckdb/original/std/memory.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | #define DUCKDB_BASE_STD 6 | 7 | namespace duckdb_base_std { 8 | using ::std::make_shared; 9 | using ::std::shared_ptr; 10 | using ::std::unique_ptr; 11 | // using ::std::make_unique; 12 | } // namespace duckdb_base_std 13 | -------------------------------------------------------------------------------- /src/duckdb/ub_src_execution_operator_csv_scanner_buffer_manager.cpp: -------------------------------------------------------------------------------- 1 | #include "src/execution/operator/csv_scanner/buffer_manager/csv_buffer.cpp" 2 | 3 | #include "src/execution/operator/csv_scanner/buffer_manager/csv_buffer_manager.cpp" 4 | 5 | #include "src/execution/operator/csv_scanner/buffer_manager/csv_file_handle.cpp" 6 | 7 | -------------------------------------------------------------------------------- /inst/rstudio/connections/DuckDB.R: -------------------------------------------------------------------------------- 1 | library(DBI) 2 | library(duckdb) 3 | 4 | # create / connect to database file 5 | drv <- duckdb(dbdir = "${1:database=quack.db}") 6 | con <- dbConnect(drv) 7 | 8 | ## write a table to it 9 | # dbWriteTable(con, "iris", iris) 10 | 11 | ## and disconnect 12 | # dbDisconnect(con, shutdown=TRUE) 13 | -------------------------------------------------------------------------------- /src/duckdb/ub_src_execution_operator_csv_scanner_table_function.cpp: -------------------------------------------------------------------------------- 1 | #include "src/execution/operator/csv_scanner/table_function/csv_file_scanner.cpp" 2 | 3 | #include "src/execution/operator/csv_scanner/table_function/global_csv_state.cpp" 4 | 5 | #include "src/execution/operator/csv_scanner/table_function/csv_multi_file_info.cpp" 6 | 7 | -------------------------------------------------------------------------------- /src/duckdb/ub_src_storage_buffer.cpp: -------------------------------------------------------------------------------- 1 | #include "src/storage/buffer/buffer_handle.cpp" 2 | 3 | #include "src/storage/buffer/block_handle.cpp" 4 | 5 | #include "src/storage/buffer/block_manager.cpp" 6 | 7 | #include "src/storage/buffer/buffer_pool.cpp" 8 | 9 | #include "src/storage/buffer/buffer_pool_reservation.cpp" 10 | 11 | -------------------------------------------------------------------------------- /R/dbIsValid__duckdb_result.R: -------------------------------------------------------------------------------- 1 | #' @rdname duckdb_result-class 2 | #' @inheritParams DBI::dbIsValid 3 | #' @usage NULL 4 | dbIsValid__duckdb_result <- function(dbObj, ...) { 5 | return(dbObj@env$open) 6 | } 7 | 8 | #' @rdname duckdb_result-class 9 | #' @export 10 | setMethod("dbIsValid", "duckdb_result", dbIsValid__duckdb_result) 11 | -------------------------------------------------------------------------------- /src/duckdb/src/include/duckdb/planner/constraints/list.hpp: -------------------------------------------------------------------------------- 1 | #include "duckdb/planner/constraints/bound_check_constraint.hpp" 2 | #include "duckdb/planner/constraints/bound_not_null_constraint.hpp" 3 | #include "duckdb/planner/constraints/bound_unique_constraint.hpp" 4 | #include "duckdb/planner/constraints/bound_foreign_key_constraint.hpp" 5 | -------------------------------------------------------------------------------- /src/duckdb/ub_src_execution_index.cpp: -------------------------------------------------------------------------------- 1 | #include "src/execution/index/fixed_size_allocator.cpp" 2 | 3 | #include "src/execution/index/fixed_size_buffer.cpp" 4 | 5 | #include "src/execution/index/unbound_index.cpp" 6 | 7 | #include "src/execution/index/index_type_set.cpp" 8 | 9 | #include "src/execution/index/bound_index.cpp" 10 | 11 | -------------------------------------------------------------------------------- /R/show__duckdb_driver.R: -------------------------------------------------------------------------------- 1 | #' @rdname duckdb_driver-class 2 | #' @inheritParams methods::show 3 | #' @usage NULL 4 | show__duckdb_driver <- function(object) { 5 | message(drv_to_string(object)) 6 | invisible(NULL) 7 | } 8 | 9 | #' @rdname duckdb_driver-class 10 | #' @export 11 | setMethod("show", "duckdb_driver", show__duckdb_driver) 12 | -------------------------------------------------------------------------------- /cleanup.win: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -ex 4 | 5 | # For CI/CD: only compress if expansion is possible too 6 | if which xz > /dev/null; then 7 | if [ -d .git ]; then git clean -fdx src; fi 8 | cd src 9 | find duckdb -type f | egrep '[.](cc|cpp|h|hpp)$' | xargs dos2unix 10 | tar cvJf duckdb.tar.xz duckdb 11 | rm -rf duckdb 12 | fi 13 | -------------------------------------------------------------------------------- /tests/testthat/helper-arrow.R: -------------------------------------------------------------------------------- 1 | # if not running on cran, we run arrow tests. 2 | # we import arrow first since there are GC issues if we import it after 3 | # running relational R tests. 4 | # something to do with how arrow releases its resources. 5 | if (Sys.getenv("NOT_CRAN") == "true") { 6 | requireNamespace("arrow", quietly = TRUE) 7 | } 8 | -------------------------------------------------------------------------------- /src/include/deps.mk: -------------------------------------------------------------------------------- 1 | # Dependencies 2 | include $(GLUE:.o=.dd) 3 | 4 | # Include only local dependencies for smaller footprint 5 | # Add trailing backslash and sort 6 | %.dd: %.d 7 | sed -r 's/([^ ]) ([^ \\])/\1 \\\n \2/g' $< | sed -r '/^ ([/]|duckdb|[.][.])/D;$$s/([^\\])$$/\1 \\/' | { read -r header; printf '%s\n' "$$header"; LOCALE=C sort; } > $@ 8 | -------------------------------------------------------------------------------- /src/duckdb/src/common/tree_renderer/tree_renderer.cpp: -------------------------------------------------------------------------------- 1 | #include "duckdb/common/tree_renderer.hpp" 2 | 3 | namespace duckdb { 4 | 5 | void TreeRenderer::ToStream(RenderTree &root, std::ostream &ss) { 6 | if (!UsesRawKeyNames()) { 7 | root.SanitizeKeyNames(); 8 | } 9 | return ToStreamInternal(root, ss); 10 | } 11 | 12 | } // namespace duckdb 13 | -------------------------------------------------------------------------------- /src/duckdb/src/include/duckdb/common/windows.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #if defined(_WIN32) 4 | 5 | #ifndef NOMINMAX 6 | #define NOMINMAX 7 | #endif 8 | 9 | #ifndef _WINSOCKAPI_ 10 | #define _WINSOCKAPI_ 11 | #endif 12 | 13 | #include 14 | 15 | #undef CreateDirectory 16 | #undef MoveFile 17 | #undef RemoveDirectory 18 | 19 | #endif 20 | -------------------------------------------------------------------------------- /src/duckdb/ub_extension_core_functions_aggregate_algebraic.cpp: -------------------------------------------------------------------------------- 1 | #include "extension/core_functions/aggregate/algebraic/corr.cpp" 2 | 3 | #include "extension/core_functions/aggregate/algebraic/stddev.cpp" 4 | 5 | #include "extension/core_functions/aggregate/algebraic/avg.cpp" 6 | 7 | #include "extension/core_functions/aggregate/algebraic/covar.cpp" 8 | 9 | -------------------------------------------------------------------------------- /src/duckdb/ub_src_common_sort.cpp: -------------------------------------------------------------------------------- 1 | #include "src/common/sort/comparators.cpp" 2 | 3 | #include "src/common/sort/merge_sorter.cpp" 4 | 5 | #include "src/common/sort/partition_state.cpp" 6 | 7 | #include "src/common/sort/radix_sort.cpp" 8 | 9 | #include "src/common/sort/sort_state.cpp" 10 | 11 | #include "src/common/sort/sorted_block.cpp" 12 | 13 | -------------------------------------------------------------------------------- /src/duckdb/ub_src_execution_operator_projection.cpp: -------------------------------------------------------------------------------- 1 | #include "src/execution/operator/projection/physical_projection.cpp" 2 | 3 | #include "src/execution/operator/projection/physical_tableinout_function.cpp" 4 | 5 | #include "src/execution/operator/projection/physical_pivot.cpp" 6 | 7 | #include "src/execution/operator/projection/physical_unnest.cpp" 8 | 9 | -------------------------------------------------------------------------------- /src/duckdb/ub_src_optimizer_pullup.cpp: -------------------------------------------------------------------------------- 1 | #include "src/optimizer/pullup/pullup_filter.cpp" 2 | 3 | #include "src/optimizer/pullup/pullup_projection.cpp" 4 | 5 | #include "src/optimizer/pullup/pullup_from_left.cpp" 6 | 7 | #include "src/optimizer/pullup/pullup_both_side.cpp" 8 | 9 | #include "src/optimizer/pullup/pullup_set_operation.cpp" 10 | 11 | -------------------------------------------------------------------------------- /inst/include/cpp11/altrep.hpp: -------------------------------------------------------------------------------- 1 | // cpp11 version: 0.5.2 2 | // vendored on: 2025-03-09 3 | #pragma once 4 | 5 | // It would be nice to remove this since all supported versions of R have ALTREP, but 6 | // some groups rely on both this `#define` and `altrep.hpp` itself existing, like arrow: 7 | // https://github.com/r-lib/cpp11/issues/413 8 | #define HAS_ALTREP 9 | -------------------------------------------------------------------------------- /src/duckdb/ub_src_function_scalar.cpp: -------------------------------------------------------------------------------- 1 | #include "src/function/scalar/compressed_materialization_utils.cpp" 2 | 3 | #include "src/function/scalar/create_sort_key.cpp" 4 | 5 | #include "src/function/scalar/strftime_format.cpp" 6 | 7 | #include "src/function/scalar/nested_functions.cpp" 8 | 9 | #include "src/function/scalar/pragma_functions.cpp" 10 | 11 | -------------------------------------------------------------------------------- /src/duckdb/ub_src_function_scalar_list.cpp: -------------------------------------------------------------------------------- 1 | #include "src/function/scalar/list/contains_or_position.cpp" 2 | 3 | #include "src/function/scalar/list/list_extract.cpp" 4 | 5 | #include "src/function/scalar/list/list_resize.cpp" 6 | 7 | #include "src/function/scalar/list/list_zip.cpp" 8 | 9 | #include "src/function/scalar/list/list_select.cpp" 10 | 11 | -------------------------------------------------------------------------------- /tests/testthat/test-extension_path.R: -------------------------------------------------------------------------------- 1 | skip_on_cran() 2 | skip_on_os(c("windows")) 3 | 4 | test_that("duckdb extensions are in a R specific directory", { 5 | con <- local_con(config = list('allow_unsigned_extensions' = 'true')) 6 | expect_error(dbExecute(con, "LOAD 'bogus'"), regexp = ".*R/duckdb/extensions/.*/bogus.duckdb_extension.*\" not found.") 7 | }) 8 | -------------------------------------------------------------------------------- /src/duckdb/ub_src_storage_compression_roaring.cpp: -------------------------------------------------------------------------------- 1 | #include "src/storage/compression/roaring/common.cpp" 2 | 3 | #include "src/storage/compression/roaring/metadata.cpp" 4 | 5 | #include "src/storage/compression/roaring/analyze.cpp" 6 | 7 | #include "src/storage/compression/roaring/compress.cpp" 8 | 9 | #include "src/storage/compression/roaring/scan.cpp" 10 | 11 | -------------------------------------------------------------------------------- /src/duckdb/ub_src_function_scalar_struct.cpp: -------------------------------------------------------------------------------- 1 | #include "src/function/scalar/struct/remap_struct.cpp" 2 | 3 | #include "src/function/scalar/struct/struct_extract.cpp" 4 | 5 | #include "src/function/scalar/struct/struct_pack.cpp" 6 | 7 | #include "src/function/scalar/struct/struct_concat.cpp" 8 | 9 | #include "src/function/scalar/struct/struct_contains.cpp" 10 | 11 | -------------------------------------------------------------------------------- /man/duckdb_explain-class.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/print__duckdb_explain.R 3 | \docType{class} 4 | \name{duckdb_explain-class} 5 | \alias{duckdb_explain-class} 6 | \alias{duckdb_explain} 7 | \alias{print.duckdb_explain} 8 | \title{DuckDB EXPLAIN query tree} 9 | \description{ 10 | DuckDB EXPLAIN query tree 11 | } 12 | -------------------------------------------------------------------------------- /src/duckdb/src/include/duckdb/common/memory_safety.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace duckdb { 4 | 5 | template 6 | struct MemorySafety { 7 | #ifdef DEBUG 8 | // In DEBUG mode safety is always on 9 | static constexpr bool ENABLED = true; 10 | #else 11 | static constexpr bool ENABLED = IS_ENABLED; 12 | #endif 13 | }; 14 | 15 | } // namespace duckdb 16 | -------------------------------------------------------------------------------- /tests/testthat/test-rfuns.R: -------------------------------------------------------------------------------- 1 | test_that("can load rfuns extension and run functions", { 2 | drv <- duckdb() 3 | con <- dbConnect(drv) 4 | 5 | expect_error(dbGetQuery(con, 'SELECT "r_base::=="(1, 2)')) 6 | 7 | rapi_load_rfuns(drv@database_ref) 8 | 9 | expect_equal(dbGetQuery(con, 'SELECT "r_base::=="(1, 2)')[[1]], FALSE) 10 | 11 | dbDisconnect(con) 12 | }) 13 | -------------------------------------------------------------------------------- /.github/workflows/git-identity/action.yml: -------------------------------------------------------------------------------- 1 | name: "Actions to set up a Git identity" 2 | 3 | runs: 4 | using: "composite" 5 | steps: 6 | - name: Configure Git identity 7 | run: | 8 | env | sort 9 | git config --local user.name "$GITHUB_ACTOR" 10 | git config --local user.email "$GITHUB_ACTOR@users.noreply.github.com" 11 | shell: bash 12 | -------------------------------------------------------------------------------- /.github/workflows/pkgdown-deploy/action.yml: -------------------------------------------------------------------------------- 1 | name: "Action to deploy a pkgdown website" 2 | 3 | runs: 4 | using: "composite" 5 | steps: 6 | - name: Deploy site 7 | uses: nick-fields/retry@v3 8 | with: 9 | timeout_minutes: 15 10 | max_attempts: 10 11 | command: | 12 | R -q -e 'pkgdown::deploy_to_branch(new_process = FALSE)' 13 | -------------------------------------------------------------------------------- /R/dbDataType__duckdb_connection.R: -------------------------------------------------------------------------------- 1 | #' @rdname duckdb_connection-class 2 | #' @inheritParams DBI::dbDataType 3 | #' @usage NULL 4 | dbDataType__duckdb_connection <- function(dbObj, obj, ...) { 5 | dbDataType(dbObj@driver, obj, ...) 6 | } 7 | 8 | #' @rdname duckdb_connection-class 9 | #' @export 10 | setMethod("dbDataType", "duckdb_connection", dbDataType__duckdb_connection) 11 | -------------------------------------------------------------------------------- /docker/deps.R: -------------------------------------------------------------------------------- 1 | installed <- rownames(installed.packages()) 2 | installed 3 | 4 | pkgs <- 5 | read.dcf("DESCRIPTION", c("Imports", "Suggests")) |> 6 | gsub(" +[(][^)]+[)]", "", x = _) |> strsplit(",\n") |> 7 | unlist() |> 8 | setdiff(installed) 9 | 10 | pkgs 11 | 12 | install.packages(pkgs) 13 | 14 | # Can't install packager from here, so we'll have to do it manually 15 | -------------------------------------------------------------------------------- /src/duckdb/ub_src_storage_compression_chimp.cpp: -------------------------------------------------------------------------------- 1 | #include "src/storage/compression/chimp/bit_reader.cpp" 2 | 3 | #include "src/storage/compression/chimp/chimp_constants.cpp" 4 | 5 | #include "src/storage/compression/chimp/flag_buffer.cpp" 6 | 7 | #include "src/storage/compression/chimp/leading_zero_buffer.cpp" 8 | 9 | #include "src/storage/compression/chimp/chimp.cpp" 10 | 11 | -------------------------------------------------------------------------------- /R/dbCommit__duckdb_connection.R: -------------------------------------------------------------------------------- 1 | #' @rdname duckdb_connection-class 2 | #' @inheritParams DBI::dbCommit 3 | #' @usage NULL 4 | dbCommit__duckdb_connection <- function(conn, ...) { 5 | dbExecute(conn, SQL("COMMIT")) 6 | invisible(TRUE) 7 | } 8 | 9 | #' @rdname duckdb_connection-class 10 | #' @export 11 | setMethod("dbCommit", "duckdb_connection", dbCommit__duckdb_connection) 12 | -------------------------------------------------------------------------------- /src/duckdb/ub_src_optimizer_compressed_materialization.cpp: -------------------------------------------------------------------------------- 1 | #include "src/optimizer/compressed_materialization/compress_aggregate.cpp" 2 | 3 | #include "src/optimizer/compressed_materialization/compress_comparison_join.cpp" 4 | 5 | #include "src/optimizer/compressed_materialization/compress_distinct.cpp" 6 | 7 | #include "src/optimizer/compressed_materialization/compress_order.cpp" 8 | 9 | -------------------------------------------------------------------------------- /R/dbBegin__duckdb_connection.R: -------------------------------------------------------------------------------- 1 | #' @rdname duckdb_connection-class 2 | #' @inheritParams DBI::dbBegin 3 | #' @usage NULL 4 | dbBegin__duckdb_connection <- function(conn, ...) { 5 | dbExecute(conn, SQL("BEGIN TRANSACTION")) 6 | invisible(TRUE) 7 | } 8 | 9 | #' @rdname duckdb_connection-class 10 | #' @export 11 | setMethod("dbBegin", "duckdb_connection", dbBegin__duckdb_connection) 12 | -------------------------------------------------------------------------------- /src/duckdb/src/include/duckdb/common/algorithm.hpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // DuckDB 3 | // 4 | // duckdb/common/algorithm.hpp 5 | // 6 | // 7 | //===----------------------------------------------------------------------===// 8 | 9 | #pragma once 10 | 11 | #include 12 | #include 13 | -------------------------------------------------------------------------------- /R/dbRollback__duckdb_connection.R: -------------------------------------------------------------------------------- 1 | #' @rdname duckdb_connection-class 2 | #' @inheritParams DBI::dbRollback 3 | #' @usage NULL 4 | dbRollback__duckdb_connection <- function(conn, ...) { 5 | dbExecute(conn, SQL("ROLLBACK")) 6 | invisible(TRUE) 7 | } 8 | 9 | #' @rdname duckdb_connection-class 10 | #' @export 11 | setMethod("dbRollback", "duckdb_connection", dbRollback__duckdb_connection) 12 | -------------------------------------------------------------------------------- /src/duckdb/src/include/duckdb/main/extension_util.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace duckdb { 4 | 5 | #ifndef DUCKDB_CLANG_TIDY 6 | // NOLINTBEGIN 7 | static_assert(false, "The DuckDB 'ExtensionUtil' class has been removed, see this PR for more details: " 8 | "https://github.com/duckdb/duckdb/pull/17772"); 9 | // NOLINTEND 10 | #endif 11 | 12 | } // namespace duckdb 13 | -------------------------------------------------------------------------------- /src/include/from-tar.mk: -------------------------------------------------------------------------------- 1 | # This file is used from Makevars if $DUCKDB_R_PREBUILT_ARCHIVE points 2 | # to an existing file. 3 | # We print details on the object files already extracted in the configure script 4 | # for diagnostic purposes. 5 | all: duckdb.tar 6 | duckdb.tar: $(DUCKDB_R_PREBUILT_ARCHIVE) 7 | ls -lR 8 | # Ensure the file is recreated in the next run 9 | rm -f Makevars.duckdb 10 | -------------------------------------------------------------------------------- /src/duckdb/src/include/duckdb/common/to_string.hpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // DuckDB 3 | // 4 | // duckdb/common/to_string.hpp 5 | // 6 | // 7 | //===----------------------------------------------------------------------===// 8 | 9 | #pragma once 10 | 11 | namespace duckdb { 12 | using std::to_string; 13 | } 14 | -------------------------------------------------------------------------------- /src/duckdb/src/planner/binder/tableref/plan_basetableref.cpp: -------------------------------------------------------------------------------- 1 | #include "duckdb/planner/binder.hpp" 2 | #include "duckdb/planner/operator/logical_get.hpp" 3 | #include "duckdb/planner/tableref/bound_basetableref.hpp" 4 | 5 | namespace duckdb { 6 | 7 | unique_ptr Binder::CreatePlan(BoundBaseTableRef &ref) { 8 | return std::move(ref.get); 9 | } 10 | 11 | } // namespace duckdb 12 | -------------------------------------------------------------------------------- /src/duckdb/ub_src_common_types_column.cpp: -------------------------------------------------------------------------------- 1 | #include "src/common/types/column/column_data_allocator.cpp" 2 | 3 | #include "src/common/types/column/column_data_collection.cpp" 4 | 5 | #include "src/common/types/column/column_data_collection_segment.cpp" 6 | 7 | #include "src/common/types/column/column_data_consumer.cpp" 8 | 9 | #include "src/common/types/column/partitioned_column_data.cpp" 10 | 11 | -------------------------------------------------------------------------------- /src/include/to-tar.mk: -------------------------------------------------------------------------------- 1 | # This file is used from Makevars if $DUCKDB_R_PREBUILT_ARCHIVE is empty 2 | # or does not point to an existing file. 3 | # In the latter case, we create the file after the object files have been built. 4 | all: duckdb.tar 5 | duckdb.tar: $(SOURCES) 6 | if [ -n "$(DUCKDB_R_PREBUILT_ARCHIVE)" ]; then tar -cv -f "$(DUCKDB_R_PREBUILT_ARCHIVE)" $(SOURCES); fi 7 | rm -f Makevars.duckdb 8 | -------------------------------------------------------------------------------- /src/duckdb/ub_src_catalog_default.cpp: -------------------------------------------------------------------------------- 1 | #include "src/catalog/default/default_functions.cpp" 2 | 3 | #include "src/catalog/default/default_generator.cpp" 4 | 5 | #include "src/catalog/default/default_schemas.cpp" 6 | 7 | #include "src/catalog/default/default_table_functions.cpp" 8 | 9 | #include "src/catalog/default/default_types.cpp" 10 | 11 | #include "src/catalog/default/default_views.cpp" 12 | 13 | -------------------------------------------------------------------------------- /src/duckdb/src/include/duckdb/common/exception/list.hpp: -------------------------------------------------------------------------------- 1 | #include "duckdb/common/exception/binder_exception.hpp" 2 | #include "duckdb/common/exception/catalog_exception.hpp" 3 | #include "duckdb/common/exception/conversion_exception.hpp" 4 | #include "duckdb/common/exception/http_exception.hpp" 5 | #include "duckdb/common/exception/parser_exception.hpp" 6 | #include "duckdb/common/exception/transaction_exception.hpp" 7 | -------------------------------------------------------------------------------- /src/duckdb/src/include/duckdb/common/list.hpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // DuckDB 3 | // 4 | // duckdb/common/list.hpp 5 | // 6 | // 7 | //===----------------------------------------------------------------------===// 8 | 9 | #pragma once 10 | 11 | #include 12 | 13 | namespace duckdb { 14 | using std::list; 15 | } 16 | -------------------------------------------------------------------------------- /src/duckdb/src/include/duckdb/common/array.hpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // DuckDB 3 | // 4 | // duckdb/common/array.hpp 5 | // 6 | // 7 | //===----------------------------------------------------------------------===// 8 | 9 | #pragma once 10 | 11 | #include 12 | 13 | namespace duckdb { 14 | using std::array; 15 | } 16 | -------------------------------------------------------------------------------- /src/duckdb/src/include/duckdb/common/deque.hpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // DuckDB 3 | // 4 | // duckdb/common/deque.hpp 5 | // 6 | // 7 | //===----------------------------------------------------------------------===// 8 | 9 | #pragma once 10 | 11 | #include 12 | 13 | namespace duckdb { 14 | using std::deque; 15 | } 16 | -------------------------------------------------------------------------------- /src/duckdb/src/include/duckdb/common/stack.hpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // DuckDB 3 | // 4 | // duckdb/common/stack.hpp 5 | // 6 | // 7 | //===----------------------------------------------------------------------===// 8 | 9 | #pragma once 10 | 11 | #include 12 | 13 | namespace duckdb { 14 | using std::stack; 15 | } 16 | -------------------------------------------------------------------------------- /src/duckdb/src/include/duckdb/common/swap.hpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // DuckDB 3 | // 4 | // duckdb/common/swap.hpp 5 | // 6 | // 7 | //===----------------------------------------------------------------------===// 8 | 9 | #pragma once 10 | 11 | #include 12 | 13 | namespace duckdb { 14 | using std::swap; 15 | } 16 | -------------------------------------------------------------------------------- /src/duckdb/src/include/duckdb/storage/compression/patas/shared.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace duckdb { 4 | 5 | class PatasPrimitives { 6 | public: 7 | static constexpr uint32_t PATAS_GROUP_SIZE = 1024; 8 | static constexpr uint8_t HEADER_SIZE = sizeof(uint32_t); 9 | static constexpr uint8_t BYTECOUNT_BITSIZE = 3; 10 | static constexpr uint8_t INDEX_BITSIZE = 7; 11 | }; 12 | 13 | } // namespace duckdb 14 | -------------------------------------------------------------------------------- /src/duckdb/src/storage/table/persistent_table_data.cpp: -------------------------------------------------------------------------------- 1 | #include "duckdb/storage/table/persistent_table_data.hpp" 2 | #include "duckdb/storage/statistics/base_statistics.hpp" 3 | 4 | namespace duckdb { 5 | 6 | PersistentTableData::PersistentTableData(idx_t column_count) : total_rows(0), row_group_count(0) { 7 | } 8 | 9 | PersistentTableData::~PersistentTableData() { 10 | } 11 | 12 | } // namespace duckdb 13 | -------------------------------------------------------------------------------- /src/duckdb/third_party/snappy/snappy_version.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | //! The new version of snappy is much faster when compiled with clang, but slower when compiled with GCC 4 | //! For DuckDB, we default to the old version if the compiler is not clang 5 | #ifndef SNAPPY_NEW_VERSION 6 | #ifdef __clang__ 7 | #define SNAPPY_NEW_VERSION true 8 | #else 9 | #define SNAPPY_NEW_VERSION false 10 | #endif 11 | #endif 12 | -------------------------------------------------------------------------------- /src/duckdb/src/include/duckdb/common/bitset.hpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // DuckDB 3 | // 4 | // duckdb/common/bitset.hpp 5 | // 6 | // 7 | //===----------------------------------------------------------------------===// 8 | 9 | #pragma once 10 | 11 | #include 12 | 13 | namespace duckdb { 14 | using std::bitset; 15 | } 16 | -------------------------------------------------------------------------------- /src/duckdb/src/include/duckdb/common/thread.hpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // DuckDB 3 | // 4 | // duckdb/common/thread.hpp 5 | // 6 | // 7 | //===----------------------------------------------------------------------===// 8 | 9 | #pragma once 10 | 11 | #include 12 | 13 | namespace duckdb { 14 | using std::thread; 15 | } 16 | -------------------------------------------------------------------------------- /src/duckdb/src/planner/binder/tableref/bind_emptytableref.cpp: -------------------------------------------------------------------------------- 1 | #include "duckdb/parser/tableref/emptytableref.hpp" 2 | #include "duckdb/planner/binder.hpp" 3 | #include "duckdb/planner/tableref/bound_dummytableref.hpp" 4 | 5 | namespace duckdb { 6 | 7 | unique_ptr Binder::Bind(EmptyTableRef &ref) { 8 | return make_uniq(GenerateTableIndex()); 9 | } 10 | 11 | } // namespace duckdb 12 | -------------------------------------------------------------------------------- /src/duckdb/ub_src_common_arrow_appender.cpp: -------------------------------------------------------------------------------- 1 | #include "src/common/arrow/appender/bool_data.cpp" 2 | 3 | #include "src/common/arrow/appender/fixed_size_list_data.cpp" 4 | 5 | #include "src/common/arrow/appender/null_data.cpp" 6 | 7 | #include "src/common/arrow/appender/struct_data.cpp" 8 | 9 | #include "src/common/arrow/appender/union_data.cpp" 10 | 11 | #include "src/common/arrow/appender/append_data.cpp" 12 | 13 | -------------------------------------------------------------------------------- /src/duckdb/ub_src_common_serializer.cpp: -------------------------------------------------------------------------------- 1 | #include "src/common/serializer/binary_serializer.cpp" 2 | 3 | #include "src/common/serializer/binary_deserializer.cpp" 4 | 5 | #include "src/common/serializer/buffered_file_reader.cpp" 6 | 7 | #include "src/common/serializer/buffered_file_writer.cpp" 8 | 9 | #include "src/common/serializer/memory_stream.cpp" 10 | 11 | #include "src/common/serializer/serializer.cpp" 12 | 13 | -------------------------------------------------------------------------------- /src/include/to-tar-win.mk: -------------------------------------------------------------------------------- 1 | # This file is used from Makevars if $DUCKDB_R_PREBUILT_ARCHIVE is empty 2 | # or does not point to an existing file. 3 | # In the latter case, we create the file after the object files have been built. 4 | all: duckdb.tar 5 | duckdb.tar: $(SOURCES) 6 | if [ -n "$(DUCKDB_R_PREBUILT_ARCHIVE)" ]; then tar -cv --force-local -f "$(DUCKDB_R_PREBUILT_ARCHIVE)" $(SOURCES); fi 7 | rm -f Makevars.duckdb 8 | -------------------------------------------------------------------------------- /.github/workflows/dep-suggests-matrix/action.yml: -------------------------------------------------------------------------------- 1 | name: "Actions to compute a matrix with all suggested packages" 2 | outputs: 3 | matrix: 4 | description: "Generated matrix" 5 | value: ${{ steps.set-matrix.outputs.matrix }} 6 | 7 | runs: 8 | using: "composite" 9 | steps: 10 | - id: set-matrix 11 | run: | 12 | Rscript ./.github/workflows/dep-suggests-matrix/action.R 13 | shell: bash 14 | -------------------------------------------------------------------------------- /src/duckdb/src/execution/operator/scan/physical_empty_result.cpp: -------------------------------------------------------------------------------- 1 | #include "duckdb/execution/operator/scan/physical_empty_result.hpp" 2 | 3 | namespace duckdb { 4 | 5 | SourceResultType PhysicalEmptyResult::GetData(ExecutionContext &context, DataChunk &chunk, 6 | OperatorSourceInput &input) const { 7 | return SourceResultType::FINISHED; 8 | } 9 | 10 | } // namespace duckdb 11 | -------------------------------------------------------------------------------- /src/duckdb/src/storage/compression/chimp/chimp_constants.cpp: -------------------------------------------------------------------------------- 1 | #include "duckdb/storage/compression/chimp/algorithm/chimp_utils.hpp" 2 | 3 | namespace duckdb { 4 | 5 | constexpr uint8_t ChimpConstants::Compression::LEADING_ROUND[]; 6 | constexpr uint8_t ChimpConstants::Compression::LEADING_REPRESENTATION[]; 7 | 8 | constexpr uint8_t ChimpConstants::Decompression::LEADING_REPRESENTATION[]; 9 | 10 | } // namespace duckdb 11 | -------------------------------------------------------------------------------- /src/duckdb/ub_src_common_multi_file.cpp: -------------------------------------------------------------------------------- 1 | #include "src/common/multi_file/base_file_reader.cpp" 2 | 3 | #include "src/common/multi_file/multi_file_function.cpp" 4 | 5 | #include "src/common/multi_file/multi_file_list.cpp" 6 | 7 | #include "src/common/multi_file/multi_file_reader.cpp" 8 | 9 | #include "src/common/multi_file/multi_file_column_mapper.cpp" 10 | 11 | #include "src/common/multi_file/union_by_name.cpp" 12 | 13 | -------------------------------------------------------------------------------- /src/duckdb/src/include/duckdb/planner/filter/list.hpp: -------------------------------------------------------------------------------- 1 | #include "duckdb/planner/filter/conjunction_filter.hpp" 2 | #include "duckdb/planner/filter/constant_filter.hpp" 3 | #include "duckdb/planner/filter/dynamic_filter.hpp" 4 | #include "duckdb/planner/filter/in_filter.hpp" 5 | #include "duckdb/planner/filter/null_filter.hpp" 6 | #include "duckdb/planner/filter/optional_filter.hpp" 7 | #include "duckdb/planner/filter/struct_filter.hpp" 8 | -------------------------------------------------------------------------------- /.github/workflows/rate-limit/action.yml: -------------------------------------------------------------------------------- 1 | name: "Check GitHub rate limits" 2 | inputs: 3 | token: # id of input 4 | description: GitHub token, pass secrets.GITHUB_TOKEN 5 | required: true 6 | 7 | runs: 8 | using: "composite" 9 | steps: 10 | - name: Check rate limits 11 | run: | 12 | curl -s --header "authorization: Bearer ${{ inputs.token }}" https://api.github.com/rate_limit 13 | shell: bash 14 | -------------------------------------------------------------------------------- /man/deprecated.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/csv.R 3 | \name{read_csv_duckdb} 4 | \alias{read_csv_duckdb} 5 | \title{Deprecated functions} 6 | \usage{ 7 | read_csv_duckdb(conn, files, tablename, ...) 8 | } 9 | \description{ 10 | \code{read_csv_duckdb()} has been superseded by \code{duckdb_read_csv()}. 11 | The order of the arguments has changed. 12 | } 13 | \keyword{internal} 14 | -------------------------------------------------------------------------------- /src/duckdb/src/include/duckdb/common/queue.hpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // DuckDB 3 | // 4 | // duckdb/common/queue.hpp 5 | // 6 | // 7 | //===----------------------------------------------------------------------===// 8 | 9 | #pragma once 10 | 11 | #include 12 | 13 | namespace duckdb { 14 | using std::queue; 15 | } // namespace duckdb 16 | -------------------------------------------------------------------------------- /src/duckdb/src/planner/binder/tableref/plan_dummytableref.cpp: -------------------------------------------------------------------------------- 1 | #include "duckdb/planner/binder.hpp" 2 | #include "duckdb/planner/operator/logical_dummy_scan.hpp" 3 | #include "duckdb/planner/tableref/bound_dummytableref.hpp" 4 | 5 | namespace duckdb { 6 | 7 | unique_ptr Binder::CreatePlan(BoundEmptyTableRef &ref) { 8 | return make_uniq(ref.bind_index); 9 | } 10 | 11 | } // namespace duckdb 12 | -------------------------------------------------------------------------------- /cleanup: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -ex 4 | 5 | # Check if the archive already exists 6 | if [ -f "src/duckdb.tar.xz" ]; then 7 | echo "duckdb.tar.xz already exists. Skipping compression." 8 | exit 0 9 | fi 10 | 11 | # For CI/CD: only compress if expansion is possible too 12 | if which xz > /dev/null; then 13 | if [ -d .git ]; then git clean -fdx src; fi 14 | cd src 15 | tar cvJf duckdb.tar.xz duckdb 16 | rm -rf duckdb 17 | fi 18 | -------------------------------------------------------------------------------- /src/duckdb/src/parser/constraint.cpp: -------------------------------------------------------------------------------- 1 | #include "duckdb/parser/constraint.hpp" 2 | 3 | #include "duckdb/common/printer.hpp" 4 | #include "duckdb/parser/constraints/list.hpp" 5 | 6 | namespace duckdb { 7 | 8 | Constraint::Constraint(ConstraintType type) : type(type) { 9 | } 10 | 11 | Constraint::~Constraint() { 12 | } 13 | 14 | void Constraint::Print() const { 15 | Printer::Print(ToString()); 16 | } 17 | 18 | } // namespace duckdb 19 | -------------------------------------------------------------------------------- /R/dbGetRowCount__duckdb_result.R: -------------------------------------------------------------------------------- 1 | #' @rdname duckdb_result-class 2 | #' @inheritParams DBI::dbGetRowCount 3 | #' @usage NULL 4 | dbGetRowCount__duckdb_result <- function(res, ...) { 5 | if (!res@env$open) { 6 | stop("result has already been cleared") 7 | } 8 | return(res@env$rows_fetched) 9 | } 10 | 11 | #' @rdname duckdb_result-class 12 | #' @export 13 | setMethod("dbGetRowCount", "duckdb_result", dbGetRowCount__duckdb_result) 14 | -------------------------------------------------------------------------------- /R/dbGetStatement__duckdb_result.R: -------------------------------------------------------------------------------- 1 | #' @rdname duckdb_result-class 2 | #' @inheritParams DBI::dbGetStatement 3 | #' @usage NULL 4 | dbGetStatement__duckdb_result <- function(res, ...) { 5 | if (!res@env$open) { 6 | stop("result has already been cleared") 7 | } 8 | return(res@stmt_lst$str) 9 | } 10 | 11 | #' @rdname duckdb_result-class 12 | #' @export 13 | setMethod("dbGetStatement", "duckdb_result", dbGetStatement__duckdb_result) 14 | -------------------------------------------------------------------------------- /R/show__duckdb_connection.R: -------------------------------------------------------------------------------- 1 | #' @rdname duckdb_connection-class 2 | #' @inheritParams methods::show 3 | #' @usage NULL 4 | show__duckdb_connection <- function(object) { 5 | message(sprintf("", extptr_str(object@conn_ref), drv_to_string(object@driver))) 6 | invisible(NULL) 7 | } 8 | 9 | #' @rdname duckdb_connection-class 10 | #' @export 11 | setMethod("show", "duckdb_connection", show__duckdb_connection) 12 | -------------------------------------------------------------------------------- /src/duckdb/src/include/duckdb/common/unordered_map.hpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // DuckDB 3 | // 4 | // duckdb/common/unordered_map.hpp 5 | // 6 | // 7 | //===----------------------------------------------------------------------===// 8 | 9 | #pragma once 10 | 11 | #include 12 | 13 | namespace duckdb { 14 | using std::unordered_map; 15 | } 16 | -------------------------------------------------------------------------------- /src/duckdb/src/include/duckdb/common/unordered_set.hpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // DuckDB 3 | // 4 | // duckdb/common/unordered_set.hpp 5 | // 6 | // 7 | //===----------------------------------------------------------------------===// 8 | 9 | #pragma once 10 | 11 | #include 12 | 13 | namespace duckdb { 14 | using std::unordered_set; 15 | } 16 | -------------------------------------------------------------------------------- /src/duckdb/src/parser/tableref/emptytableref.cpp: -------------------------------------------------------------------------------- 1 | #include "duckdb/parser/tableref/emptytableref.hpp" 2 | 3 | namespace duckdb { 4 | 5 | string EmptyTableRef::ToString() const { 6 | return ""; 7 | } 8 | 9 | bool EmptyTableRef::Equals(const TableRef &other) const { 10 | return TableRef::Equals(other); 11 | } 12 | 13 | unique_ptr EmptyTableRef::Copy() { 14 | return make_uniq(); 15 | } 16 | 17 | } // namespace duckdb 18 | -------------------------------------------------------------------------------- /src/duckdb/ub_src_common_tree_renderer.cpp: -------------------------------------------------------------------------------- 1 | #include "src/common/tree_renderer/json_tree_renderer.cpp" 2 | 3 | #include "src/common/tree_renderer/html_tree_renderer.cpp" 4 | 5 | #include "src/common/tree_renderer/graphviz_tree_renderer.cpp" 6 | 7 | #include "src/common/tree_renderer/text_tree_renderer.cpp" 8 | 9 | #include "src/common/tree_renderer/yaml_tree_renderer.cpp" 10 | 11 | #include "src/common/tree_renderer/tree_renderer.cpp" 12 | 13 | -------------------------------------------------------------------------------- /src/duckdb/src/include/duckdb/common/map.hpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // DuckDB 3 | // 4 | // duckdb/common/map.hpp 5 | // 6 | // 7 | //===----------------------------------------------------------------------===// 8 | 9 | #pragma once 10 | 11 | #include 12 | 13 | namespace duckdb { 14 | using std::map; 15 | using std::multimap; 16 | } // namespace duckdb 17 | -------------------------------------------------------------------------------- /src/duckdb/src/include/duckdb/common/set.hpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // DuckDB 3 | // 4 | // duckdb/common/set.hpp 5 | // 6 | // 7 | //===----------------------------------------------------------------------===// 8 | 9 | #pragma once 10 | 11 | #include 12 | 13 | namespace duckdb { 14 | using std::multiset; 15 | using std::set; 16 | } // namespace duckdb 17 | -------------------------------------------------------------------------------- /src/duckdb/src/include/duckdb/function/table/arrow/enum/arrow_variable_size_type.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace duckdb { 4 | 5 | //===--------------------------------------------------------------------===// 6 | // Arrow Variable Size Types 7 | //===--------------------------------------------------------------------===// 8 | enum class ArrowVariableSizeType : uint8_t { NORMAL, FIXED_SIZE, SUPER_SIZE, VIEW }; 9 | 10 | } // namespace duckdb 11 | -------------------------------------------------------------------------------- /src/duckdb/src/execution/physical_plan/plan_reset.cpp: -------------------------------------------------------------------------------- 1 | #include "duckdb/execution/physical_plan_generator.hpp" 2 | #include "duckdb/planner/operator/logical_reset.hpp" 3 | #include "duckdb/execution/operator/helper/physical_reset.hpp" 4 | 5 | namespace duckdb { 6 | 7 | PhysicalOperator &PhysicalPlanGenerator::CreatePlan(LogicalReset &op) { 8 | return Make(op.name, op.scope, op.estimated_cardinality); 9 | } 10 | 11 | } // namespace duckdb 12 | -------------------------------------------------------------------------------- /src/duckdb/src/include/duckdb/common/common.hpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // DuckDB 3 | // 4 | // duckdb/common/common.hpp 5 | // 6 | // 7 | //===----------------------------------------------------------------------===// 8 | 9 | #pragma once 10 | 11 | #include "duckdb/common/constants.hpp" 12 | #include "duckdb/common/helper.hpp" 13 | #include "duckdb/common/vector.hpp" 14 | -------------------------------------------------------------------------------- /src/duckdb/src/include/duckdb/common/pair.hpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // DuckDB 3 | // 4 | // duckdb/common/pair.hpp 5 | // 6 | // 7 | //===----------------------------------------------------------------------===// 8 | 9 | #pragma once 10 | 11 | #include 12 | 13 | namespace duckdb { 14 | using std::make_pair; 15 | using std::pair; 16 | } // namespace duckdb 17 | -------------------------------------------------------------------------------- /src/duckdb/ub_src_function_scalar_system.cpp: -------------------------------------------------------------------------------- 1 | #include "src/function/scalar/system/aggregate_export.cpp" 2 | 3 | #include "src/function/scalar/system/write_log.cpp" 4 | 5 | #include "src/function/scalar/system/current_transaction_id.cpp" 6 | 7 | #include "src/function/scalar/system/current_connection_id.cpp" 8 | 9 | #include "src/function/scalar/system/current_query_id.cpp" 10 | 11 | #include "src/function/scalar/system/parse_log_message.cpp" 12 | 13 | -------------------------------------------------------------------------------- /R/show__duckdb_result.R: -------------------------------------------------------------------------------- 1 | #' @rdname duckdb_result-class 2 | #' @inheritParams methods::show 3 | #' @usage NULL 4 | show__duckdb_result <- function(object) { 5 | message(sprintf("", extptr_str(object@stmt_lst$ref), extptr_str(object@connection@conn_ref), object@stmt_lst$str)) 6 | invisible(NULL) 7 | } 8 | 9 | #' @rdname duckdb_result-class 10 | #' @export 11 | setMethod("show", "duckdb_result", show__duckdb_result) 12 | -------------------------------------------------------------------------------- /src/duckdb/src/execution/physical_plan/plan_pragma.cpp: -------------------------------------------------------------------------------- 1 | #include "duckdb/execution/physical_plan_generator.hpp" 2 | #include "duckdb/planner/operator/logical_pragma.hpp" 3 | 4 | #include "duckdb/execution/operator/helper/physical_pragma.hpp" 5 | namespace duckdb { 6 | 7 | PhysicalOperator &PhysicalPlanGenerator::CreatePlan(LogicalPragma &op) { 8 | return Make(std::move(op.info), op.estimated_cardinality); 9 | } 10 | 11 | } // namespace duckdb 12 | -------------------------------------------------------------------------------- /src/duckdb/src/storage/statistics/segment_statistics.cpp: -------------------------------------------------------------------------------- 1 | #include "duckdb/storage/statistics/segment_statistics.hpp" 2 | 3 | #include "duckdb/common/exception.hpp" 4 | 5 | namespace duckdb { 6 | 7 | SegmentStatistics::SegmentStatistics(LogicalType type) : statistics(BaseStatistics::CreateEmpty(std::move(type))) { 8 | } 9 | 10 | SegmentStatistics::SegmentStatistics(BaseStatistics stats) : statistics(std::move(stats)) { 11 | } 12 | 13 | } // namespace duckdb 14 | -------------------------------------------------------------------------------- /R/dbGetInfo__duckdb_result.R: -------------------------------------------------------------------------------- 1 | #' @rdname duckdb_result-class 2 | #' @inheritParams DBI::dbGetInfo 3 | #' @param dbObj An object inheriting from class [duckdb_result-class]. 4 | #' @usage NULL 5 | dbGetInfo__duckdb_result <- function(dbObj, ...) { 6 | # Optional 7 | getMethod("dbGetInfo", "DBIResult", asNamespace("DBI"))(dbObj, ...) 8 | } 9 | 10 | #' @rdname duckdb_result-class 11 | #' @export 12 | setMethod("dbGetInfo", "duckdb_result", dbGetInfo__duckdb_result) 13 | -------------------------------------------------------------------------------- /src/duckdb/src/include/duckdb.hpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // DuckDB 3 | // 4 | // duckdb.hpp 5 | // 6 | // 7 | //===----------------------------------------------------------------------===// 8 | 9 | #pragma once 10 | 11 | #include "duckdb/main/connection.hpp" 12 | #include "duckdb/main/database.hpp" 13 | #include "duckdb/main/query_result.hpp" 14 | #include "duckdb/main/appender.hpp" 15 | -------------------------------------------------------------------------------- /src/duckdb/src/parallel/base_pipeline_event.cpp: -------------------------------------------------------------------------------- 1 | #include "duckdb/parallel/base_pipeline_event.hpp" 2 | 3 | namespace duckdb { 4 | 5 | BasePipelineEvent::BasePipelineEvent(shared_ptr pipeline_p) 6 | : Event(pipeline_p->executor), pipeline(std::move(pipeline_p)) { 7 | } 8 | 9 | BasePipelineEvent::BasePipelineEvent(Pipeline &pipeline_p) 10 | : Event(pipeline_p.executor), pipeline(pipeline_p.shared_from_this()) { 11 | } 12 | 13 | } // namespace duckdb 14 | -------------------------------------------------------------------------------- /src/duckdb/src/storage/compression/alp/alp_constants.cpp: -------------------------------------------------------------------------------- 1 | #include "duckdb/storage/compression/alp/alp_constants.hpp" 2 | 3 | namespace duckdb { 4 | 5 | constexpr int64_t AlpConstants::FACT_ARR[]; 6 | 7 | constexpr float AlpTypedConstants::EXP_ARR[]; 8 | constexpr float AlpTypedConstants::FRAC_ARR[]; 9 | 10 | constexpr double AlpTypedConstants::EXP_ARR[]; 11 | constexpr double AlpTypedConstants::FRAC_ARR[]; 12 | 13 | } // namespace duckdb 14 | -------------------------------------------------------------------------------- /src/duckdb/ub_extension_parquet_decoder.cpp: -------------------------------------------------------------------------------- 1 | #include "extension/parquet/decoder/byte_stream_split_decoder.cpp" 2 | 3 | #include "extension/parquet/decoder/delta_binary_packed_decoder.cpp" 4 | 5 | #include "extension/parquet/decoder/delta_byte_array_decoder.cpp" 6 | 7 | #include "extension/parquet/decoder/delta_length_byte_array_decoder.cpp" 8 | 9 | #include "extension/parquet/decoder/dictionary_decoder.cpp" 10 | 11 | #include "extension/parquet/decoder/rle_decoder.cpp" 12 | 13 | -------------------------------------------------------------------------------- /src/duckdb/src/planner/binder/expression/bind_constant_expression.cpp: -------------------------------------------------------------------------------- 1 | #include "duckdb/parser/expression/constant_expression.hpp" 2 | #include "duckdb/planner/expression/bound_constant_expression.hpp" 3 | #include "duckdb/planner/expression_binder.hpp" 4 | 5 | namespace duckdb { 6 | 7 | BindResult ExpressionBinder::BindExpression(ConstantExpression &expr, idx_t depth) { 8 | return BindResult(make_uniq(expr.value)); 9 | } 10 | 11 | } // namespace duckdb 12 | -------------------------------------------------------------------------------- /revdep/cran.md: -------------------------------------------------------------------------------- 1 | ## revdepcheck results 2 | 3 | We checked 47 reverse dependencies, comparing R CMD check results across CRAN and dev versions of this package. 4 | 5 | * We saw 2 new problems 6 | * We failed to check 0 packages 7 | 8 | Issues with CRAN packages are summarised below. 9 | 10 | ### New problems 11 | (This reports the first line of each new failure) 12 | 13 | * duckspatial 14 | checking examples ... ERROR 15 | 16 | * motherduck 17 | checking tests ... ERROR 18 | 19 | -------------------------------------------------------------------------------- /src/duckdb/extension/parquet/include/parquet_float16.hpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // DuckDB 3 | // 4 | // parquet_timestamp.hpp 5 | // 6 | // 7 | //===----------------------------------------------------------------------===// 8 | 9 | #pragma once 10 | 11 | #include "duckdb.hpp" 12 | 13 | namespace duckdb { 14 | 15 | float Float16ToFloat32(const uint16_t &float16_value); 16 | 17 | } // namespace duckdb 18 | -------------------------------------------------------------------------------- /src/duckdb/src/planner/binder/tableref/bind_bound_table_ref.cpp: -------------------------------------------------------------------------------- 1 | #include "duckdb/parser/tableref/bound_ref_wrapper.hpp" 2 | 3 | namespace duckdb { 4 | 5 | unique_ptr Binder::Bind(BoundRefWrapper &ref) { 6 | if (!ref.binder || !ref.bound_ref) { 7 | throw InternalException("Rebinding bound ref that was already bound"); 8 | } 9 | bind_context.AddContext(std::move(ref.binder->bind_context)); 10 | return std::move(ref.bound_ref); 11 | } 12 | 13 | } // namespace duckdb 14 | -------------------------------------------------------------------------------- /src/duckdb/src/planner/binder/tableref/plan_delimgetref.cpp: -------------------------------------------------------------------------------- 1 | #include "duckdb/planner/binder.hpp" 2 | #include "duckdb/planner/operator/logical_get.hpp" 3 | #include "duckdb/planner/tableref/bound_basetableref.hpp" 4 | #include "duckdb/planner/operator/logical_delim_get.hpp" 5 | namespace duckdb { 6 | 7 | unique_ptr Binder::CreatePlan(BoundDelimGetRef &ref) { 8 | return make_uniq(ref.bind_index, ref.column_types); 9 | } 10 | 11 | } // namespace duckdb 12 | -------------------------------------------------------------------------------- /src/duckdb/ub_src_execution_operator_scan.cpp: -------------------------------------------------------------------------------- 1 | #include "src/execution/operator/scan/physical_column_data_scan.cpp" 2 | 3 | #include "src/execution/operator/scan/physical_dummy_scan.cpp" 4 | 5 | #include "src/execution/operator/scan/physical_empty_result.cpp" 6 | 7 | #include "src/execution/operator/scan/physical_expression_scan.cpp" 8 | 9 | #include "src/execution/operator/scan/physical_positional_scan.cpp" 10 | 11 | #include "src/execution/operator/scan/physical_table_scan.cpp" 12 | 13 | -------------------------------------------------------------------------------- /tests/testthat/test-date.R: -------------------------------------------------------------------------------- 1 | 2 | 3 | test_that("Conversion of sub-dates prior Posix origin is correct", { 4 | con <- local_con() 5 | 6 | df <- data.frame( 7 | d = as.Date(c(-1.1, -0.1, 0, 0.1, 1.1), origin = "1970-01-01") 8 | ) 9 | 10 | duckdb_register(con, "df", df) 11 | withr::defer(duckdb_unregister(con, "df")) 12 | 13 | res <- dbGetQuery(con, "FROM df") 14 | 15 | expect_identical( 16 | as.character(df$d), 17 | as.character(res$d) 18 | ) 19 | }) 20 | 21 | -------------------------------------------------------------------------------- /pkgdown/favicon/safari-pinned-tab.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/duckdb/src/execution/physical_plan/plan_create_secret.cpp: -------------------------------------------------------------------------------- 1 | #include "duckdb/execution/physical_plan_generator.hpp" 2 | #include "duckdb/planner/operator/logical_create_secret.hpp" 3 | #include "duckdb/execution/operator/helper/physical_create_secret.hpp" 4 | 5 | namespace duckdb { 6 | 7 | PhysicalOperator &PhysicalPlanGenerator::CreatePlan(LogicalCreateSecret &op) { 8 | return Make(op.secret_input, op.estimated_cardinality); 9 | } 10 | 11 | } // namespace duckdb 12 | -------------------------------------------------------------------------------- /src/duckdb/src/parser/transform/statement/transform_call.cpp: -------------------------------------------------------------------------------- 1 | #include "duckdb/parser/statement/call_statement.hpp" 2 | #include "duckdb/parser/transformer.hpp" 3 | 4 | namespace duckdb { 5 | 6 | unique_ptr Transformer::TransformCall(duckdb_libpgquery::PGCallStmt &stmt) { 7 | auto result = make_uniq(); 8 | result->function = TransformFuncCall(*PGPointerCast(stmt.func)); 9 | return result; 10 | } 11 | 12 | } // namespace duckdb 13 | -------------------------------------------------------------------------------- /R/dbListTables__duckdb_connection.R: -------------------------------------------------------------------------------- 1 | #' @rdname duckdb_connection-class 2 | #' @inheritParams DBI::dbListTables 3 | #' @usage NULL 4 | dbListTables__duckdb_connection <- function(conn, ...) { 5 | dbGetQuery( 6 | conn, 7 | SQL( 8 | "SELECT name FROM sqlite_master WHERE type='table' OR type='view' ORDER BY name" 9 | ) 10 | )[[1]] 11 | } 12 | 13 | #' @rdname duckdb_connection-class 14 | #' @export 15 | setMethod("dbListTables", "duckdb_connection", dbListTables__duckdb_connection) 16 | -------------------------------------------------------------------------------- /src/duckdb/src/common/assert.cpp: -------------------------------------------------------------------------------- 1 | #include "duckdb/common/assert.hpp" 2 | #include "duckdb/common/exception.hpp" 3 | 4 | namespace duckdb { 5 | 6 | void DuckDBAssertInternal(bool condition, const char *condition_name, const char *file, int linenr) { 7 | #ifdef DISABLE_ASSERTIONS 8 | return; 9 | #endif 10 | if (condition) { 11 | return; 12 | } 13 | throw InternalException("Assertion triggered in file \"%s\" on line %d: %s", file, linenr, condition_name); 14 | } 15 | 16 | } // namespace duckdb 17 | -------------------------------------------------------------------------------- /src/duckdb/ub_src_planner_filter.cpp: -------------------------------------------------------------------------------- 1 | #include "src/planner/filter/conjunction_filter.cpp" 2 | 3 | #include "src/planner/filter/constant_filter.cpp" 4 | 5 | #include "src/planner/filter/dynamic_filter.cpp" 6 | 7 | #include "src/planner/filter/expression_filter.cpp" 8 | 9 | #include "src/planner/filter/in_filter.cpp" 10 | 11 | #include "src/planner/filter/null_filter.cpp" 12 | 13 | #include "src/planner/filter/struct_filter.cpp" 14 | 15 | #include "src/planner/filter/optional_filter.cpp" 16 | 17 | -------------------------------------------------------------------------------- /R/dbColumnInfo__duckdb_result.R: -------------------------------------------------------------------------------- 1 | #' @rdname duckdb_result-class 2 | #' @inheritParams DBI::dbColumnInfo 3 | #' @usage NULL 4 | dbColumnInfo__duckdb_result <- function(res, ...) { 5 | if (!res@env$open) { 6 | stop("result has already been cleared") 7 | } 8 | return(data.frame(name = res@stmt_lst$names, type = res@stmt_lst$rtypes, stringsAsFactors = FALSE)) 9 | } 10 | 11 | #' @rdname duckdb_result-class 12 | #' @export 13 | setMethod("dbColumnInfo", "duckdb_result", dbColumnInfo__duckdb_result) 14 | -------------------------------------------------------------------------------- /src/duckdb/src/execution/physical_plan/plan_dummy_scan.cpp: -------------------------------------------------------------------------------- 1 | #include "duckdb/execution/operator/scan/physical_dummy_scan.hpp" 2 | #include "duckdb/execution/physical_plan_generator.hpp" 3 | #include "duckdb/planner/operator/logical_dummy_scan.hpp" 4 | 5 | namespace duckdb { 6 | 7 | PhysicalOperator &PhysicalPlanGenerator::CreatePlan(LogicalDummyScan &op) { 8 | D_ASSERT(op.children.empty()); 9 | return Make(op.types, op.estimated_cardinality); 10 | } 11 | 12 | } // namespace duckdb 13 | -------------------------------------------------------------------------------- /tests/testthat/test-register_readonly.R: -------------------------------------------------------------------------------- 1 | test_that("we can register a data frame on a read only connection", { 2 | path <- tempfile() 3 | # create empty database 4 | con <- dbConnect(duckdb(), dbdir = path, read_only = FALSE) 5 | dbDisconnect(con, shutdown = TRUE) 6 | 7 | # reopen database read-only, try to write temp table 8 | con <- dbConnect(duckdb(), dbdir = path, read_only = TRUE) 9 | expect_true(duckdb_register(con, "mtcars", mtcars)) 10 | dbDisconnect(con, shutdown = TRUE) 11 | }) 12 | -------------------------------------------------------------------------------- /src/duckdb/src/execution/physical_plan/plan_copy_database.cpp: -------------------------------------------------------------------------------- 1 | #include "duckdb/execution/physical_plan_generator.hpp" 2 | #include "duckdb/planner/operator/logical_copy_database.hpp" 3 | #include "duckdb/execution/operator/persistent/physical_copy_database.hpp" 4 | 5 | namespace duckdb { 6 | 7 | PhysicalOperator &PhysicalPlanGenerator::CreatePlan(LogicalCopyDatabase &op) { 8 | return Make(op.types, op.estimated_cardinality, std::move(op.info)); 9 | } 10 | 11 | } // namespace duckdb 12 | -------------------------------------------------------------------------------- /src/duckdb/src/execution/operator/scan/physical_dummy_scan.cpp: -------------------------------------------------------------------------------- 1 | #include "duckdb/execution/operator/scan/physical_dummy_scan.hpp" 2 | 3 | namespace duckdb { 4 | 5 | SourceResultType PhysicalDummyScan::GetData(ExecutionContext &context, DataChunk &chunk, 6 | OperatorSourceInput &input) const { 7 | // return a single row on the first call to the dummy scan 8 | chunk.SetCardinality(1); 9 | 10 | return SourceResultType::FINISHED; 11 | } 12 | 13 | } // namespace duckdb 14 | -------------------------------------------------------------------------------- /src/duckdb/src/include/duckdb/common/enums/set_type.hpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // DuckDB 3 | // 4 | // duckdb/common/enums/set_type.hpp 5 | // 6 | // 7 | //===----------------------------------------------------------------------===// 8 | 9 | #pragma once 10 | 11 | #include "duckdb/common/constants.hpp" 12 | 13 | namespace duckdb { 14 | 15 | enum class SetType : uint8_t { SET = 0, RESET = 1 }; 16 | 17 | } // namespace duckdb 18 | -------------------------------------------------------------------------------- /src/duckdb/src/execution/physical_plan/plan_empty_result.cpp: -------------------------------------------------------------------------------- 1 | #include "duckdb/execution/operator/scan/physical_empty_result.hpp" 2 | #include "duckdb/execution/physical_plan_generator.hpp" 3 | #include "duckdb/planner/operator/logical_empty_result.hpp" 4 | 5 | namespace duckdb { 6 | 7 | PhysicalOperator &PhysicalPlanGenerator::CreatePlan(LogicalEmptyResult &op) { 8 | D_ASSERT(op.children.size() == 0); 9 | return Make(op.types, op.estimated_cardinality); 10 | } 11 | 12 | } // namespace duckdb 13 | -------------------------------------------------------------------------------- /src/duckdb/src/planner/binder/statement/bind_select.cpp: -------------------------------------------------------------------------------- 1 | #include "duckdb/parser/statement/select_statement.hpp" 2 | #include "duckdb/planner/binder.hpp" 3 | #include "duckdb/planner/bound_query_node.hpp" 4 | 5 | namespace duckdb { 6 | 7 | BoundStatement Binder::Bind(SelectStatement &stmt) { 8 | auto &properties = GetStatementProperties(); 9 | properties.allow_stream_result = true; 10 | properties.return_type = StatementReturnType::QUERY_RESULT; 11 | return Bind(*stmt.node); 12 | } 13 | 14 | } // namespace duckdb 15 | -------------------------------------------------------------------------------- /src/duckdb/src/planner/binder/tableref/plan_pivotref.cpp: -------------------------------------------------------------------------------- 1 | #include "duckdb/planner/tableref/bound_pivotref.hpp" 2 | #include "duckdb/planner/operator/logical_pivot.hpp" 3 | 4 | namespace duckdb { 5 | 6 | unique_ptr Binder::CreatePlan(BoundPivotRef &ref) { 7 | auto subquery = ref.child_binder->CreatePlan(*ref.child); 8 | 9 | auto result = make_uniq(ref.bind_index, std::move(subquery), std::move(ref.bound_pivot)); 10 | return std::move(result); 11 | } 12 | 13 | } // namespace duckdb 14 | -------------------------------------------------------------------------------- /R/dbClearResult__duckdb_result.R: -------------------------------------------------------------------------------- 1 | #' @rdname duckdb_result-class 2 | #' @inheritParams DBI::dbClearResult 3 | #' @usage NULL 4 | dbClearResult__duckdb_result <- function(res, ...) { 5 | if (res@env$open) { 6 | rethrow_rapi_release(res@stmt_lst$ref) 7 | res@env$open <- FALSE 8 | } else { 9 | warning("Result was cleared already") 10 | } 11 | return(invisible(TRUE)) 12 | } 13 | 14 | #' @rdname duckdb_result-class 15 | #' @export 16 | setMethod("dbClearResult", "duckdb_result", dbClearResult__duckdb_result) 17 | -------------------------------------------------------------------------------- /src/duckdb/src/include/duckdb/function/table/arrow/enum/arrow_datetime_type.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace duckdb { 4 | 5 | //===--------------------------------------------------------------------===// 6 | // Arrow Time/Date Types 7 | //===--------------------------------------------------------------------===// 8 | enum class ArrowDateTimeType : uint8_t { 9 | MILLISECONDS, 10 | MICROSECONDS, 11 | NANOSECONDS, 12 | SECONDS, 13 | DAYS, 14 | MONTHS, 15 | MONTH_DAY_NANO 16 | }; 17 | 18 | } // namespace duckdb 19 | -------------------------------------------------------------------------------- /src/duckdb/src/planner/binder/tableref/plan_cteref.cpp: -------------------------------------------------------------------------------- 1 | #include "duckdb/planner/binder.hpp" 2 | #include "duckdb/planner/operator/logical_cteref.hpp" 3 | #include "duckdb/planner/tableref/bound_cteref.hpp" 4 | 5 | namespace duckdb { 6 | 7 | unique_ptr Binder::CreatePlan(BoundCTERef &ref) { 8 | return make_uniq(ref.bind_index, ref.cte_index, ref.types, ref.bound_columns, ref.materialized_cte, 9 | ref.is_recurring); 10 | } 11 | 12 | } // namespace duckdb 13 | -------------------------------------------------------------------------------- /src/duckdb/ub_extension_parquet_writer.cpp: -------------------------------------------------------------------------------- 1 | #include "extension/parquet/writer/array_column_writer.cpp" 2 | 3 | #include "extension/parquet/writer/boolean_column_writer.cpp" 4 | 5 | #include "extension/parquet/writer/decimal_column_writer.cpp" 6 | 7 | #include "extension/parquet/writer/enum_column_writer.cpp" 8 | 9 | #include "extension/parquet/writer/list_column_writer.cpp" 10 | 11 | #include "extension/parquet/writer/primitive_column_writer.cpp" 12 | 13 | #include "extension/parquet/writer/struct_column_writer.cpp" 14 | 15 | -------------------------------------------------------------------------------- /src/duckdb/ub_extension_core_functions_aggregate_holistic.cpp: -------------------------------------------------------------------------------- 1 | #include "extension/core_functions/aggregate/holistic/approx_top_k.cpp" 2 | 3 | #include "extension/core_functions/aggregate/holistic/quantile.cpp" 4 | 5 | #include "extension/core_functions/aggregate/holistic/reservoir_quantile.cpp" 6 | 7 | #include "extension/core_functions/aggregate/holistic/mad.cpp" 8 | 9 | #include "extension/core_functions/aggregate/holistic/approximate_quantile.cpp" 10 | 11 | #include "extension/core_functions/aggregate/holistic/mode.cpp" 12 | 13 | -------------------------------------------------------------------------------- /src/duckdb/ub_src_parser_transform_helpers.cpp: -------------------------------------------------------------------------------- 1 | #include "src/parser/transform/helpers/transform_alias.cpp" 2 | 3 | #include "src/parser/transform/helpers/transform_cte.cpp" 4 | 5 | #include "src/parser/transform/helpers/transform_groupby.cpp" 6 | 7 | #include "src/parser/transform/helpers/transform_orderby.cpp" 8 | 9 | #include "src/parser/transform/helpers/transform_sample.cpp" 10 | 11 | #include "src/parser/transform/helpers/transform_typename.cpp" 12 | 13 | #include "src/parser/transform/helpers/nodetype_to_string.cpp" 14 | 15 | -------------------------------------------------------------------------------- /R/dbGetRowsAffected__duckdb_result.R: -------------------------------------------------------------------------------- 1 | #' @rdname duckdb_result-class 2 | #' @inheritParams DBI::dbGetRowsAffected 3 | #' @usage NULL 4 | dbGetRowsAffected__duckdb_result <- function(res, ...) { 5 | if (!res@env$open) { 6 | stop("result has already been cleared") 7 | } 8 | if (is.null(res@env$resultset)) { 9 | return(NA_integer_) 10 | } 11 | return(res@env$rows_affected) 12 | } 13 | 14 | #' @rdname duckdb_result-class 15 | #' @export 16 | setMethod("dbGetRowsAffected", "duckdb_result", dbGetRowsAffected__duckdb_result) 17 | -------------------------------------------------------------------------------- /R/is_interactive.R: -------------------------------------------------------------------------------- 1 | # Borrowed from rlang 2 | is_interactive <- function() { 3 | opt <- getOption("rlang_interactive") 4 | if (!is.null(opt)) { 5 | return(isTRUE(opt)) 6 | } 7 | if (isTRUE(getOption("knitr.in.progress"))) { 8 | return(FALSE) 9 | } 10 | if (identical(Sys.getenv("TESTTHAT"), "true")) { 11 | return(FALSE) 12 | } 13 | interactive() 14 | } 15 | 16 | local_interactive <- function(value = TRUE, frame = rlang::caller_env()) { 17 | rlang::local_options(rlang_interactive = value, .frame = frame) 18 | } 19 | -------------------------------------------------------------------------------- /src/duckdb/src/include/duckdb/common/enums/collation_type.hpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // DuckDB 3 | // 4 | // duckdb/common/enums/collation_type.hpp 5 | // 6 | // 7 | //===----------------------------------------------------------------------===// 8 | 9 | #pragma once 10 | 11 | #include "duckdb/common/common.hpp" 12 | 13 | namespace duckdb { 14 | 15 | enum class CollationType { ALL_COLLATIONS, COMBINABLE_COLLATIONS }; 16 | 17 | } // namespace duckdb 18 | -------------------------------------------------------------------------------- /src/duckdb/src/include/duckdb/common/enums/copy_option_mode.hpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // DuckDB 3 | // 4 | // duckdb/common/enums/copy_option_mode.hpp 5 | // 6 | // 7 | //===----------------------------------------------------------------------===// 8 | 9 | #pragma once 10 | 11 | #include "duckdb/common/common.hpp" 12 | 13 | namespace duckdb { 14 | 15 | enum class CopyOptionMode { WRITE_ONLY, READ_ONLY, READ_WRITE }; 16 | 17 | } // namespace duckdb 18 | -------------------------------------------------------------------------------- /src/duckdb/src/include/duckdb/common/mutex.hpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // DuckDB 3 | // 4 | // duckdb/common/mutex.hpp 5 | // 6 | // 7 | //===----------------------------------------------------------------------===// 8 | 9 | #pragma once 10 | 11 | #ifdef __MVS__ 12 | #include 13 | #endif 14 | #include 15 | 16 | namespace duckdb { 17 | using std::lock_guard; 18 | using std::mutex; 19 | using std::unique_lock; 20 | } // namespace duckdb 21 | -------------------------------------------------------------------------------- /src/duckdb/ub_extension_parquet_reader.cpp: -------------------------------------------------------------------------------- 1 | #include "extension/parquet/reader/decimal_column_reader.cpp" 2 | 3 | #include "extension/parquet/reader/expression_column_reader.cpp" 4 | 5 | #include "extension/parquet/reader/list_column_reader.cpp" 6 | 7 | #include "extension/parquet/reader/row_number_column_reader.cpp" 8 | 9 | #include "extension/parquet/reader/string_column_reader.cpp" 10 | 11 | #include "extension/parquet/reader/struct_column_reader.cpp" 12 | 13 | #include "extension/parquet/reader/variant_column_reader.cpp" 14 | 15 | -------------------------------------------------------------------------------- /.github/workflows/versions-matrix/action.yml: -------------------------------------------------------------------------------- 1 | name: "Actions to compute a matrix with all R and OS versions" 2 | 3 | outputs: 4 | matrix: 5 | description: "Generated matrix" 6 | value: ${{ steps.set-matrix.outputs.matrix }} 7 | 8 | runs: 9 | using: "composite" 10 | steps: 11 | - name: Install json2yaml 12 | run: | 13 | sudo npm install -g json2yaml 14 | shell: bash 15 | 16 | - id: set-matrix 17 | run: | 18 | Rscript ./.github/workflows/versions-matrix/action.R 19 | shell: bash 20 | -------------------------------------------------------------------------------- /src/duckdb/src/common/types/conflict_info.cpp: -------------------------------------------------------------------------------- 1 | #include "duckdb/common/types/constraint_conflict_info.hpp" 2 | #include "duckdb/storage/index.hpp" 3 | 4 | namespace duckdb { 5 | 6 | bool ConflictInfo::ConflictTargetMatches(Index &index) const { 7 | if (only_check_unique && !index.IsUnique()) { 8 | // We only support ON CONFLICT for PRIMARY KEY/UNIQUE constraints. 9 | return false; 10 | } 11 | if (column_ids.empty()) { 12 | return true; 13 | } 14 | return column_ids == index.GetColumnIdSet(); 15 | } 16 | 17 | } // namespace duckdb 18 | -------------------------------------------------------------------------------- /src/duckdb/src/include/duckdb/common/arrow/nanoarrow/nanoarrow.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "duckdb/common/arrow/nanoarrow/nanoarrow.h" 4 | 5 | // Bring in the symbols from duckdb_nanoarrow into duckdb 6 | namespace duckdb { 7 | 8 | // using duckdb_nanoarrow::ArrowBuffer; //We have a variant of this that should be renamed 9 | using duckdb_nanoarrow::ArrowBufferAllocator; 10 | using duckdb_nanoarrow::ArrowError; 11 | using duckdb_nanoarrow::ArrowSchemaView; 12 | using duckdb_nanoarrow::ArrowStringView; 13 | 14 | } // namespace duckdb 15 | -------------------------------------------------------------------------------- /src/duckdb/src/include/duckdb/common/enums/thread_pin_mode.hpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // DuckDB 3 | // 4 | // duckdb/common/enums/thread_pin_mode.hpp 5 | // 6 | // 7 | //===----------------------------------------------------------------------===// 8 | 9 | #pragma once 10 | 11 | #include "duckdb/common/constants.hpp" 12 | 13 | namespace duckdb { 14 | 15 | enum class ThreadPinMode : uint8_t { OFF = 0, ON = 1, AUTO = 2 }; 16 | 17 | } // namespace duckdb 18 | -------------------------------------------------------------------------------- /src/duckdb/src/planner/binder/statement/bind_relation.cpp: -------------------------------------------------------------------------------- 1 | #include "duckdb/catalog/catalog.hpp" 2 | #include "duckdb/parser/expression/constant_expression.hpp" 3 | #include "duckdb/parser/statement/insert_statement.hpp" 4 | #include "duckdb/parser/query_node/select_node.hpp" 5 | #include "duckdb/planner/binder.hpp" 6 | #include "duckdb/parser/statement/relation_statement.hpp" 7 | 8 | namespace duckdb { 9 | 10 | BoundStatement Binder::Bind(RelationStatement &stmt) { 11 | return stmt.relation->Bind(*this); 12 | } 13 | 14 | } // namespace duckdb 15 | -------------------------------------------------------------------------------- /src/duckdb/src/planner/operator/logical_any_join.cpp: -------------------------------------------------------------------------------- 1 | #include "duckdb/planner/operator/logical_any_join.hpp" 2 | 3 | namespace duckdb { 4 | 5 | LogicalAnyJoin::LogicalAnyJoin(JoinType type) : LogicalJoin(type, LogicalOperatorType::LOGICAL_ANY_JOIN) { 6 | } 7 | 8 | InsertionOrderPreservingMap LogicalAnyJoin::ParamsToString() const { 9 | InsertionOrderPreservingMap result; 10 | result["Condition"] = condition->ToString(); 11 | SetParamsEstimatedCardinality(result); 12 | return result; 13 | } 14 | 15 | } // namespace duckdb 16 | -------------------------------------------------------------------------------- /.github/workflows/get-extra/action.yml: -------------------------------------------------------------------------------- 1 | name: "Action to determine extra packages to be installed" 2 | outputs: 3 | packages: 4 | description: "List of extra packages" 5 | value: ${{ steps.get-extra.outputs.packages }} 6 | 7 | runs: 8 | using: "composite" 9 | steps: 10 | - name: Get extra packages 11 | id: get-extra 12 | run: | 13 | set -x 14 | packages=$( ( grep Config/gha/extra-packages DESCRIPTION || true ) | cut -d " " -f 2) 15 | echo packages=$packages >> $GITHUB_OUTPUT 16 | shell: bash 17 | -------------------------------------------------------------------------------- /src/duckdb/src/include/duckdb/common/checksum.hpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // DuckDB 3 | // 4 | // duckdb/common/checksum.hpp 5 | // 6 | // 7 | //===----------------------------------------------------------------------===// 8 | 9 | #pragma once 10 | 11 | #include "duckdb/common/constants.hpp" 12 | 13 | namespace duckdb { 14 | 15 | //! Compute a checksum over a buffer of size size 16 | uint64_t Checksum(uint8_t *buffer, size_t size); 17 | 18 | } // namespace duckdb 19 | -------------------------------------------------------------------------------- /src/duckdb/src/include/duckdb/common/enums/explain_format.hpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // DuckDB 3 | // 4 | // duckdb/common/enums/explain_format.hpp 5 | // 6 | // 7 | //===----------------------------------------------------------------------===// 8 | 9 | #pragma once 10 | 11 | #include "duckdb/common/typedefs.hpp" 12 | 13 | namespace duckdb { 14 | 15 | enum class ExplainFormat : uint8_t { DEFAULT, TEXT, JSON, HTML, GRAPHVIZ, YAML }; 16 | 17 | } // namespace duckdb 18 | -------------------------------------------------------------------------------- /src/duckdb/src/storage/compression/empty_validity.cpp: -------------------------------------------------------------------------------- 1 | #include "duckdb/function/compression/compression.hpp" 2 | #include "duckdb/storage/compression/empty_validity.hpp" 3 | 4 | namespace duckdb { 5 | 6 | CompressionFunction EmptyValidityCompressionFun::GetFunction(PhysicalType type) { 7 | return EmptyValidityCompression::CreateFunction(); 8 | } 9 | 10 | bool EmptyValidityCompressionFun::TypeIsSupported(const PhysicalType physical_type) { 11 | D_ASSERT(physical_type == PhysicalType::BIT); 12 | return true; 13 | } 14 | 15 | } // namespace duckdb 16 | -------------------------------------------------------------------------------- /src/duckdb/ub_extension_core_functions_scalar_map.cpp: -------------------------------------------------------------------------------- 1 | #include "extension/core_functions/scalar/map/map_keys_values.cpp" 2 | 3 | #include "extension/core_functions/scalar/map/map_extract.cpp" 4 | 5 | #include "extension/core_functions/scalar/map/map_from_entries.cpp" 6 | 7 | #include "extension/core_functions/scalar/map/map_entries.cpp" 8 | 9 | #include "extension/core_functions/scalar/map/map.cpp" 10 | 11 | #include "extension/core_functions/scalar/map/map_concat.cpp" 12 | 13 | #include "extension/core_functions/scalar/map/cardinality.cpp" 14 | 15 | -------------------------------------------------------------------------------- /src/duckdb/ub_src_common_row_operations.cpp: -------------------------------------------------------------------------------- 1 | #include "src/common/row_operations/row_aggregate.cpp" 2 | 3 | #include "src/common/row_operations/row_scatter.cpp" 4 | 5 | #include "src/common/row_operations/row_gather.cpp" 6 | 7 | #include "src/common/row_operations/row_matcher.cpp" 8 | 9 | #include "src/common/row_operations/row_external.cpp" 10 | 11 | #include "src/common/row_operations/row_radix_scatter.cpp" 12 | 13 | #include "src/common/row_operations/row_heap_scatter.cpp" 14 | 15 | #include "src/common/row_operations/row_heap_gather.cpp" 16 | 17 | -------------------------------------------------------------------------------- /src/duckdb/ub_src_execution_operator_csv_scanner_scanner.cpp: -------------------------------------------------------------------------------- 1 | #include "src/execution/operator/csv_scanner/scanner/base_scanner.cpp" 2 | 3 | #include "src/execution/operator/csv_scanner/scanner/column_count_scanner.cpp" 4 | 5 | #include "src/execution/operator/csv_scanner/scanner/csv_schema.cpp" 6 | 7 | #include "src/execution/operator/csv_scanner/scanner/scanner_boundary.cpp" 8 | 9 | #include "src/execution/operator/csv_scanner/scanner/skip_scanner.cpp" 10 | 11 | #include "src/execution/operator/csv_scanner/scanner/string_value_scanner.cpp" 12 | 13 | -------------------------------------------------------------------------------- /src/duckdb/ub_src_parser_transform_tableref.cpp: -------------------------------------------------------------------------------- 1 | #include "src/parser/transform/tableref/transform_base_tableref.cpp" 2 | 3 | #include "src/parser/transform/tableref/transform_join.cpp" 4 | 5 | #include "src/parser/transform/tableref/transform_from.cpp" 6 | 7 | #include "src/parser/transform/tableref/transform_pivot.cpp" 8 | 9 | #include "src/parser/transform/tableref/transform_subquery.cpp" 10 | 11 | #include "src/parser/transform/tableref/transform_table_function.cpp" 12 | 13 | #include "src/parser/transform/tableref/transform_tableref.cpp" 14 | 15 | -------------------------------------------------------------------------------- /duckdb.Rproj: -------------------------------------------------------------------------------- 1 | Version: 1.0 2 | ProjectId: d9f7e98d-d76d-4f44-8083-febca8f351bc 3 | 4 | RestoreWorkspace: No 5 | SaveWorkspace: No 6 | AlwaysSaveHistory: Default 7 | 8 | EnableCodeIndexing: Yes 9 | UseSpacesForTab: Yes 10 | NumSpacesForTab: 2 11 | Encoding: UTF-8 12 | 13 | RnwWeave: Sweave 14 | LaTeX: pdfLaTeX 15 | 16 | AutoAppendNewline: Yes 17 | StripTrailingWhitespace: Yes 18 | 19 | BuildType: Package 20 | PackageUseDevtools: Yes 21 | PackageInstallArgs: --no-multiarch --with-keep.source --no-byte-compile 22 | PackageRoxygenize: rd,collate,namespace 23 | -------------------------------------------------------------------------------- /src/duckdb/src/execution/physical_plan/plan_pivot.cpp: -------------------------------------------------------------------------------- 1 | #include "duckdb/execution/operator/projection/physical_pivot.hpp" 2 | #include "duckdb/execution/physical_plan_generator.hpp" 3 | #include "duckdb/planner/operator/logical_pivot.hpp" 4 | 5 | namespace duckdb { 6 | 7 | PhysicalOperator &PhysicalPlanGenerator::CreatePlan(LogicalPivot &op) { 8 | D_ASSERT(op.children.size() == 1); 9 | auto &plan = CreatePlan(*op.children[0]); 10 | return Make(std::move(op.types), plan, std::move(op.bound_pivot)); 11 | } 12 | 13 | } // namespace duckdb 14 | -------------------------------------------------------------------------------- /src/duckdb/src/include/duckdb/common/enums/output_type.hpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // DuckDB 3 | // 4 | // duckdb/common/enums/output_type.hpp 5 | // 6 | // 7 | //===----------------------------------------------------------------------===// 8 | 9 | #pragma once 10 | 11 | #include "duckdb/common/constants.hpp" 12 | 13 | namespace duckdb { 14 | 15 | enum class ExplainOutputType : uint8_t { ALL = 0, OPTIMIZED_ONLY = 1, PHYSICAL_ONLY = 2 }; 16 | 17 | } // namespace duckdb 18 | -------------------------------------------------------------------------------- /src/duckdb/src/include/duckdb/common/enums/access_mode.hpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // DuckDB 3 | // 4 | // duckdb/common/enums/access_mode.hpp 5 | // 6 | // 7 | //===----------------------------------------------------------------------===// 8 | 9 | #pragma once 10 | 11 | #include "duckdb/common/constants.hpp" 12 | 13 | namespace duckdb { 14 | 15 | enum class AccessMode : uint8_t { UNDEFINED = 0, AUTOMATIC = 1, READ_ONLY = 2, READ_WRITE = 3 }; 16 | 17 | } // namespace duckdb 18 | -------------------------------------------------------------------------------- /src/duckdb/src/include/duckdb/common/enums/on_entry_not_found.hpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // DuckDB 3 | // 4 | // duckdb/common/enums/on_entry_not_found.hpp 5 | // 6 | // 7 | //===----------------------------------------------------------------------===// 8 | 9 | #pragma once 10 | 11 | #include "duckdb/common/constants.hpp" 12 | 13 | namespace duckdb { 14 | 15 | enum class OnEntryNotFound : uint8_t { THROW_EXCEPTION = 0, RETURN_NULL = 1 }; 16 | 17 | } // namespace duckdb 18 | -------------------------------------------------------------------------------- /tests/testthat/test-dbinfo.R: -------------------------------------------------------------------------------- 1 | test_that("dbGetInfo returns something meaningful", { 2 | dbdir <- path_normalize(tempfile()) 3 | drv <- duckdb(dbdir) 4 | 5 | info_drv <- dbGetInfo(drv) 6 | expect_equal(info_drv$dbname, dbdir) 7 | expect_true(grepl("\\d+\\.\\d+\\.\\d+", info_drv$client.version)) 8 | expect_true(grepl("\\d+\\.\\d+\\.\\d+", info_drv$driver.version)) 9 | 10 | con <- local_con(dbdir) 11 | info_con <- dbGetInfo(con) 12 | expect_equal(info_con$dbname, dbdir) 13 | expect_true(grepl("\\d+\\.\\d+\\.\\d+", info_con$db.version)) 14 | }) 15 | -------------------------------------------------------------------------------- /src/duckdb/src/include/duckdb/catalog/catalog_entry/table_column_type.hpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // DuckDB 3 | // 4 | // duckdb/catalog/catalog_entry/table_column_type.hpp 5 | // 6 | // 7 | //===----------------------------------------------------------------------===// 8 | 9 | #pragma once 10 | 11 | #include "duckdb/common/constants.hpp" 12 | 13 | namespace duckdb { 14 | 15 | enum class TableColumnType : uint8_t { STANDARD = 0, GENERATED = 1 }; 16 | 17 | } // namespace duckdb 18 | -------------------------------------------------------------------------------- /src/duckdb/src/include/duckdb/common/enums/ordinality_request_type.hpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // DuckDB 3 | // 4 | // duckdb/common/enums/ordinality_request_type.hpp 5 | // 6 | // 7 | //===----------------------------------------------------------------------===// 8 | 9 | #pragma once 10 | #include "duckdb/common/typedefs.hpp" 11 | 12 | namespace duckdb { 13 | 14 | enum class OrdinalityType : uint8_t { WITHOUT_ORDINALITY = 0, WITH_ORDINALITY = 1 }; 15 | 16 | } // namespace duckdb 17 | -------------------------------------------------------------------------------- /tests/testthat/test-dbwritetable.R: -------------------------------------------------------------------------------- 1 | test_that("dbWriteTable can write tables with keyword column names", { 2 | skip_if_not(TEST_RE2) 3 | 4 | con <- local_con() 5 | 6 | # NB: name is a reserved word, will need to be escaped as part of writing operation 7 | sample_data <- data.frame(id = 1:3, name = c("cuthbert", "dibble", "grubb")) 8 | dbWriteTable(con, "sample_data", sample_data, field.types = c(id = "INTEGER", name = "VARCHAR")) 9 | 10 | # Can read the data we wrote back again 11 | expect_identical(dbReadTable(con, "sample_data"), sample_data) 12 | }) 13 | -------------------------------------------------------------------------------- /R/dbListFields__duckdb_connection_character.R: -------------------------------------------------------------------------------- 1 | #' @rdname duckdb_connection-class 2 | #' @inheritParams DBI::dbListFields 3 | #' @usage NULL 4 | dbListFields__duckdb_connection_character <- function(conn, name, ...) { 5 | names(dbGetQuery( 6 | conn, 7 | sqlInterpolate( 8 | conn, 9 | "SELECT * FROM ? WHERE FALSE", 10 | dbQuoteIdentifier(conn, name) 11 | ) 12 | )) 13 | } 14 | 15 | #' @rdname duckdb_connection-class 16 | #' @export 17 | setMethod("dbListFields", c("duckdb_connection", "character"), dbListFields__duckdb_connection_character) 18 | -------------------------------------------------------------------------------- /src/duckdb/src/parser/constraints/not_null_constraint.cpp: -------------------------------------------------------------------------------- 1 | #include "duckdb/parser/constraints/not_null_constraint.hpp" 2 | 3 | namespace duckdb { 4 | 5 | NotNullConstraint::NotNullConstraint(LogicalIndex index) : Constraint(ConstraintType::NOT_NULL), index(index) { 6 | } 7 | 8 | NotNullConstraint::~NotNullConstraint() { 9 | } 10 | 11 | string NotNullConstraint::ToString() const { 12 | return "NOT NULL"; 13 | } 14 | 15 | unique_ptr NotNullConstraint::Copy() const { 16 | return make_uniq(index); 17 | } 18 | 19 | } // namespace duckdb 20 | -------------------------------------------------------------------------------- /src/duckdb/src/catalog/catalog_entry/copy_function_catalog_entry.cpp: -------------------------------------------------------------------------------- 1 | #include "duckdb/catalog/catalog_entry/copy_function_catalog_entry.hpp" 2 | #include "duckdb/parser/parsed_data/create_copy_function_info.hpp" 3 | 4 | namespace duckdb { 5 | 6 | CopyFunctionCatalogEntry::CopyFunctionCatalogEntry(Catalog &catalog, SchemaCatalogEntry &schema, 7 | CreateCopyFunctionInfo &info) 8 | : StandardEntry(CatalogType::COPY_FUNCTION_ENTRY, schema, catalog, info.name), function(info.function) { 9 | } 10 | 11 | } // namespace duckdb 12 | -------------------------------------------------------------------------------- /src/duckdb/src/execution/operator/helper/physical_pragma.cpp: -------------------------------------------------------------------------------- 1 | #include "duckdb/execution/operator/helper/physical_pragma.hpp" 2 | 3 | namespace duckdb { 4 | 5 | SourceResultType PhysicalPragma::GetData(ExecutionContext &context, DataChunk &chunk, 6 | OperatorSourceInput &input) const { 7 | auto &client = context.client; 8 | FunctionParameters parameters {info->parameters, info->named_parameters}; 9 | info->function.function(client, parameters); 10 | 11 | return SourceResultType::FINISHED; 12 | } 13 | 14 | } // namespace duckdb 15 | -------------------------------------------------------------------------------- /src/duckdb/src/include/duckdb/common/enums/preserve_order.hpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // DuckDB 3 | // 4 | // duckdb/common/enums/preserve_order.hpp 5 | // 6 | // 7 | //===----------------------------------------------------------------------===// 8 | 9 | #pragma once 10 | 11 | #include "duckdb/common/constants.hpp" 12 | 13 | namespace duckdb { 14 | 15 | enum class PreserveOrderType : uint8_t { AUTOMATIC = 0, PRESERVE_ORDER = 1, DONT_PRESERVE_ORDER = 2 }; 16 | 17 | } // namespace duckdb 18 | -------------------------------------------------------------------------------- /src/duckdb/src/include/duckdb/common/fstream.hpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // DuckDB 3 | // 4 | // duckdb/common/fstream.hpp 5 | // 6 | // 7 | //===----------------------------------------------------------------------===// 8 | 9 | #pragma once 10 | 11 | #include 12 | #include 13 | 14 | namespace duckdb { 15 | using std::endl; 16 | using std::fstream; 17 | using std::ifstream; 18 | using std::ios; 19 | using std::ios_base; 20 | using std::ofstream; 21 | } // namespace duckdb 22 | -------------------------------------------------------------------------------- /src/duckdb/src/parallel/pipeline_complete_event.cpp: -------------------------------------------------------------------------------- 1 | #include "duckdb/parallel/pipeline_complete_event.hpp" 2 | #include "duckdb/execution/executor.hpp" 3 | 4 | namespace duckdb { 5 | 6 | PipelineCompleteEvent::PipelineCompleteEvent(Executor &executor, bool complete_pipeline_p) 7 | : Event(executor), complete_pipeline(complete_pipeline_p) { 8 | } 9 | 10 | void PipelineCompleteEvent::Schedule() { 11 | } 12 | 13 | void PipelineCompleteEvent::FinalizeFinish() { 14 | if (complete_pipeline) { 15 | executor.CompletePipeline(); 16 | } 17 | } 18 | 19 | } // namespace duckdb 20 | -------------------------------------------------------------------------------- /src/duckdb/src/include/duckdb/transaction/append_info.hpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // DuckDB 3 | // 4 | // duckdb/transaction/append_info.hpp 5 | // 6 | // 7 | //===----------------------------------------------------------------------===// 8 | 9 | #pragma once 10 | 11 | #include "duckdb/common/constants.hpp" 12 | 13 | namespace duckdb { 14 | class DataTable; 15 | 16 | struct AppendInfo { 17 | DataTable *table; 18 | idx_t start_row; 19 | idx_t count; 20 | }; 21 | 22 | } // namespace duckdb 23 | -------------------------------------------------------------------------------- /src/duckdb/third_party/mbedtls/include/mbedtls/private_access.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file private_access.h 3 | * 4 | * \brief Macro wrapper for struct's members. 5 | */ 6 | /* 7 | * Copyright The Mbed TLS Contributors 8 | * SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later 9 | */ 10 | 11 | #ifndef MBEDTLS_PRIVATE_ACCESS_H 12 | #define MBEDTLS_PRIVATE_ACCESS_H 13 | 14 | #ifndef MBEDTLS_ALLOW_PRIVATE_ACCESS 15 | #define MBEDTLS_PRIVATE(member) private_##member 16 | #else 17 | #define MBEDTLS_PRIVATE(member) member 18 | #endif 19 | 20 | #endif /* MBEDTLS_PRIVATE_ACCESS_H */ 21 | -------------------------------------------------------------------------------- /R/dbIsValid__duckdb_connection.R: -------------------------------------------------------------------------------- 1 | #' @rdname duckdb_connection-class 2 | #' @inheritParams DBI::dbIsValid 3 | #' @usage NULL 4 | dbIsValid__duckdb_connection <- function(dbObj, ...) { 5 | # Use fast C++ connection validity check instead of executing SELECT 1 6 | # This avoids deadlock issues when called from progress bar handlers 7 | # that already have ScopedInterruptHandler protection 8 | rethrow_rapi_connection_valid(dbObj@conn_ref) 9 | } 10 | 11 | #' @rdname duckdb_connection-class 12 | #' @export 13 | setMethod("dbIsValid", "duckdb_connection", dbIsValid__duckdb_connection) 14 | -------------------------------------------------------------------------------- /src/duckdb/src/include/duckdb/common/enums/profiler_format.hpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // DuckDB 3 | // 4 | // duckdb/common/enums/profiler_format.hpp 5 | // 6 | // 7 | //===----------------------------------------------------------------------===// 8 | 9 | #pragma once 10 | 11 | #include "duckdb/common/constants.hpp" 12 | 13 | namespace duckdb { 14 | 15 | enum class ProfilerPrintFormat : uint8_t { QUERY_TREE, JSON, QUERY_TREE_OPTIMIZER, NO_OUTPUT, HTML, GRAPHVIZ }; 16 | 17 | } // namespace duckdb 18 | -------------------------------------------------------------------------------- /src/duckdb/src/parser/constraints/check_constraint.cpp: -------------------------------------------------------------------------------- 1 | #include "duckdb/parser/constraints/check_constraint.hpp" 2 | 3 | namespace duckdb { 4 | 5 | CheckConstraint::CheckConstraint(unique_ptr expression) 6 | : Constraint(ConstraintType::CHECK), expression(std::move(expression)) { 7 | } 8 | 9 | string CheckConstraint::ToString() const { 10 | return "CHECK(" + expression->ToString() + ")"; 11 | } 12 | 13 | unique_ptr CheckConstraint::Copy() const { 14 | return make_uniq(expression->Copy()); 15 | } 16 | 17 | } // namespace duckdb 18 | -------------------------------------------------------------------------------- /src/duckdb/src/include/duckdb/common/enums/debug_initialize.hpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // DuckDB 3 | // 4 | // duckdb/common/enums/debug_initialize.hpp 5 | // 6 | // 7 | //===----------------------------------------------------------------------===// 8 | 9 | #pragma once 10 | 11 | #include "duckdb/common/constants.hpp" 12 | 13 | namespace duckdb { 14 | 15 | enum class DebugInitialize : uint8_t { NO_INITIALIZE = 0, DEBUG_ZERO_INITIALIZE = 1, DEBUG_ONE_INITIALIZE = 2 }; 16 | 17 | } // namespace duckdb 18 | -------------------------------------------------------------------------------- /src/duckdb/src/include/duckdb/common/enums/prepared_statement_mode.hpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // DuckDB 3 | // 4 | // duckdb/common/enums/prepared_statement_mode.hpp 5 | // 6 | // 7 | //===----------------------------------------------------------------------===// 8 | 9 | #pragma once 10 | 11 | #include "duckdb/common/constants.hpp" 12 | 13 | namespace duckdb { 14 | 15 | enum class PreparedStatementMode : uint8_t { 16 | PREPARE_ONLY, 17 | PREPARE_AND_EXECUTE, 18 | }; 19 | 20 | } // namespace duckdb 21 | -------------------------------------------------------------------------------- /src/duckdb/src/include/duckdb/common/enums/set_operation_type.hpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // DuckDB 3 | // 4 | // duckdb/common/enums/set_operation_type.hpp 5 | // 6 | // 7 | //===----------------------------------------------------------------------===// 8 | 9 | #pragma once 10 | 11 | #include "duckdb/common/constants.hpp" 12 | 13 | namespace duckdb { 14 | 15 | enum class SetOperationType : uint8_t { NONE = 0, UNION = 1, EXCEPT = 2, INTERSECT = 3, UNION_BY_NAME = 4 }; 16 | 17 | } // namespace duckdb 18 | -------------------------------------------------------------------------------- /src/duckdb/third_party/thrift/thrift/thrift_export.h: -------------------------------------------------------------------------------- 1 | #ifndef THRIFT_EXPORT_H 2 | #define THRIFT_EXPORT_H 3 | 4 | #ifdef THRIFT_STATIC_DEFINE 5 | # define THRIFT_EXPORT 6 | #elif defined(_MSC_VER ) 7 | # ifndef THRIFT_EXPORT 8 | # ifdef thrift_EXPORTS 9 | /* We are building this library */ 10 | # define THRIFT_EXPORT __declspec(dllexport) 11 | # else 12 | /* We are using this library */ 13 | # define THRIFT_EXPORT __declspec(dllimport) 14 | # endif 15 | # endif 16 | #else 17 | # define THRIFT_EXPORT 18 | #endif 19 | 20 | #endif /* THRIFT_EXPORT_H */ 21 | -------------------------------------------------------------------------------- /R/print__duckdb_explain.R: -------------------------------------------------------------------------------- 1 | #' DuckDB EXPLAIN query tree 2 | #' @rdname duckdb_explain-class 3 | #' @aliases duckdb_explain 4 | #' @export 5 | setClass("duckdb_explain", contains = "data.frame", slots = list(explain_key = "character", explain_value = "character")) 6 | 7 | #' @rdname duckdb_explain-class 8 | #' @usage NULL 9 | #' @export 10 | print.duckdb_explain <- function(x, ...) { 11 | if (!all(names(x) %in% c("explain_key", "explain_value"))) NextMethod("print") 12 | if (nrow(x) > 0 & all(!is.na(x))) cat(paste0(x$explain_key, "\n", x$explain_value, collapse = "")) 13 | invisible(x) 14 | } 15 | -------------------------------------------------------------------------------- /src/duckdb/src/include/duckdb/storage/table/update_state.hpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // DuckDB 3 | // 4 | // duckdb/storage/table/update_state.hpp 5 | // 6 | // 7 | //===----------------------------------------------------------------------===// 8 | 9 | #pragma once 10 | 11 | #include "duckdb/storage/table/append_state.hpp" 12 | 13 | namespace duckdb { 14 | class TableCatalogEntry; 15 | 16 | struct TableUpdateState { 17 | unique_ptr constraint_state; 18 | }; 19 | 20 | } // namespace duckdb 21 | -------------------------------------------------------------------------------- /src/duckdb/src/planner/operator/logical_delim_get.cpp: -------------------------------------------------------------------------------- 1 | #include "duckdb/planner/operator/logical_delim_get.hpp" 2 | 3 | #include "duckdb/main/config.hpp" 4 | 5 | namespace duckdb { 6 | 7 | vector LogicalDelimGet::GetTableIndex() const { 8 | return vector {table_index}; 9 | } 10 | 11 | string LogicalDelimGet::GetName() const { 12 | #ifdef DEBUG 13 | if (DBConfigOptions::debug_print_bindings) { 14 | return LogicalOperator::GetName() + StringUtil::Format(" #%llu", table_index); 15 | } 16 | #endif 17 | return LogicalOperator::GetName(); 18 | } 19 | 20 | } // namespace duckdb 21 | -------------------------------------------------------------------------------- /src/duckdb/ub_src_storage_statistics.cpp: -------------------------------------------------------------------------------- 1 | #include "src/storage/statistics/base_statistics.cpp" 2 | 3 | #include "src/storage/statistics/column_statistics.cpp" 4 | 5 | #include "src/storage/statistics/distinct_statistics.cpp" 6 | 7 | #include "src/storage/statistics/array_stats.cpp" 8 | 9 | #include "src/storage/statistics/list_stats.cpp" 10 | 11 | #include "src/storage/statistics/numeric_stats.cpp" 12 | 13 | #include "src/storage/statistics/segment_statistics.cpp" 14 | 15 | #include "src/storage/statistics/string_stats.cpp" 16 | 17 | #include "src/storage/statistics/struct_stats.cpp" 18 | 19 | -------------------------------------------------------------------------------- /src/duckdb/src/catalog/catalog_entry/pragma_function_catalog_entry.cpp: -------------------------------------------------------------------------------- 1 | #include "duckdb/catalog/catalog_entry/pragma_function_catalog_entry.hpp" 2 | #include "duckdb/parser/parsed_data/create_pragma_function_info.hpp" 3 | 4 | namespace duckdb { 5 | 6 | PragmaFunctionCatalogEntry::PragmaFunctionCatalogEntry(Catalog &catalog, SchemaCatalogEntry &schema, 7 | CreatePragmaFunctionInfo &info) 8 | : FunctionEntry(CatalogType::PRAGMA_FUNCTION_ENTRY, catalog, schema, info), functions(std::move(info.functions)) { 9 | } 10 | 11 | } // namespace duckdb 12 | -------------------------------------------------------------------------------- /src/duckdb/src/include/duckdb/parser/tableref/list.hpp: -------------------------------------------------------------------------------- 1 | #include "duckdb/parser/tableref/basetableref.hpp" 2 | #include "duckdb/parser/tableref/bound_ref_wrapper.hpp" 3 | #include "duckdb/parser/tableref/emptytableref.hpp" 4 | #include "duckdb/parser/tableref/expressionlistref.hpp" 5 | #include "duckdb/parser/tableref/column_data_ref.hpp" 6 | #include "duckdb/parser/tableref/joinref.hpp" 7 | #include "duckdb/parser/tableref/pivotref.hpp" 8 | #include "duckdb/parser/tableref/showref.hpp" 9 | #include "duckdb/parser/tableref/subqueryref.hpp" 10 | #include "duckdb/parser/tableref/table_function_ref.hpp" 11 | -------------------------------------------------------------------------------- /src/duckdb/src/planner/operator/logical_dummy_scan.cpp: -------------------------------------------------------------------------------- 1 | #include "duckdb/planner/operator/logical_dummy_scan.hpp" 2 | 3 | #include "duckdb/main/config.hpp" 4 | 5 | namespace duckdb { 6 | 7 | vector LogicalDummyScan::GetTableIndex() const { 8 | return vector {table_index}; 9 | } 10 | 11 | string LogicalDummyScan::GetName() const { 12 | #ifdef DEBUG 13 | if (DBConfigOptions::debug_print_bindings) { 14 | return LogicalOperator::GetName() + StringUtil::Format(" #%llu", table_index); 15 | } 16 | #endif 17 | return LogicalOperator::GetName(); 18 | } 19 | 20 | } // namespace duckdb 21 | -------------------------------------------------------------------------------- /src/duckdb/src/include/duckdb/common/sorting/sort_projection_column.hpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // DuckDB 3 | // 4 | // duckdb/common/sorting/sort_projection_column.hpp 5 | // 6 | // 7 | //===----------------------------------------------------------------------===// 8 | 9 | #pragma once 10 | 11 | #include "duckdb/common/typedefs.hpp" 12 | 13 | namespace duckdb { 14 | 15 | struct SortProjectionColumn { 16 | bool is_payload; 17 | idx_t layout_col_idx; 18 | idx_t output_col_idx; 19 | }; 20 | 21 | } // namespace duckdb 22 | -------------------------------------------------------------------------------- /src/duckdb/src/parser/statement/load_statement.cpp: -------------------------------------------------------------------------------- 1 | #include "duckdb/parser/statement/load_statement.hpp" 2 | 3 | namespace duckdb { 4 | 5 | LoadStatement::LoadStatement() : SQLStatement(StatementType::LOAD_STATEMENT) { 6 | } 7 | 8 | LoadStatement::LoadStatement(const LoadStatement &other) : SQLStatement(other), info(other.info->Copy()) { 9 | } 10 | 11 | unique_ptr LoadStatement::Copy() const { 12 | return unique_ptr(new LoadStatement(*this)); 13 | } 14 | 15 | string LoadStatement::ToString() const { 16 | return info->ToString(); 17 | } 18 | 19 | } // namespace duckdb 20 | -------------------------------------------------------------------------------- /R/dbHasCompleted__duckdb_result.R: -------------------------------------------------------------------------------- 1 | #' @rdname duckdb_result-class 2 | #' @inheritParams DBI::dbHasCompleted 3 | #' @usage NULL 4 | dbHasCompleted__duckdb_result <- function(res, ...) { 5 | if (!res@env$open) { 6 | stop("result has already been cleared") 7 | } 8 | 9 | if (is.null(res@env$resultset)) { 10 | FALSE 11 | } else if (res@stmt_lst$type == "SELECT") { 12 | res@env$rows_fetched == nrow(res@env$resultset) 13 | } else { 14 | TRUE 15 | } 16 | } 17 | 18 | #' @rdname duckdb_result-class 19 | #' @export 20 | setMethod("dbHasCompleted", "duckdb_result", dbHasCompleted__duckdb_result) 21 | -------------------------------------------------------------------------------- /src/duckdb/src/include/duckdb/common/enums/set_scope.hpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // DuckDB 3 | // 4 | // duckdb/common/enums/set_scope.hpp 5 | // 6 | // 7 | //===----------------------------------------------------------------------===// 8 | 9 | #pragma once 10 | 11 | #include "duckdb/common/constants.hpp" 12 | 13 | namespace duckdb { 14 | 15 | enum class SetScope : uint8_t { 16 | AUTOMATIC = 0, 17 | LOCAL = 1, /* unused */ 18 | SESSION = 2, 19 | GLOBAL = 3, 20 | VARIABLE = 4 21 | }; 22 | 23 | } // namespace duckdb 24 | -------------------------------------------------------------------------------- /src/duckdb/src/parser/transform/statement/transform_import.cpp: -------------------------------------------------------------------------------- 1 | #include "duckdb/parser/statement/pragma_statement.hpp" 2 | #include "duckdb/parser/transformer.hpp" 3 | #include "duckdb/parser/expression/constant_expression.hpp" 4 | 5 | namespace duckdb { 6 | 7 | unique_ptr Transformer::TransformImport(duckdb_libpgquery::PGImportStmt &stmt) { 8 | auto result = make_uniq(); 9 | result->info->name = "import_database"; 10 | result->info->parameters.emplace_back(make_uniq(Value(stmt.filename))); 11 | return result; 12 | } 13 | 14 | } // namespace duckdb 15 | -------------------------------------------------------------------------------- /src/duckdb/src/planner/operator/logical_set_operation.cpp: -------------------------------------------------------------------------------- 1 | #include "duckdb/planner/operator/logical_set_operation.hpp" 2 | 3 | #include "duckdb/main/config.hpp" 4 | 5 | namespace duckdb { 6 | 7 | vector LogicalSetOperation::GetTableIndex() const { 8 | return vector {table_index}; 9 | } 10 | 11 | string LogicalSetOperation::GetName() const { 12 | #ifdef DEBUG 13 | if (DBConfigOptions::debug_print_bindings) { 14 | return LogicalOperator::GetName() + StringUtil::Format(" #%llu", table_index); 15 | } 16 | #endif 17 | return LogicalOperator::GetName(); 18 | } 19 | 20 | } // namespace duckdb 21 | -------------------------------------------------------------------------------- /src/duckdb/extension/core_functions/include/core_functions/function_list.hpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // DuckDB 3 | // 4 | // extension/core_functions/include/core_functions/function_list.hpp 5 | // 6 | // 7 | //===----------------------------------------------------------------------===// 8 | 9 | #pragma once 10 | 11 | #include "duckdb/function/function_list.hpp" 12 | 13 | namespace duckdb { 14 | 15 | struct CoreFunctionList { 16 | static const StaticFunctionDefinition *GetFunctionList(); 17 | }; 18 | 19 | } // namespace duckdb 20 | -------------------------------------------------------------------------------- /src/duckdb/src/execution/operator/helper/physical_prepare.cpp: -------------------------------------------------------------------------------- 1 | #include "duckdb/execution/operator/helper/physical_prepare.hpp" 2 | #include "duckdb/main/client_data.hpp" 3 | 4 | namespace duckdb { 5 | 6 | SourceResultType PhysicalPrepare::GetData(ExecutionContext &context, DataChunk &chunk, 7 | OperatorSourceInput &input) const { 8 | auto &client = context.client; 9 | 10 | // store the prepared statement in the context 11 | ClientData::Get(client).prepared_statements[name] = prepared; 12 | 13 | return SourceResultType::FINISHED; 14 | } 15 | 16 | } // namespace duckdb 17 | -------------------------------------------------------------------------------- /src/duckdb/src/include/duckdb/storage/table/column_segment_tree.hpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // DuckDB 3 | // 4 | // duckdb/storage/table/column_segment_tree.hpp 5 | // 6 | // 7 | //===----------------------------------------------------------------------===// 8 | 9 | #pragma once 10 | 11 | #include "duckdb/storage/table/segment_tree.hpp" 12 | #include "duckdb/storage/table/column_segment.hpp" 13 | 14 | namespace duckdb { 15 | 16 | class ColumnSegmentTree : public SegmentTree {}; 17 | 18 | } // namespace duckdb 19 | -------------------------------------------------------------------------------- /src/duckdb/src/parser/statement/alter_statement.cpp: -------------------------------------------------------------------------------- 1 | #include "duckdb/parser/statement/alter_statement.hpp" 2 | 3 | namespace duckdb { 4 | 5 | AlterStatement::AlterStatement() : SQLStatement(StatementType::ALTER_STATEMENT) { 6 | } 7 | 8 | AlterStatement::AlterStatement(const AlterStatement &other) : SQLStatement(other), info(other.info->Copy()) { 9 | } 10 | 11 | unique_ptr AlterStatement::Copy() const { 12 | return unique_ptr(new AlterStatement(*this)); 13 | } 14 | 15 | string AlterStatement::ToString() const { 16 | return info->ToString(); 17 | } 18 | 19 | } // namespace duckdb 20 | -------------------------------------------------------------------------------- /src/duckdb/src/planner/operator/logical_expression_get.cpp: -------------------------------------------------------------------------------- 1 | #include "duckdb/planner/operator/logical_expression_get.hpp" 2 | 3 | #include "duckdb/main/config.hpp" 4 | 5 | namespace duckdb { 6 | 7 | vector LogicalExpressionGet::GetTableIndex() const { 8 | return vector {table_index}; 9 | } 10 | 11 | string LogicalExpressionGet::GetName() const { 12 | #ifdef DEBUG 13 | if (DBConfigOptions::debug_print_bindings) { 14 | return LogicalOperator::GetName() + StringUtil::Format(" #%llu", table_index); 15 | } 16 | #endif 17 | return LogicalOperator::GetName(); 18 | } 19 | 20 | } // namespace duckdb 21 | -------------------------------------------------------------------------------- /src/duckdb/src/include/duckdb/common/enums/function_errors.hpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // DuckDB 3 | // 4 | // duckdb/common/enums/function_errors.hpp 5 | // 6 | // 7 | //===----------------------------------------------------------------------===// 8 | 9 | #pragma once 10 | 11 | #include "duckdb/common/common.hpp" 12 | 13 | namespace duckdb { 14 | 15 | //! Whether or not a function can throw an error or not 16 | enum class FunctionErrors : uint8_t { CANNOT_ERROR = 0, CAN_THROW_RUNTIME_ERROR = 1 }; 17 | 18 | } // namespace duckdb 19 | -------------------------------------------------------------------------------- /src/duckdb/src/include/duckdb/function/table/summary.hpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // DuckDB 3 | // 4 | // duckdb/function/table/summary.hpp 5 | // 6 | // 7 | //===----------------------------------------------------------------------===// 8 | 9 | #pragma once 10 | 11 | #include "duckdb/function/table_function.hpp" 12 | #include "duckdb/function/built_in_functions.hpp" 13 | 14 | namespace duckdb { 15 | 16 | struct SummaryTableFunction { 17 | static void RegisterFunction(BuiltinFunctions &set); 18 | }; 19 | 20 | } // namespace duckdb 21 | -------------------------------------------------------------------------------- /src/duckdb/src/planner/operator/logical_materialized_cte.cpp: -------------------------------------------------------------------------------- 1 | #include "duckdb/planner/operator/logical_materialized_cte.hpp" 2 | 3 | namespace duckdb { 4 | 5 | InsertionOrderPreservingMap LogicalMaterializedCTE::ParamsToString() const { 6 | InsertionOrderPreservingMap result; 7 | result["CTE Name"] = ctename; 8 | result["Table Index"] = StringUtil::Format("%llu", table_index); 9 | SetParamsEstimatedCardinality(result); 10 | return result; 11 | } 12 | 13 | vector LogicalMaterializedCTE::GetTableIndex() const { 14 | return vector {table_index}; 15 | } 16 | 17 | } // namespace duckdb 18 | -------------------------------------------------------------------------------- /src/duckdb/third_party/re2/util/strutil.h: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The RE2 Authors. All Rights Reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | #ifndef UTIL_STRUTIL_H_ 6 | #define UTIL_STRUTIL_H_ 7 | 8 | #include 9 | 10 | #include "re2/stringpiece.h" 11 | #include "util/util.h" 12 | 13 | namespace duckdb_re2 { 14 | 15 | std::string CEscape(const StringPiece& src); 16 | void PrefixSuccessor(std::string* prefix); 17 | std::string StringPrintf(const char* format, ...); 18 | 19 | } // namespace re2 20 | 21 | #endif // UTIL_STRUTIL_H_ 22 | -------------------------------------------------------------------------------- /src/duckdb/src/parser/parsed_data/create_copy_function_info.cpp: -------------------------------------------------------------------------------- 1 | #include "duckdb/parser/parsed_data/create_copy_function_info.hpp" 2 | 3 | namespace duckdb { 4 | 5 | CreateCopyFunctionInfo::CreateCopyFunctionInfo(CopyFunction function_p) 6 | : CreateInfo(CatalogType::COPY_FUNCTION_ENTRY), function(std::move(function_p)) { 7 | this->name = function.name; 8 | internal = true; 9 | } 10 | 11 | unique_ptr CreateCopyFunctionInfo::Copy() const { 12 | auto result = make_uniq(function); 13 | CopyProperties(*result); 14 | return std::move(result); 15 | } 16 | 17 | } // namespace duckdb 18 | -------------------------------------------------------------------------------- /src/duckdb/src/parser/statement/attach_statement.cpp: -------------------------------------------------------------------------------- 1 | #include "duckdb/parser/statement/attach_statement.hpp" 2 | 3 | namespace duckdb { 4 | 5 | AttachStatement::AttachStatement() : SQLStatement(StatementType::ATTACH_STATEMENT) { 6 | } 7 | 8 | AttachStatement::AttachStatement(const AttachStatement &other) : SQLStatement(other), info(other.info->Copy()) { 9 | } 10 | 11 | unique_ptr AttachStatement::Copy() const { 12 | return unique_ptr(new AttachStatement(*this)); 13 | } 14 | 15 | string AttachStatement::ToString() const { 16 | return info->ToString(); 17 | } 18 | 19 | } // namespace duckdb 20 | -------------------------------------------------------------------------------- /src/duckdb/src/parser/statement/create_statement.cpp: -------------------------------------------------------------------------------- 1 | #include "duckdb/parser/statement/create_statement.hpp" 2 | 3 | namespace duckdb { 4 | 5 | CreateStatement::CreateStatement() : SQLStatement(StatementType::CREATE_STATEMENT) { 6 | } 7 | 8 | CreateStatement::CreateStatement(const CreateStatement &other) : SQLStatement(other), info(other.info->Copy()) { 9 | } 10 | 11 | unique_ptr CreateStatement::Copy() const { 12 | return unique_ptr(new CreateStatement(*this)); 13 | } 14 | 15 | string CreateStatement::ToString() const { 16 | return info->ToString(); 17 | } 18 | 19 | } // namespace duckdb 20 | -------------------------------------------------------------------------------- /src/duckdb/src/parser/statement/detach_statement.cpp: -------------------------------------------------------------------------------- 1 | #include "duckdb/parser/statement/detach_statement.hpp" 2 | 3 | namespace duckdb { 4 | 5 | DetachStatement::DetachStatement() : SQLStatement(StatementType::DETACH_STATEMENT) { 6 | } 7 | 8 | DetachStatement::DetachStatement(const DetachStatement &other) : SQLStatement(other), info(other.info->Copy()) { 9 | } 10 | 11 | unique_ptr DetachStatement::Copy() const { 12 | return unique_ptr(new DetachStatement(*this)); 13 | } 14 | 15 | string DetachStatement::ToString() const { 16 | return info->ToString(); 17 | } 18 | 19 | } // namespace duckdb 20 | -------------------------------------------------------------------------------- /src/duckdb/ub_extension_core_functions_aggregate_regression.cpp: -------------------------------------------------------------------------------- 1 | #include "extension/core_functions/aggregate/regression/regr_sxy.cpp" 2 | 3 | #include "extension/core_functions/aggregate/regression/regr_intercept.cpp" 4 | 5 | #include "extension/core_functions/aggregate/regression/regr_count.cpp" 6 | 7 | #include "extension/core_functions/aggregate/regression/regr_r2.cpp" 8 | 9 | #include "extension/core_functions/aggregate/regression/regr_avg.cpp" 10 | 11 | #include "extension/core_functions/aggregate/regression/regr_slope.cpp" 12 | 13 | #include "extension/core_functions/aggregate/regression/regr_sxx_syy.cpp" 14 | 15 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | .PHONY: all opt unit clean debug release test unittest allunit benchmark docs doxygen format sqlite 2 | 3 | all: format-check 4 | 5 | format-check: 6 | python3 scripts/format.py --all --check 7 | 8 | format-check-silent: 9 | python3 scripts/format.py --all --check --silent 10 | 11 | format-fix: 12 | rm -rf src/amalgamation/* 13 | python3 scripts/format.py --all --fix --noconfirm 14 | 15 | format-head: 16 | python3 scripts/format.py HEAD --fix --noconfirm 17 | 18 | format-changes: 19 | python3 scripts/format.py HEAD --fix --noconfirm 20 | 21 | format-main: 22 | python3 scripts/format.py main --fix --noconfirm 23 | -------------------------------------------------------------------------------- /R/dbGetInfo__duckdb_driver.R: -------------------------------------------------------------------------------- 1 | #' @rdname duckdb_driver-class 2 | #' @inheritParams DBI::dbGetInfo 3 | #' @param dbObj An object inheriting from class [duckdb_driver-class]. 4 | #' @usage NULL 5 | dbGetInfo__duckdb_driver <- function(dbObj, ...) { 6 | # Use hard-coded version instead of querying database to avoid establishing connection 7 | version <- get_duckdb_version() 8 | 9 | list( 10 | driver.version = version, 11 | client.version = version, 12 | dbname = dbObj@dbdir 13 | ) 14 | } 15 | 16 | #' @rdname duckdb_driver-class 17 | #' @export 18 | setMethod("dbGetInfo", "duckdb_driver", dbGetInfo__duckdb_driver) 19 | -------------------------------------------------------------------------------- /src/duckdb/extension/core_functions/aggregate/algebraic/corr.cpp: -------------------------------------------------------------------------------- 1 | #include "core_functions/aggregate/algebraic_functions.hpp" 2 | #include "core_functions/aggregate/algebraic/covar.hpp" 3 | #include "core_functions/aggregate/algebraic/stddev.hpp" 4 | #include "core_functions/aggregate/algebraic/corr.hpp" 5 | #include "duckdb/function/function_set.hpp" 6 | 7 | namespace duckdb { 8 | 9 | AggregateFunction CorrFun::GetFunction() { 10 | return AggregateFunction::BinaryAggregate( 11 | LogicalType::DOUBLE, LogicalType::DOUBLE, LogicalType::DOUBLE); 12 | } 13 | } // namespace duckdb 14 | -------------------------------------------------------------------------------- /src/duckdb/extension/parquet/include/parquet_extension.hpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // DuckDB 3 | // 4 | // parquet_extension.hpp 5 | // 6 | // 7 | //===----------------------------------------------------------------------===/ 8 | 9 | #pragma once 10 | 11 | #include "duckdb.hpp" 12 | 13 | namespace duckdb { 14 | 15 | class ParquetExtension : public Extension { 16 | public: 17 | void Load(ExtensionLoader &loader) override; 18 | std::string Name() override; 19 | std::string Version() const override; 20 | }; 21 | 22 | } // namespace duckdb 23 | -------------------------------------------------------------------------------- /src/duckdb/src/execution/physical_plan/plan_cross_product.cpp: -------------------------------------------------------------------------------- 1 | #include "duckdb/execution/operator/join/physical_cross_product.hpp" 2 | #include "duckdb/execution/physical_plan_generator.hpp" 3 | #include "duckdb/planner/operator/logical_cross_product.hpp" 4 | 5 | namespace duckdb { 6 | 7 | PhysicalOperator &PhysicalPlanGenerator::CreatePlan(LogicalCrossProduct &op) { 8 | D_ASSERT(op.children.size() == 2); 9 | auto &left = CreatePlan(*op.children[0]); 10 | auto &right = CreatePlan(*op.children[1]); 11 | return Make(op.types, left, right, op.estimated_cardinality); 12 | } 13 | 14 | } // namespace duckdb 15 | -------------------------------------------------------------------------------- /src/duckdb/src/parser/statement/copy_statement.cpp: -------------------------------------------------------------------------------- 1 | #include "duckdb/parser/statement/copy_statement.hpp" 2 | 3 | namespace duckdb { 4 | 5 | CopyStatement::CopyStatement() : SQLStatement(StatementType::COPY_STATEMENT), info(make_uniq()) { 6 | } 7 | 8 | CopyStatement::CopyStatement(const CopyStatement &other) : SQLStatement(other), info(other.info->Copy()) { 9 | } 10 | 11 | string CopyStatement::ToString() const { 12 | return info->ToString(); 13 | } 14 | 15 | unique_ptr CopyStatement::Copy() const { 16 | return unique_ptr(new CopyStatement(*this)); 17 | } 18 | 19 | } // namespace duckdb 20 | -------------------------------------------------------------------------------- /src/duckdb/src/parser/statement/drop_statement.cpp: -------------------------------------------------------------------------------- 1 | #include "duckdb/parser/statement/drop_statement.hpp" 2 | 3 | namespace duckdb { 4 | 5 | DropStatement::DropStatement() : SQLStatement(StatementType::DROP_STATEMENT), info(make_uniq()) { 6 | } 7 | 8 | DropStatement::DropStatement(const DropStatement &other) : SQLStatement(other), info(other.info->Copy()) { 9 | } 10 | 11 | unique_ptr DropStatement::Copy() const { 12 | return unique_ptr(new DropStatement(*this)); 13 | } 14 | 15 | string DropStatement::ToString() const { 16 | return info->ToString(); 17 | } 18 | 19 | } // namespace duckdb 20 | -------------------------------------------------------------------------------- /src/duckdb/ub_src_common_arrow.cpp: -------------------------------------------------------------------------------- 1 | #include "src/common/arrow/arrow_appender.cpp" 2 | 3 | #include "src/common/arrow/arrow_converter.cpp" 4 | 5 | #include "src/common/arrow/arrow_type_extension.cpp" 6 | 7 | #include "src/common/arrow/arrow_merge_event.cpp" 8 | 9 | #include "src/common/arrow/arrow_query_result.cpp" 10 | 11 | #include "src/common/arrow/arrow_util.cpp" 12 | 13 | #include "src/common/arrow/arrow_wrapper.cpp" 14 | 15 | #include "src/common/arrow/physical_arrow_collector.cpp" 16 | 17 | #include "src/common/arrow/physical_arrow_batch_collector.cpp" 18 | 19 | #include "src/common/arrow/schema_metadata.cpp" 20 | 21 | -------------------------------------------------------------------------------- /src/duckdb/ub_src_execution_operator_csv_scanner_sniffer.cpp: -------------------------------------------------------------------------------- 1 | #include "src/execution/operator/csv_scanner/sniffer/csv_sniffer.cpp" 2 | 3 | #include "src/execution/operator/csv_scanner/sniffer/dialect_detection.cpp" 4 | 5 | #include "src/execution/operator/csv_scanner/sniffer/header_detection.cpp" 6 | 7 | #include "src/execution/operator/csv_scanner/sniffer/set_columns.cpp" 8 | 9 | #include "src/execution/operator/csv_scanner/sniffer/type_detection.cpp" 10 | 11 | #include "src/execution/operator/csv_scanner/sniffer/type_refinement.cpp" 12 | 13 | #include "src/execution/operator/csv_scanner/sniffer/type_replacement.cpp" 14 | 15 | -------------------------------------------------------------------------------- /R/rethrow.R: -------------------------------------------------------------------------------- 1 | rethrow_error_from_rapi <- function(e, call) { 2 | # https://github.com/duckdb/duckdb-r/issues/519 3 | # After moving all error messages to JSON, we can parse them 4 | # and return rich error information to R. 5 | # For now, we just rethrow the error message as is, this gets us 6 | # the caller. 7 | 8 | msg <- conditionMessage(e) 9 | tryCatch( 10 | # Called for side effect, rlang::abort() eventually calls nchar() 11 | nchar(msg), 12 | error = function(e) { 13 | msg <<- iconv(msg, from = "UTF-8", to = "UTF-8", sub = "?") 14 | } 15 | ) 16 | 17 | rlang::abort(msg, call = call) 18 | } 19 | -------------------------------------------------------------------------------- /src/duckdb/src/execution/physical_plan/plan_unnest.cpp: -------------------------------------------------------------------------------- 1 | #include "duckdb/execution/operator/projection/physical_unnest.hpp" 2 | #include "duckdb/execution/physical_plan_generator.hpp" 3 | #include "duckdb/planner/operator/logical_unnest.hpp" 4 | 5 | namespace duckdb { 6 | 7 | PhysicalOperator &PhysicalPlanGenerator::CreatePlan(LogicalUnnest &op) { 8 | D_ASSERT(op.children.size() == 1); 9 | auto &plan = CreatePlan(*op.children[0]); 10 | auto &unnest = Make(op.types, std::move(op.expressions), op.estimated_cardinality); 11 | unnest.children.push_back(plan); 12 | return unnest; 13 | } 14 | 15 | } // namespace duckdb 16 | -------------------------------------------------------------------------------- /src/duckdb/third_party/mbedtls/include/psa/build_info.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file psa/build_info.h 3 | * 4 | * \brief Build-time PSA configuration info 5 | * 6 | * Include this file if you need to depend on the 7 | * configuration options defined in mbedtls_config.h or MBEDTLS_CONFIG_FILE 8 | * in PSA cryptography core specific files. 9 | */ 10 | /* 11 | * Copyright The Mbed TLS Contributors 12 | * SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later 13 | */ 14 | 15 | #ifndef PSA_CRYPTO_BUILD_INFO_H 16 | #define PSA_CRYPTO_BUILD_INFO_H 17 | 18 | #include "mbedtls/build_info.h" 19 | 20 | #endif /* PSA_CRYPTO_BUILD_INFO_H */ 21 | -------------------------------------------------------------------------------- /src/duckdb/src/include/duckdb/common/enums/quantile_enum.hpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // DuckDB 3 | // 4 | // duckdb/common/enums/quantile_enum.hpp 5 | // 6 | // 7 | //===----------------------------------------------------------------------===// 8 | 9 | #pragma once 10 | 11 | #include "duckdb/common/constants.hpp" 12 | 13 | namespace duckdb { 14 | 15 | enum class QuantileSerializationType : uint8_t { 16 | NON_DECIMAL = 0, 17 | DECIMAL_DISCRETE, 18 | DECIMAL_DISCRETE_LIST, 19 | DECIMAL_CONTINUOUS, 20 | DECIMAL_CONTINUOUS_LIST 21 | }; 22 | 23 | } 24 | -------------------------------------------------------------------------------- /src/duckdb/src/include/duckdb/common/enums/scan_vector_type.hpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // DuckDB 3 | // 4 | // duckdb/common/enums/scan_vector_type.hpp 5 | // 6 | // 7 | //===----------------------------------------------------------------------===// 8 | 9 | #pragma once 10 | 11 | #include "duckdb/common/constants.hpp" 12 | 13 | namespace duckdb { 14 | 15 | enum class ScanVectorType { SCAN_ENTIRE_VECTOR, SCAN_FLAT_VECTOR }; 16 | 17 | enum class ScanVectorMode { REGULAR_SCAN, SCAN_COMMITTED, SCAN_COMMITTED_NO_UPDATES }; 18 | 19 | } // namespace duckdb 20 | -------------------------------------------------------------------------------- /src/duckdb/src/include/duckdb/common/adbc/wrappers.hpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // DuckDB 3 | // 4 | // duckdb/common/adbc/wrappers.hpp 5 | // 6 | // 7 | //===----------------------------------------------------------------------===// 8 | 9 | #pragma once 10 | 11 | #include "duckdb.h" 12 | #include "duckdb/common/string.hpp" 13 | #include "duckdb/common/unordered_map.hpp" 14 | 15 | namespace duckdb { 16 | 17 | struct DuckDBAdbcConnectionWrapper { 18 | duckdb_connection connection; 19 | unordered_map options; 20 | }; 21 | } // namespace duckdb 22 | -------------------------------------------------------------------------------- /src/duckdb/src/optimizer/statistics/expression/propagate_columnref.cpp: -------------------------------------------------------------------------------- 1 | #include "duckdb/optimizer/statistics_propagator.hpp" 2 | #include "duckdb/planner/expression/bound_columnref_expression.hpp" 3 | 4 | namespace duckdb { 5 | 6 | unique_ptr StatisticsPropagator::PropagateExpression(BoundColumnRefExpression &colref, 7 | unique_ptr &expr_ptr) { 8 | auto stats = statistics_map.find(colref.binding); 9 | if (stats == statistics_map.end()) { 10 | return nullptr; 11 | } 12 | return stats->second->ToUnique(); 13 | } 14 | 15 | } // namespace duckdb 16 | -------------------------------------------------------------------------------- /src/duckdb/src/parser/parsed_data/extra_drop_info.cpp: -------------------------------------------------------------------------------- 1 | #include "duckdb/parser/parsed_data/extra_drop_info.hpp" 2 | 3 | namespace duckdb { 4 | 5 | ExtraDropSecretInfo::ExtraDropSecretInfo() : ExtraDropInfo(ExtraDropInfoType::SECRET_INFO) { 6 | } 7 | 8 | ExtraDropSecretInfo::ExtraDropSecretInfo(const ExtraDropSecretInfo &info) 9 | : ExtraDropInfo(ExtraDropInfoType::SECRET_INFO) { 10 | persist_mode = info.persist_mode; 11 | secret_storage = info.secret_storage; 12 | } 13 | 14 | unique_ptr ExtraDropSecretInfo::Copy() const { 15 | return std::move(make_uniq(*this)); 16 | } 17 | 18 | } // namespace duckdb 19 | -------------------------------------------------------------------------------- /src/duckdb/extension/core_functions/include/core_functions_extension.hpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // DuckDB 3 | // 4 | // core_functions_extension.hpp 5 | // 6 | // 7 | //===----------------------------------------------------------------------===// 8 | 9 | #pragma once 10 | 11 | #include "duckdb.hpp" 12 | 13 | namespace duckdb { 14 | 15 | class CoreFunctionsExtension : public Extension { 16 | public: 17 | void Load(ExtensionLoader &db) override; 18 | std::string Name() override; 19 | std::string Version() const override; 20 | }; 21 | 22 | } // namespace duckdb 23 | -------------------------------------------------------------------------------- /src/duckdb/src/include/duckdb/common/named_parameter_map.hpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // DuckDB 3 | // 4 | // duckdb/common/named_parameter_map.hpp 5 | // 6 | // 7 | //===----------------------------------------------------------------------===// 8 | 9 | #pragma once 10 | 11 | #include "duckdb/common/case_insensitive_map.hpp" 12 | #include "duckdb/common/types.hpp" 13 | namespace duckdb { 14 | 15 | using named_parameter_type_map_t = case_insensitive_map_t; 16 | using named_parameter_map_t = case_insensitive_map_t; 17 | 18 | } // namespace duckdb 19 | -------------------------------------------------------------------------------- /tests/testthat/helper-skip.R: -------------------------------------------------------------------------------- 1 | # https://github.com/r-lib/testthat/issues/2236 2 | skip_on_dev_version <- function() { 3 | version <- asNamespace(testing_package())[[".__NAMESPACE__."]][["spec"]][[ 4 | "version" 5 | ]] |> 6 | package_version() |> 7 | unclass() |> 8 | getElement(1L) 9 | 10 | if (length(version) < 3 || tail(version, 1L) < 9000) { 11 | invisible() 12 | } else { 13 | skip("Skip on development versions.") 14 | } 15 | } 16 | 17 | # Skip on CRAN, but run on R-universe 18 | skip_on_cran_except_r_universe <- function() { 19 | if (!nzchar(Sys.getenv("MY_UNIVERSE"))) { 20 | skip_on_cran() 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /scripts/python_helpers.py: -------------------------------------------------------------------------------- 1 | def open_utf8(fpath, flags): 2 | import sys 3 | if sys.version_info[0] < 3: 4 | return open(fpath, flags) 5 | else: 6 | return open(fpath, flags, encoding="utf8") 7 | 8 | def normalize_path(path): 9 | import os 10 | 11 | def normalize(p): 12 | return os.path.sep.join(p.split('/')) 13 | 14 | if isinstance(path, list): 15 | normed = map(lambda p: normalize(p), path) 16 | return list(normed) 17 | 18 | if (isinstance, str): 19 | return normalize(path) 20 | 21 | raise Exception("Can only be called with a str or list argument") 22 | 23 | -------------------------------------------------------------------------------- /src/duckdb/src/execution/physical_plan/plan_delim_get.cpp: -------------------------------------------------------------------------------- 1 | #include "duckdb/execution/operator/scan/physical_column_data_scan.hpp" 2 | #include "duckdb/execution/physical_plan_generator.hpp" 3 | #include "duckdb/planner/operator/logical_delim_get.hpp" 4 | 5 | namespace duckdb { 6 | 7 | PhysicalOperator &PhysicalPlanGenerator::CreatePlan(LogicalDelimGet &op) { 8 | // Create a PhysicalChunkScan without an owned_collection. 9 | // We'll add the collection later. 10 | D_ASSERT(op.children.empty()); 11 | return Make(op.types, PhysicalOperatorType::DELIM_SCAN, op.estimated_cardinality, nullptr); 12 | } 13 | 14 | } // namespace duckdb 15 | -------------------------------------------------------------------------------- /src/duckdb/src/include/duckdb/common/enums/checkpoint_abort.hpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // DuckDB 3 | // 4 | // duckdb/common/enums/checkpoint_abort.hpp 5 | // 6 | // 7 | //===----------------------------------------------------------------------===// 8 | 9 | #pragma once 10 | 11 | #include "duckdb/common/common.hpp" 12 | 13 | namespace duckdb { 14 | 15 | enum class CheckpointAbort : uint8_t { 16 | NO_ABORT = 0, 17 | DEBUG_ABORT_BEFORE_TRUNCATE = 1, 18 | DEBUG_ABORT_BEFORE_HEADER = 2, 19 | DEBUG_ABORT_AFTER_FREE_LIST_WRITE = 3 20 | }; 21 | 22 | } // namespace duckdb 23 | -------------------------------------------------------------------------------- /src/duckdb/src/parser/statement/pragma_statement.cpp: -------------------------------------------------------------------------------- 1 | #include "duckdb/parser/statement/pragma_statement.hpp" 2 | 3 | namespace duckdb { 4 | 5 | PragmaStatement::PragmaStatement() : SQLStatement(StatementType::PRAGMA_STATEMENT), info(make_uniq()) { 6 | } 7 | 8 | PragmaStatement::PragmaStatement(const PragmaStatement &other) : SQLStatement(other), info(other.info->Copy()) { 9 | } 10 | 11 | unique_ptr PragmaStatement::Copy() const { 12 | return unique_ptr(new PragmaStatement(*this)); 13 | } 14 | 15 | string PragmaStatement::ToString() const { 16 | return info->ToString(); 17 | } 18 | 19 | } // namespace duckdb 20 | -------------------------------------------------------------------------------- /src/duckdb/src/planner/binder/tableref/bind_delimgetref.cpp: -------------------------------------------------------------------------------- 1 | #include "duckdb/parser/tableref/delimgetref.hpp" 2 | #include "duckdb/planner/binder.hpp" 3 | #include "duckdb/planner/tableref/bound_delimgetref.hpp" 4 | 5 | namespace duckdb { 6 | 7 | unique_ptr Binder::Bind(DelimGetRef &ref) { 8 | // Have to add bindings 9 | idx_t tbl_idx = GenerateTableIndex(); 10 | string internal_name = "__internal_delim_get_ref_" + std::to_string(tbl_idx); 11 | bind_context.AddGenericBinding(tbl_idx, internal_name, ref.internal_aliases, ref.types); 12 | 13 | return make_uniq(tbl_idx, ref.types); 14 | } 15 | 16 | } // namespace duckdb 17 | -------------------------------------------------------------------------------- /src/duckdb/src/planner/operator/logical_simple.cpp: -------------------------------------------------------------------------------- 1 | #include "duckdb/planner/operator/logical_simple.hpp" 2 | #include "duckdb/parser/parsed_data/alter_info.hpp" 3 | #include "duckdb/parser/parsed_data/attach_info.hpp" 4 | #include "duckdb/parser/parsed_data/drop_info.hpp" 5 | #include "duckdb/parser/parsed_data/load_info.hpp" 6 | #include "duckdb/parser/parsed_data/transaction_info.hpp" 7 | #include "duckdb/parser/parsed_data/vacuum_info.hpp" 8 | #include "duckdb/parser/parsed_data/detach_info.hpp" 9 | 10 | namespace duckdb { 11 | 12 | idx_t LogicalSimple::EstimateCardinality(ClientContext &context) { 13 | return 1; 14 | } 15 | 16 | } // namespace duckdb 17 | -------------------------------------------------------------------------------- /src/duckdb/src/execution/physical_plan/plan_column_data_get.cpp: -------------------------------------------------------------------------------- 1 | #include "duckdb/execution/operator/scan/physical_column_data_scan.hpp" 2 | #include "duckdb/execution/physical_plan_generator.hpp" 3 | #include "duckdb/planner/operator/logical_column_data_get.hpp" 4 | 5 | namespace duckdb { 6 | 7 | PhysicalOperator &PhysicalPlanGenerator::CreatePlan(LogicalColumnDataGet &op) { 8 | D_ASSERT(op.children.empty()); 9 | D_ASSERT(op.collection); 10 | return Make(op.types, PhysicalOperatorType::COLUMN_DATA_SCAN, op.estimated_cardinality, 11 | std::move(op.collection)); 12 | } 13 | 14 | } // namespace duckdb 15 | -------------------------------------------------------------------------------- /src/duckdb/third_party/brotli/enc/dictionary_hash.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2015 Google Inc. All Rights Reserved. 2 | 3 | Distributed under MIT license. 4 | See file LICENSE for detail or copy at https://opensource.org/licenses/MIT 5 | */ 6 | 7 | /* Hash table on the 4-byte prefixes of static dictionary words. */ 8 | 9 | #ifndef BROTLI_ENC_DICTIONARY_HASH_H_ 10 | #define BROTLI_ENC_DICTIONARY_HASH_H_ 11 | 12 | #include 13 | 14 | namespace duckdb_brotli { 15 | 16 | extern const uint16_t kStaticDictionaryHashWords[32768]; 17 | extern const uint8_t kStaticDictionaryHashLengths[32768]; 18 | 19 | } 20 | 21 | #endif /* BROTLI_ENC_DICTIONARY_HASH_H_ */ 22 | -------------------------------------------------------------------------------- /src/include/r_progress_bar_display.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "rapi.hpp" 4 | #include "duckdb/common/progress_bar/progress_bar_display.hpp" 5 | #include "duckdb/common/helper.hpp" 6 | 7 | namespace duckdb { 8 | 9 | class RProgressBarDisplay : public ProgressBarDisplay { 10 | public: 11 | RProgressBarDisplay(); 12 | virtual ~RProgressBarDisplay() { 13 | } 14 | 15 | static unique_ptr Create(); 16 | 17 | public: 18 | void Update(double percentage) override; 19 | void Finish() override; 20 | 21 | private: 22 | void Initialize(); 23 | 24 | private: 25 | SEXP progress_callback = R_NilValue; 26 | }; 27 | 28 | } // namespace duckdb 29 | -------------------------------------------------------------------------------- /src/duckdb/src/function/cast/pointer_cast.cpp: -------------------------------------------------------------------------------- 1 | #include "duckdb/function/cast/default_casts.hpp" 2 | #include "duckdb/function/cast/vector_cast_helpers.hpp" 3 | 4 | namespace duckdb { 5 | 6 | BoundCastInfo DefaultCasts::PointerCastSwitch(BindCastInput &input, const LogicalType &source, 7 | const LogicalType &target) { 8 | // now switch on the result type 9 | switch (target.id()) { 10 | case LogicalTypeId::VARCHAR: 11 | // pointer to varchar 12 | return BoundCastInfo(&VectorCastHelpers::StringCast); 13 | default: 14 | return nullptr; 15 | } 16 | } 17 | 18 | } // namespace duckdb 19 | -------------------------------------------------------------------------------- /src/duckdb/src/include/duckdb/common/types/sel_cache.hpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // DuckDB 3 | // 4 | // duckdb/common/types/sel_cache.hpp 5 | // 6 | // 7 | //===----------------------------------------------------------------------===// 8 | 9 | #pragma once 10 | 11 | #include "duckdb/common/types/vector_buffer.hpp" 12 | #include "duckdb/common/unordered_map.hpp" 13 | 14 | namespace duckdb { 15 | 16 | //! Selection vector cache used for caching vector slices 17 | struct SelCache { 18 | unordered_map> cache; 19 | }; 20 | 21 | } // namespace duckdb 22 | -------------------------------------------------------------------------------- /src/duckdb/src/parallel/task_notifier.cpp: -------------------------------------------------------------------------------- 1 | #include "duckdb/parallel/task_notifier.hpp" 2 | #include "duckdb/main/client_context.hpp" 3 | #include "duckdb/main/client_context_state.hpp" 4 | 5 | namespace duckdb { 6 | 7 | TaskNotifier::TaskNotifier(optional_ptr context_p) : context(context_p) { 8 | if (context) { 9 | for (auto &state : context->registered_state->States()) { 10 | state->OnTaskStart(*context); 11 | } 12 | } 13 | } 14 | 15 | TaskNotifier::~TaskNotifier() { 16 | if (context) { 17 | for (auto &state : context->registered_state->States()) { 18 | state->OnTaskStop(*context); 19 | } 20 | } 21 | } 22 | 23 | } // namespace duckdb 24 | -------------------------------------------------------------------------------- /src/duckdb/src/storage/index.cpp: -------------------------------------------------------------------------------- 1 | #include "duckdb/storage/index.hpp" 2 | #include "duckdb/common/radix.hpp" 3 | #include "duckdb/common/serializer/serializer.hpp" 4 | 5 | namespace duckdb { 6 | 7 | Index::Index(const vector &column_ids, TableIOManager &table_io_manager, AttachedDatabase &db) 8 | 9 | : column_ids(column_ids), table_io_manager(table_io_manager), db(db) { 10 | 11 | if (!Radix::IsLittleEndian()) { 12 | throw NotImplementedException("indexes are not supported on big endian architectures"); 13 | } 14 | // create the column id set 15 | column_id_set.insert(column_ids.begin(), column_ids.end()); 16 | } 17 | 18 | } // namespace duckdb 19 | -------------------------------------------------------------------------------- /.github/workflows/matrix-check/action.yml: -------------------------------------------------------------------------------- 1 | name: "Actions to check a matrix with all R and OS versions, computed with the versions-matrix action" 2 | inputs: 3 | matrix: 4 | description: "Generated matrix" 5 | required: true 6 | 7 | runs: 8 | using: "composite" 9 | steps: 10 | - name: Install json2yaml 11 | run: | 12 | sudo npm install -g json2yaml 13 | shell: bash 14 | 15 | - run: | 16 | matrix='${{ inputs.matrix }}' 17 | if [ -n "${matrix}" ]; then 18 | echo $matrix | jq . 19 | echo $matrix | json2yaml 20 | else 21 | echo "No matrix found" 22 | fi 23 | shell: bash 24 | -------------------------------------------------------------------------------- /R/dbRemoveTable__duckdb_connection_character.R: -------------------------------------------------------------------------------- 1 | #' @rdname duckdb_connection-class 2 | #' @inheritParams DBI::dbRemoveTable 3 | #' @usage NULL 4 | dbRemoveTable__duckdb_connection_character <- function(conn, name, ..., fail_if_missing = TRUE) { 5 | sql <- paste0("DROP TABLE ", if (!fail_if_missing) "IF EXISTS ", "?") 6 | dbExecute( 7 | conn, 8 | sqlInterpolate(conn, sql, dbQuoteIdentifier(conn, name)) 9 | ) 10 | rs_on_connection_updated(conn, "Table removed") 11 | invisible(TRUE) 12 | } 13 | 14 | #' @rdname duckdb_connection-class 15 | #' @export 16 | setMethod("dbRemoveTable", c("duckdb_connection", "character"), dbRemoveTable__duckdb_connection_character) 17 | -------------------------------------------------------------------------------- /src/duckdb/extension/core_functions/scalar/generic/hash.cpp: -------------------------------------------------------------------------------- 1 | #include "core_functions/scalar/generic_functions.hpp" 2 | 3 | namespace duckdb { 4 | 5 | static void HashFunction(DataChunk &args, ExpressionState &state, Vector &result) { 6 | args.Hash(result); 7 | if (args.AllConstant()) { 8 | result.SetVectorType(VectorType::CONSTANT_VECTOR); 9 | } 10 | } 11 | 12 | ScalarFunction HashFun::GetFunction() { 13 | auto hash_fun = ScalarFunction({LogicalType::ANY}, LogicalType::HASH, HashFunction); 14 | hash_fun.varargs = LogicalType::ANY; 15 | hash_fun.null_handling = FunctionNullHandling::SPECIAL_HANDLING; 16 | return hash_fun; 17 | } 18 | 19 | } // namespace duckdb 20 | -------------------------------------------------------------------------------- /src/duckdb/src/common/types/vector_constants.cpp: -------------------------------------------------------------------------------- 1 | #include "duckdb/common/types/vector.hpp" 2 | 3 | namespace duckdb { 4 | 5 | const SelectionVector *ConstantVector::ZeroSelectionVector() { 6 | static const SelectionVector ZERO_SELECTION_VECTOR = 7 | SelectionVector(const_cast(ConstantVector::ZERO_VECTOR)); // NOLINT 8 | return &ZERO_SELECTION_VECTOR; 9 | } 10 | 11 | const SelectionVector *FlatVector::IncrementalSelectionVector() { 12 | static const SelectionVector INCREMENTAL_SELECTION_VECTOR; 13 | return &INCREMENTAL_SELECTION_VECTOR; 14 | } 15 | 16 | const sel_t ConstantVector::ZERO_VECTOR[STANDARD_VECTOR_SIZE] = {0}; 17 | 18 | } // namespace duckdb 19 | -------------------------------------------------------------------------------- /src/duckdb/src/planner/binder/tableref/plan_subqueryref.cpp: -------------------------------------------------------------------------------- 1 | #include "duckdb/planner/binder.hpp" 2 | #include "duckdb/planner/tableref/bound_subqueryref.hpp" 3 | 4 | namespace duckdb { 5 | 6 | unique_ptr Binder::CreatePlan(BoundSubqueryRef &ref) { 7 | // generate the logical plan for the subquery 8 | // this happens separately from the current LogicalPlan generation 9 | ref.binder->is_outside_flattened = is_outside_flattened; 10 | auto subquery = ref.binder->CreatePlan(*ref.subquery); 11 | if (ref.binder->has_unplanned_dependent_joins) { 12 | has_unplanned_dependent_joins = true; 13 | } 14 | return subquery; 15 | } 16 | 17 | } // namespace duckdb 18 | -------------------------------------------------------------------------------- /src/duckdb/ub_src_catalog.cpp: -------------------------------------------------------------------------------- 1 | #include "src/catalog/catalog_entry.cpp" 2 | 3 | #include "src/catalog/catalog_entry_retriever.cpp" 4 | 5 | #include "src/catalog/catalog.cpp" 6 | 7 | #include "src/catalog/catalog_search_path.cpp" 8 | 9 | #include "src/catalog/catalog_set.cpp" 10 | 11 | #include "src/catalog/catalog_transaction.cpp" 12 | 13 | #include "src/catalog/duck_catalog.cpp" 14 | 15 | #include "src/catalog/dependency_manager.cpp" 16 | 17 | #include "src/catalog/dependency_list.cpp" 18 | 19 | #include "src/catalog/dependency_catalog_set.cpp" 20 | 21 | #include "src/catalog/entry_lookup_info.cpp" 22 | 23 | #include "src/catalog/similar_catalog_entry.cpp" 24 | 25 | -------------------------------------------------------------------------------- /src/duckdb/src/include/duckdb/common/enums/pending_execution_result.hpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // DuckDB 3 | // 4 | // duckdb/common/enums/pending_execution_result.hpp 5 | // 6 | // 7 | //===----------------------------------------------------------------------===// 8 | 9 | #pragma once 10 | 11 | #include "duckdb/common/constants.hpp" 12 | 13 | namespace duckdb { 14 | 15 | enum class PendingExecutionResult : uint8_t { 16 | RESULT_READY, 17 | RESULT_NOT_READY, 18 | EXECUTION_ERROR, 19 | BLOCKED, 20 | NO_TASKS_AVAILABLE, 21 | EXECUTION_FINISHED 22 | }; 23 | 24 | } // namespace duckdb 25 | -------------------------------------------------------------------------------- /src/duckdb/src/include/duckdb/common/likely.hpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // DuckDB 3 | // 4 | // duckdb/common/likely.hpp 5 | // 6 | // 7 | //===----------------------------------------------------------------------===// 8 | 9 | #pragma once 10 | 11 | #if __GNUC__ 12 | #define DUCKDB_BUILTIN_EXPECT(cond, expected_value) (__builtin_expect(cond, expected_value)) 13 | #else 14 | #define DUCKDB_BUILTIN_EXPECT(cond, expected_value) (cond) 15 | #endif 16 | 17 | #define DUCKDB_LIKELY(...) DUCKDB_BUILTIN_EXPECT((__VA_ARGS__), 1) 18 | #define DUCKDB_UNLIKELY(...) DUCKDB_BUILTIN_EXPECT((__VA_ARGS__), 0) 19 | -------------------------------------------------------------------------------- /src/duckdb/src/include/duckdb/common/progress_bar/progress_bar_display.hpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // DuckDB 3 | // 4 | // duckdb/common/progress_bar/progress_bar_display.hpp 5 | // 6 | // 7 | //===----------------------------------------------------------------------===// 8 | 9 | #pragma once 10 | 11 | namespace duckdb { 12 | 13 | class ProgressBarDisplay { 14 | public: 15 | ProgressBarDisplay() { 16 | } 17 | virtual ~ProgressBarDisplay() { 18 | } 19 | 20 | public: 21 | virtual void Update(double percentage) = 0; 22 | virtual void Finish() = 0; 23 | }; 24 | 25 | } // namespace duckdb 26 | -------------------------------------------------------------------------------- /src/duckdb/src/parser/statement/relation_statement.cpp: -------------------------------------------------------------------------------- 1 | #include "duckdb/parser/statement/relation_statement.hpp" 2 | #include "duckdb/main/relation/query_relation.hpp" 3 | 4 | namespace duckdb { 5 | 6 | RelationStatement::RelationStatement(shared_ptr relation_p) 7 | : SQLStatement(StatementType::RELATION_STATEMENT), relation(std::move(relation_p)) { 8 | query = relation->GetQuery(); 9 | } 10 | 11 | unique_ptr RelationStatement::Copy() const { 12 | return unique_ptr(new RelationStatement(*this)); 13 | } 14 | 15 | string RelationStatement::ToString() const { 16 | return relation->ToString(); 17 | } 18 | 19 | } // namespace duckdb 20 | -------------------------------------------------------------------------------- /src/duckdb/src/planner/operator/logical_top_n.cpp: -------------------------------------------------------------------------------- 1 | #include "duckdb/planner/operator/logical_top_n.hpp" 2 | 3 | namespace duckdb { 4 | 5 | LogicalTopN::LogicalTopN(vector orders, idx_t limit, idx_t offset) 6 | : LogicalOperator(LogicalOperatorType::LOGICAL_TOP_N), orders(std::move(orders)), limit(limit), offset(offset) { 7 | } 8 | 9 | LogicalTopN::~LogicalTopN() { 10 | } 11 | 12 | idx_t LogicalTopN::EstimateCardinality(ClientContext &context) { 13 | auto child_cardinality = LogicalOperator::EstimateCardinality(context); 14 | if (child_cardinality < limit) { 15 | return child_cardinality; 16 | } 17 | return limit; 18 | } 19 | 20 | } // namespace duckdb 21 | -------------------------------------------------------------------------------- /R/dbGetInfo__duckdb_connection.R: -------------------------------------------------------------------------------- 1 | #' @rdname duckdb_connection-class 2 | #' @inheritParams DBI::dbGetInfo 3 | #' @param dbObj An object inheriting from class [duckdb_connection-class]. 4 | #' @usage NULL 5 | dbGetInfo__duckdb_connection <- function(dbObj, ...) { 6 | # Use hard-coded version instead of querying database to avoid establishing connection 7 | version <- get_duckdb_version() 8 | 9 | list( 10 | dbname = dbObj@driver@dbdir, 11 | db.version = version, 12 | username = NA, 13 | host = NA, 14 | port = NA 15 | ) 16 | } 17 | 18 | #' @rdname duckdb_connection-class 19 | #' @export 20 | setMethod("dbGetInfo", "duckdb_connection", dbGetInfo__duckdb_connection) 21 | -------------------------------------------------------------------------------- /src/duckdb/src/common/arrow/appender/null_data.cpp: -------------------------------------------------------------------------------- 1 | #include "duckdb/common/arrow/arrow_appender.hpp" 2 | #include "duckdb/common/arrow/appender/null_data.hpp" 3 | 4 | namespace duckdb { 5 | 6 | void ArrowNullData::Initialize(ArrowAppendData &result, const LogicalType &type, idx_t capacity) { 7 | // nop 8 | } 9 | 10 | void ArrowNullData::Append(ArrowAppendData &append_data, Vector &input, idx_t from, idx_t to, idx_t input_size) { 11 | idx_t size = to - from; 12 | append_data.row_count += size; 13 | } 14 | 15 | void ArrowNullData::Finalize(ArrowAppendData &append_data, const LogicalType &type, ArrowArray *result) { 16 | result->n_buffers = 0; 17 | } 18 | 19 | } // namespace duckdb 20 | -------------------------------------------------------------------------------- /src/duckdb/src/include/duckdb/common/enums/copy_overwrite_mode.hpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // DuckDB 3 | // 4 | // duckdb/common/enums/copy_overwrite_mode.hpp 5 | // 6 | // 7 | //===----------------------------------------------------------------------===// 8 | 9 | #pragma once 10 | 11 | #include "duckdb/common/constants.hpp" 12 | #include "duckdb/common/vector.hpp" 13 | 14 | namespace duckdb { 15 | 16 | enum class CopyOverwriteMode : uint8_t { 17 | COPY_ERROR_ON_CONFLICT = 0, 18 | COPY_OVERWRITE = 1, 19 | COPY_OVERWRITE_OR_IGNORE = 2, 20 | COPY_APPEND = 3 21 | }; 22 | 23 | } // namespace duckdb 24 | -------------------------------------------------------------------------------- /src/duckdb/src/include/duckdb/common/enums/cte_materialize.hpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // DuckDB 3 | // 4 | // duckdb/common/enums/cte_materialize.hpp 5 | // 6 | // 7 | //===----------------------------------------------------------------------===// 8 | 9 | #pragma once 10 | 11 | #include "duckdb/common/constants.hpp" 12 | 13 | namespace duckdb { 14 | 15 | enum class CTEMaterialize : uint8_t { 16 | CTE_MATERIALIZE_DEFAULT = 1, /* no option specified */ 17 | CTE_MATERIALIZE_ALWAYS = 2, /* MATERIALIZED */ 18 | CTE_MATERIALIZE_NEVER = 3 /* NOT MATERIALIZED */ 19 | }; 20 | 21 | } // namespace duckdb 22 | -------------------------------------------------------------------------------- /src/duckdb/src/include/duckdb/optimizer/regex_range_filter.hpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // DuckDB 3 | // 4 | // duckdb/optimizer/regex_range_filter.hpp 5 | // 6 | // 7 | //===----------------------------------------------------------------------===// 8 | 9 | #pragma once 10 | 11 | #include "duckdb/optimizer/rule.hpp" 12 | 13 | namespace duckdb { 14 | 15 | class Optimizer; 16 | 17 | class RegexRangeFilter { 18 | public: 19 | RegexRangeFilter() { 20 | } 21 | //! Perform filter pushdown 22 | unique_ptr Rewrite(unique_ptr op); 23 | }; 24 | 25 | } // namespace duckdb 26 | -------------------------------------------------------------------------------- /src/duckdb/src/include/duckdb/common/enums/filter_propagate_result.hpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // DuckDB 3 | // 4 | // duckdb/common/enums/filter_propagate_result.hpp 5 | // 6 | // 7 | //===----------------------------------------------------------------------===// 8 | 9 | #pragma once 10 | 11 | #include "duckdb/common/constants.hpp" 12 | 13 | namespace duckdb { 14 | 15 | enum class FilterPropagateResult : uint8_t { 16 | NO_PRUNING_POSSIBLE = 0, 17 | FILTER_ALWAYS_TRUE = 1, 18 | FILTER_ALWAYS_FALSE = 2, 19 | FILTER_TRUE_OR_NULL = 3, 20 | FILTER_FALSE_OR_NULL = 4 21 | }; 22 | 23 | } // namespace duckdb 24 | -------------------------------------------------------------------------------- /src/duckdb/src/include/duckdb/parser/parser_options.hpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // DuckDB 3 | // 4 | // duckdb/parser/parser_options.hpp 5 | // 6 | // 7 | //===----------------------------------------------------------------------===// 8 | 9 | #pragma once 10 | 11 | #include "duckdb/common/common.hpp" 12 | 13 | namespace duckdb { 14 | class ParserExtension; 15 | 16 | struct ParserOptions { 17 | bool preserve_identifier_case = true; 18 | bool integer_division = false; 19 | idx_t max_expression_depth = 1000; 20 | const vector *extensions = nullptr; 21 | }; 22 | 23 | } // namespace duckdb 24 | -------------------------------------------------------------------------------- /src/duckdb/ub_src_common_types_row.cpp: -------------------------------------------------------------------------------- 1 | #include "src/common/types/row/partitioned_tuple_data.cpp" 2 | 3 | #include "src/common/types/row/row_data_collection.cpp" 4 | 5 | #include "src/common/types/row/row_data_collection_scanner.cpp" 6 | 7 | #include "src/common/types/row/row_layout.cpp" 8 | 9 | #include "src/common/types/row/tuple_data_allocator.cpp" 10 | 11 | #include "src/common/types/row/tuple_data_collection.cpp" 12 | 13 | #include "src/common/types/row/tuple_data_iterator.cpp" 14 | 15 | #include "src/common/types/row/tuple_data_layout.cpp" 16 | 17 | #include "src/common/types/row/tuple_data_scatter_gather.cpp" 18 | 19 | #include "src/common/types/row/tuple_data_segment.cpp" 20 | 21 | -------------------------------------------------------------------------------- /src/duckdb/ub_src_execution.cpp: -------------------------------------------------------------------------------- 1 | #include "src/execution/adaptive_filter.cpp" 2 | 3 | #include "src/execution/aggregate_hashtable.cpp" 4 | 5 | #include "src/execution/base_aggregate_hashtable.cpp" 6 | 7 | #include "src/execution/column_binding_resolver.cpp" 8 | 9 | #include "src/execution/expression_executor.cpp" 10 | 11 | #include "src/execution/expression_executor_state.cpp" 12 | 13 | #include "src/execution/join_hashtable.cpp" 14 | 15 | #include "src/execution/perfect_aggregate_hashtable.cpp" 16 | 17 | #include "src/execution/physical_operator.cpp" 18 | 19 | #include "src/execution/physical_plan_generator.cpp" 20 | 21 | #include "src/execution/radix_partitioned_hashtable.cpp" 22 | 23 | -------------------------------------------------------------------------------- /src/duckdb/src/include/duckdb/common/cgroups.hpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // DuckDB 3 | // 4 | // duckdb/common/cgroups.hpp 5 | // 6 | // 7 | //===----------------------------------------------------------------------===// 8 | 9 | #pragma once 10 | 11 | #include "duckdb/common/common.hpp" 12 | #include "duckdb/common/optional_idx.hpp" 13 | #include "duckdb/common/file_system.hpp" 14 | 15 | namespace duckdb { 16 | 17 | class CGroups { 18 | public: 19 | static optional_idx GetMemoryLimit(FileSystem &fs); 20 | static idx_t GetCPULimit(FileSystem &fs, idx_t physical_cores); 21 | }; 22 | 23 | } // namespace duckdb 24 | -------------------------------------------------------------------------------- /src/duckdb/src/include/duckdb/common/enums/stream_execution_result.hpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // DuckDB 3 | // 4 | // duckdb/common/enums/stream_execution_result.hpp 5 | // 6 | // 7 | //===----------------------------------------------------------------------===// 8 | 9 | #pragma once 10 | 11 | #include "duckdb/common/constants.hpp" 12 | 13 | namespace duckdb { 14 | 15 | enum class StreamExecutionResult : uint8_t { 16 | CHUNK_READY, 17 | CHUNK_NOT_READY, 18 | EXECUTION_ERROR, 19 | EXECUTION_CANCELLED, 20 | BLOCKED, 21 | NO_TASKS_AVAILABLE, 22 | EXECUTION_FINISHED 23 | }; 24 | 25 | } // namespace duckdb 26 | -------------------------------------------------------------------------------- /src/duckdb/src/parser/statement/extension_statement.cpp: -------------------------------------------------------------------------------- 1 | #include "duckdb/parser/statement/extension_statement.hpp" 2 | 3 | namespace duckdb { 4 | 5 | ExtensionStatement::ExtensionStatement(ParserExtension extension_p, unique_ptr parse_data_p) 6 | : SQLStatement(StatementType::EXTENSION_STATEMENT), extension(std::move(extension_p)), 7 | parse_data(std::move(parse_data_p)) { 8 | } 9 | 10 | unique_ptr ExtensionStatement::Copy() const { 11 | return make_uniq(extension, parse_data->Copy()); 12 | } 13 | 14 | string ExtensionStatement::ToString() const { 15 | return parse_data->ToString(); 16 | } 17 | 18 | } // namespace duckdb 19 | -------------------------------------------------------------------------------- /src/duckdb/src/parser/statement/vacuum_statement.cpp: -------------------------------------------------------------------------------- 1 | #include "duckdb/parser/statement/vacuum_statement.hpp" 2 | 3 | namespace duckdb { 4 | 5 | VacuumStatement::VacuumStatement(const VacuumOptions &options) 6 | : SQLStatement(StatementType::VACUUM_STATEMENT), info(make_uniq(options)) { 7 | } 8 | 9 | VacuumStatement::VacuumStatement(const VacuumStatement &other) : SQLStatement(other), info(other.info->Copy()) { 10 | } 11 | 12 | unique_ptr VacuumStatement::Copy() const { 13 | return unique_ptr(new VacuumStatement(*this)); 14 | } 15 | 16 | string VacuumStatement::ToString() const { 17 | return info->ToString(); 18 | } 19 | 20 | } // namespace duckdb 21 | -------------------------------------------------------------------------------- /src/duckdb/src/parser/transform/statement/transform_detach.cpp: -------------------------------------------------------------------------------- 1 | #include "duckdb/parser/transformer.hpp" 2 | #include "duckdb/parser/statement/detach_statement.hpp" 3 | #include "duckdb/parser/expression/constant_expression.hpp" 4 | #include "duckdb/common/string_util.hpp" 5 | 6 | namespace duckdb { 7 | 8 | unique_ptr Transformer::TransformDetach(duckdb_libpgquery::PGDetachStmt &stmt) { 9 | auto result = make_uniq(); 10 | auto info = make_uniq(); 11 | info->name = stmt.db_name; 12 | info->if_not_found = TransformOnEntryNotFound(stmt.missing_ok); 13 | 14 | result->info = std::move(info); 15 | return result; 16 | } 17 | 18 | } // namespace duckdb 19 | -------------------------------------------------------------------------------- /src/duckdb/third_party/brotli/common/platform.cpp: -------------------------------------------------------------------------------- 1 | /* Copyright 2016 Google Inc. All Rights Reserved. 2 | 3 | Distributed under MIT license. 4 | See file LICENSE for detail or copy at https://opensource.org/licenses/MIT 5 | */ 6 | 7 | #include 8 | 9 | #include 10 | 11 | #include "brotli_platform.h" 12 | 13 | 14 | /* Default brotli_alloc_func */ 15 | void* duckdb_brotli::BrotliDefaultAllocFunc(void* opaque, size_t size) { 16 | BROTLI_UNUSED(opaque); 17 | return malloc(size); 18 | } 19 | 20 | /* Default brotli_free_func */ 21 | void duckdb_brotli::BrotliDefaultFreeFunc(void* opaque, void* address) { 22 | BROTLI_UNUSED(opaque); 23 | free(address); 24 | } 25 | -------------------------------------------------------------------------------- /src/duckdb/src/include/duckdb/common/enum_class_hash.hpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // DuckDB 3 | // 4 | // duckdb/common/enum_class_hash.hpp 5 | // 6 | // 7 | //===----------------------------------------------------------------------===// 8 | 9 | #pragma once 10 | 11 | #include 12 | 13 | namespace duckdb { 14 | /* For compatibility with older C++ STL, an explicit hash class 15 | is required for enums with C++ sets and maps */ 16 | struct EnumClassHash { 17 | template 18 | std::size_t operator()(T t) const { 19 | return static_cast(t); 20 | } 21 | }; 22 | } // namespace duckdb 23 | -------------------------------------------------------------------------------- /src/duckdb/src/include/duckdb/storage/table/delete_state.hpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // DuckDB 3 | // 4 | // duckdb/storage/table/delete_state.hpp 5 | // 6 | // 7 | //===----------------------------------------------------------------------===// 8 | 9 | #pragma once 10 | 11 | #include "duckdb/storage/table/append_state.hpp" 12 | 13 | namespace duckdb { 14 | class TableCatalogEntry; 15 | 16 | struct TableDeleteState { 17 | unique_ptr constraint_state; 18 | bool has_delete_constraints = false; 19 | DataChunk verify_chunk; 20 | vector col_ids; 21 | }; 22 | 23 | } // namespace duckdb 24 | -------------------------------------------------------------------------------- /src/duckdb/src/planner/binder/tableref/plan_column_data_ref.cpp: -------------------------------------------------------------------------------- 1 | #include "duckdb/planner/binder.hpp" 2 | #include "duckdb/planner/tableref/bound_column_data_ref.hpp" 3 | #include "duckdb/planner/operator/logical_column_data_get.hpp" 4 | 5 | namespace duckdb { 6 | 7 | unique_ptr Binder::CreatePlan(BoundColumnDataRef &ref) { 8 | auto types = ref.collection->Types(); 9 | // Create a (potentially owning) LogicalColumnDataGet 10 | auto root = make_uniq_base(ref.bind_index, std::move(types), 11 | std::move(ref.collection)); 12 | return root; 13 | } 14 | 15 | } // namespace duckdb 16 | -------------------------------------------------------------------------------- /src/duckdb/ub_src_optimizer_join_order.cpp: -------------------------------------------------------------------------------- 1 | #include "src/optimizer/join_order/query_graph.cpp" 2 | 3 | #include "src/optimizer/join_order/join_relation_set.cpp" 4 | 5 | #include "src/optimizer/join_order/join_node.cpp" 6 | 7 | #include "src/optimizer/join_order/join_order_optimizer.cpp" 8 | 9 | #include "src/optimizer/join_order/cardinality_estimator.cpp" 10 | 11 | #include "src/optimizer/join_order/cost_model.cpp" 12 | 13 | #include "src/optimizer/join_order/plan_enumerator.cpp" 14 | 15 | #include "src/optimizer/join_order/relation_manager.cpp" 16 | 17 | #include "src/optimizer/join_order/query_graph_manager.cpp" 18 | 19 | #include "src/optimizer/join_order/relation_statistics_helper.cpp" 20 | 21 | -------------------------------------------------------------------------------- /src/duckdb/src/include/duckdb/common/enums/debug_vector_verification.hpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // DuckDB 3 | // 4 | // duckdb/common/enums/debug_vector_verification.hpp 5 | // 6 | // 7 | //===----------------------------------------------------------------------===// 8 | 9 | #pragma once 10 | 11 | #include "duckdb/common/constants.hpp" 12 | 13 | namespace duckdb { 14 | 15 | enum class DebugVectorVerification : uint8_t { 16 | NONE, 17 | DICTIONARY_EXPRESSION, 18 | DICTIONARY_OPERATOR, 19 | CONSTANT_OPERATOR, 20 | SEQUENCE_OPERATOR, 21 | NESTED_SHUFFLE, 22 | VARIANT_VECTOR 23 | }; 24 | 25 | } // namespace duckdb 26 | -------------------------------------------------------------------------------- /src/duckdb/src/include/duckdb/common/enums/undo_flags.hpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // DuckDB 3 | // 4 | // duckdb/common/enums/undo_flags.hpp 5 | // 6 | // 7 | //===----------------------------------------------------------------------===// 8 | 9 | #pragma once 10 | 11 | #include "duckdb/common/constants.hpp" 12 | 13 | namespace duckdb { 14 | 15 | enum class UndoFlags : uint32_t { // far too big but aligned (TM) 16 | EMPTY_ENTRY = 0, 17 | CATALOG_ENTRY = 1, 18 | INSERT_TUPLE = 2, 19 | DELETE_TUPLE = 3, 20 | UPDATE_TUPLE = 4, 21 | SEQUENCE_VALUE = 5, 22 | ATTACHED_DATABASE = 6 23 | }; 24 | 25 | } // namespace duckdb 26 | -------------------------------------------------------------------------------- /src/duckdb/src/include/duckdb/storage/compression/bitpacking.hpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // DuckDB 3 | // 4 | // duckdb/storage/compression/bitpacking.hpp 5 | // 6 | // 7 | //===----------------------------------------------------------------------===// 8 | 9 | #pragma once 10 | 11 | #include "duckdb/common/string_util.hpp" 12 | 13 | namespace duckdb { 14 | 15 | enum class BitpackingMode : uint8_t { INVALID, AUTO, CONSTANT, CONSTANT_DELTA, DELTA_FOR, FOR }; 16 | 17 | BitpackingMode BitpackingModeFromString(const string &str); 18 | string BitpackingModeToString(const BitpackingMode &mode); 19 | 20 | } // namespace duckdb 21 | --------------------------------------------------------------------------------