-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Initial version of DuckDB engine for MariaDB based on DuckDB 1.5.2. #4903
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
drrtuy
wants to merge
5
commits into
MariaDB:11.4
Choose a base branch
from
drrtuy:bb-11.4-duckdb
base: 11.4
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+152
−15
Open
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
bc029be
Initial version of DuckDB engine for MariaDB based on DuckDB 1.5.2.
drrtuy 619da8d
Replace configure-time git submodule with configure-time cmake FetchC…
drrtuy f14ac02
Don not download DuckDB engine code if it exists.
drrtuy 87f547c
Expose static symbols leveraged in DuckDB to stringify WHERE conditio…
drrtuy 50e3207
autobake accesses control file only if duckdb directory exists.
drrtuy File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| # Fetched at configure time by FetchContent (see CMakeLists.txt). | ||
| duckdb/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,107 @@ | ||
| IF("NO" STREQUAL "${PLUGIN_DUCKDB}") | ||
| return() | ||
| ENDIF() | ||
|
drrtuy marked this conversation as resolved.
|
||
|
|
||
| IF(NOT CMAKE_SYSTEM_NAME STREQUAL "Linux") | ||
| return() | ||
| ENDIF() | ||
|
|
||
| IF(NOT (CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64" OR | ||
| CMAKE_SYSTEM_PROCESSOR STREQUAL "aarch64")) | ||
| return() | ||
| ENDIF() | ||
|
|
||
| # Check C++17 compiler support | ||
| MY_CHECK_CXX_COMPILER_FLAG("-std=c++17") | ||
| IF(NOT have_CXX__std_c__17) | ||
| MESSAGE(STATUS "DuckDB: C++ compiler does not support -std=c++17, skipping") | ||
| RETURN() | ||
| ENDIF() | ||
|
|
||
| # libduckdb_bundle.a is built without debug STL wrappers. | ||
| # Mismatched _GLIBCXX_DEBUG changes sizeof(std::vector) → SIGSEGV. | ||
| SET(CMAKE_CXX_FLAGS_DEBUG | ||
| "${CMAKE_CXX_FLAGS_DEBUG} -U_GLIBCXX_DEBUG -U_GLIBCXX_ASSERTIONS") | ||
|
|
||
| # Fetch the DuckDB engine plugin sources at configure time. | ||
| # Replaces the former git submodule at storage/duckdb/duckdb. | ||
| INCLUDE(FetchContent) | ||
| SET(DUCKDB_ENGINE_GIT_REPO "https://github.com/MariaDB/duckdb-engine" | ||
| CACHE STRING "DuckDB engine plugin git repository") | ||
| SET(DUCKDB_ENGINE_GIT_TAG "1639aebe79fdd471fc8848c3757a6b0427471534" | ||
| CACHE STRING "DuckDB engine plugin commit (full SHA)") | ||
|
|
||
| SET(DUCKDB_ENGINE_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/duckdb") | ||
|
|
||
| IF(EXISTS "${DUCKDB_ENGINE_SOURCE_DIR}/CMakeLists.txt") | ||
| # Source tree already present — use it as-is, no git operations. | ||
| MESSAGE(STATUS "DuckDB engine: using existing sources in ${DUCKDB_ENGINE_SOURCE_DIR}") | ||
| SET(FETCHCONTENT_SOURCE_DIR_DUCKDB_ENGINE "${DUCKDB_ENGINE_SOURCE_DIR}" | ||
| CACHE PATH "Pre-populated DuckDB engine source" FORCE) | ||
| ENDIF() | ||
|
|
||
| FetchContent_Declare(duckdb_engine | ||
| GIT_REPOSITORY "${DUCKDB_ENGINE_GIT_REPO}" | ||
| GIT_TAG "${DUCKDB_ENGINE_GIT_TAG}" | ||
| GIT_SHALLOW TRUE | ||
| SOURCE_DIR "${DUCKDB_ENGINE_SOURCE_DIR}" | ||
| ) | ||
| FetchContent_GetProperties(duckdb_engine) | ||
| IF(NOT duckdb_engine_POPULATED) | ||
| MESSAGE(STATUS "Fetching DuckDB engine plugin @ ${DUCKDB_ENGINE_GIT_TAG}") | ||
| FetchContent_Populate(duckdb_engine) | ||
| ENDIF() | ||
|
|
||
| IF(NOT EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/duckdb/CMakeLists.txt") | ||
| MESSAGE(WARNING "DuckDB engine sources missing after FetchContent; skipping") | ||
| RETURN() | ||
| ENDIF() | ||
|
|
||
| add_subdirectory(duckdb) | ||
|
|
||
| IF(TARGET duckdb) | ||
| # MTR discovers plugins at storage/<name>/, not storage/<name>/<submodule>/ | ||
| SET_TARGET_PROPERTIES(duckdb PROPERTIES | ||
| LIBRARY_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}") | ||
| INSTALL_MYSQL_TEST("${CMAKE_CURRENT_SOURCE_DIR}/duckdb/mysql-test/" | ||
| "plugin/duckdb") | ||
|
drrtuy marked this conversation as resolved.
|
||
|
|
||
| # MYSQL_ADD_PLUGIN runs in storage/duckdb/duckdb/ and bumps CPACK_* vars | ||
| # one level up (here). Re-bump them to the root scope so include(CPack) | ||
| # sees them. Without this, no MariaDB-duckdb-engine.spec is generated. | ||
| SET(CPACK_COMPONENTS_ALL ${CPACK_COMPONENTS_ALL} PARENT_SCOPE) | ||
| SET(CPACK_COMPONENT_DUCKDB-ENGINE_GROUP | ||
| ${CPACK_COMPONENT_DUCKDB-ENGINE_GROUP} PARENT_SCOPE) | ||
| SET(CPACK_COMPONENT_DUCKDB-ENGINESYMLINKS_GROUP | ||
| ${CPACK_COMPONENT_DUCKDB-ENGINESYMLINKS_GROUP} PARENT_SCOPE) | ||
| SET(CPACK_RPM_duckdb-engine_PACKAGE_REQUIRES | ||
| ${CPACK_RPM_duckdb-engine_PACKAGE_REQUIRES} PARENT_SCOPE) | ||
|
|
||
| IF(RPM) | ||
| SET(CPACK_RPM_duckdb-engine_PACKAGE_SUMMARY | ||
| "MariaDB DuckDB storage engine" PARENT_SCOPE) | ||
| SET(CPACK_RPM_duckdb-engine_PACKAGE_DESCRIPTION | ||
| "The MariaDB DuckDB storage engine embeds DuckDB, an in-process analytical database, as a MariaDB storage engine for fast OLAP queries over local data." PARENT_SCOPE) | ||
|
|
||
| # Mark common parent directories as %ignore so the duckdb-engine RPM | ||
| # does not claim ownership of dirs owned by MariaDB-server/-common. | ||
| # The "%define ignore \#" macro is already set by cmake/cpack_rpm.cmake. | ||
| SET(CPACK_RPM_duckdb-engine_USER_FILELIST | ||
| "%ignore /etc" | ||
| "%ignore /etc/my.cnf.d" | ||
| "%ignore /usr" | ||
| "%ignore /usr/lib64" | ||
| "%ignore /usr/lib64/mysql" | ||
| "%ignore /usr/lib64/mysql/plugin" | ||
| "%ignore /usr/share" | ||
| "%ignore /usr/share/mysql" | ||
| PARENT_SCOPE) | ||
|
|
||
| # Apply DuckDB-specific CPack overrides at packaging time. | ||
| # CPACK_PROJECT_CONFIG_FILE is included by CPack after CPackConfig.cmake, | ||
| # letting these settings override the main project's. | ||
| SET(CPACK_PROJECT_CONFIG_FILE | ||
| "${CMAKE_CURRENT_SOURCE_DIR}/duckdb/cmake/cpack_overrides.cmake" | ||
| CACHE FILEPATH "DuckDB CPack overrides" FORCE) | ||
| ENDIF() | ||
| ENDIF() | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.