Initial version of DuckDB engine for MariaDB based on DuckDB 1.3.2.#4903
Initial version of DuckDB engine for MariaDB based on DuckDB 1.3.2.#4903drrtuy wants to merge 1 commit intoMariaDB:11.4from
Conversation
af2d5a2 to
4715e2d
Compare
gkodinov
left a comment
There was a problem hiding this comment.
Please squash the two commits into a single one. And make sure the buildbot compiles and runs.
Otherwise, LGTM.
|
Ah, a jira is also needed. Do you have one? If you do please add it to the pull request's header as follows: MDEV-1231234: ..... |
|
@gkodinov This is our contribution outside Corporation so there is no MDEV. |
ab2c15b to
17959dd
Compare
vuvova
left a comment
There was a problem hiding this comment.
see some comments below.
also there's a question where a submodule should be, I have some concerns about it
| SET_TARGET_PROPERTIES(duckdb PROPERTIES | ||
| LIBRARY_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}") | ||
| INSTALL_MYSQL_TEST("${CMAKE_CURRENT_SOURCE_DIR}/duckdb/mysql-test/" | ||
| "plugin/duckdb") |
There was a problem hiding this comment.
did you check whether rpm packages are built, installed and work? columnstore is doing a lot more rpm-related stuff in its storage/columnstore/CMakeLists.txt, it's great that DuckDB doesn't need any of that, but does it, really?
| @@ -0,0 +1,339 @@ | |||
| GNU GENERAL PUBLIC LICENSE | |||
There was a problem hiding this comment.
Do you need a license here? it's just a CMakeLists.txt and covered by the project license already. submodule has a license file too, why to have a special one here just for CMakeLists.txt ?
DuckDB Storage Engine for MariaDB
Overview
This PR introduces DuckDB 1.3.2 as an embedded analytical (OLAP) storage engine plugin for MariaDB 12.3. The engine is ported from AliSQL's DuckDB integration and fully adapted to MariaDB's handler API, plugin system, build infrastructure, and packaging conventions. It ships as a loadable module (
ha_duckdb.so) for x86_64 and ARM64 architectures.Architecture
The engine is structured as a git submodule at storage/duckdb/duckdb (repo:
drrtuy/duckdb-engine), which itself contains a nested submodule (third_parties/duckdb) pointing to a DuckDB 1.3.2 fork with MariaDB-specific patches (e.g.octet_lengthVARCHAR overload). DuckDB is built statically with all builtin extensions (ICU, JSON, Parquet, jemalloc, etc.) and linked into a singleha_duckdb.soplugin. A debug-STL ABI mismatch guard (-U_GLIBCXX_DEBUG -U_GLIBCXX_ASSERTIONS) is applied in debug builds to preventSIGSEGVfromsizeof(std::vector)divergence between the plugin and the server.Supported Operations
CREATE TABLE,DROP TABLE,ALTER TABLE,RENAME TABLE— SQL is translated from MariaDB's internal structures to DuckDB-dialect DDL via ddl_convertor.cc, including expression defaults, column types, and engine conversions (ALTER TABLE ... ENGINE=DuckDB).select_handlerinterface (ha_duckdb_pushdown.cc), with result-set conversion back to MariaDB row format (duckdb_select.cc).DuckdbThdContextmanaged viathd_get_ha_data/thd_set_ha_data(replacing AliSQL'sTHD::get_duckdb_context()).Packaging
mariadb-plugin-duckdbforamd64andarm64.postinst/prermhooks automatically runinstall.sql/uninstall.sqlto register or unregister the plugin when the server is running.PLUGIN_DUCKDB=NOby default in native Debian builds (debian/rules); enabled automatically byautobake-deb.shfor MariaDB.org release builds when the submodule is present.Testing
An MTR test suite is included under
mysql-test/plugin/duckdb/covering DDL, DML, type conversions, ALTER operations, and basic query pushdown scenarios. Adisable.deffile documents tests that are not yet passing or are intentionally skipped.Key Differences from AliSQL Port
dd::Table,dd::Schema) dependency — table metadata comes fromTABLE*and.frm/TABLE_SHARE.mysql_declare_pluginwithmaria_declare_plugin.dd::Table*parameters).Relay_log_infoextensions (not applicable to MariaDB).DB_TYPE_AUTOASSIGNinstead of the AliSQL-specificDB_TYPE_DUCKDBenum.