The MariaDB connector allows querying and creating tables in external MariaDB databases. This can be used to join data between different systems such as MySQL and MariaDB or between two different MariaDB instances.

Configuration

To configure the MariaDB connector, create a catalog properties file in etc/catalog in the openLooKeng installation directory, for example maria.properties, and mount the MariaDB connector as the maria directory. Create the file using the following and replace the connection properties according to the settings.

connector.name=maria
connection-url=jdbc:mariadb://Deployed MairaDB ip:MariaDB service port (default 3306)
connection-user=Your data source user
connection-password=Your data source password
  • Whether to enable the query push-down feature

If you want to enable the connector push-down feature of MariaDB connector, you don’t need to do anything, the MariaDB connector push-down feature is turned on by default. However, it can also be set as follows.

#true means push down is turned on, false means off.
jdbc.pushdown-enabled=true
  • Push down mode selection

The default push-down mode of MariaDB connector is partial push-down, if you want to enable the full push-down function of MariaDB connector, you can set it as follows.

#FULL_PUSHDOWN, means all push down; BASE_PUSHDOWN, means partial push down, where partial push down means filter/aggregation/limit/topN/project which can be pushed down.
jdbc.pushdown-module=FULL_PUSHDOWN

External function registration

The MariaDB connector supports registration of external functions.

Configure the external function registration namespace catalog.schema that supports push-down. For example, in etc/catalog/maria.properties configure.

jdbc.pushdown.remotenamespace=mariafun.default

External function push-down

Push down external functions to MariaDB data sources for execution.

Configure the external function registration namespace catalog.schema that supports push-down. For example, in etc/catalog/maria.properties configure.

jdbc.pushdown.remotenamespace=mariafun.default

You can declare that you support functions in multiple function namespaces, just use ‘|’ split in the jdbc.pushdown.remotenamespace configuration item. For example

# indicates that the current Connector instance supports both mysqlfun1.default, mysqlfun2.default, and mysqlfun3.default function namespaces final function push down to the currently connected data source for execution.
jdbc.pushdown.remotenamespace=mariafun1.default|mariafun2.default|mariafun3.default

Multiple MariaDB servers

As many catalogs as needed can be created, so if there are additional MariaDB servers, just add another properties file with a different name to etc/catalog (make sure it ends with .properties). For example, if the properties file is named sales.properties, openLooKeng will create a catalog named sales using the configured connector.

Querying MariaDB

The MariaDB Connector provides a schema for each MariaDB database. Available MariaDB databases can be viewed by executing SHOW SCHEMAS

-- The catalog name for this case is called maria
SHOW SCHEMAS FROM maria;

If you have a MariaDB database named test, you can view the tables in the database by executing SHOW TABLES

SHOW TABLES FROM maria.test;

You can view a list of columns in the user table in the test database using one of the following methods

DESCRIBE maria.test.user;
SHOW COLUMNS FROM maria.test.user;

Finally, you can access the user table in the test database

SELECT * FROM maria.test.user;

If you use a different name for the directory properties file, use that directory name instead of maria in the above example.

MariaDB Connector Restrictions

The following SQL statements are not supported at this time

DELETEGRANTREVOKESHOW GRANTSSHOW ROLESSHOW ROLE GRANTS

有奖捉虫

“有虫”文档片段

0/500

存在的问题

文档存在风险与错误

● 拼写,格式,无效链接等错误;

● 技术原理、功能、规格等描述和软件不一致,存在错误;

● 原理图、架构图等存在错误;

● 版本号不匹配:文档版本或内容描述和实际软件不一致;

● 对重要数据或系统存在风险的操作,缺少安全提示;

● 排版不美观,影响阅读;

内容描述不清晰

● 描述存在歧义;

● 图形、表格、文字等晦涩难懂;

● 逻辑不清晰,该分类、分项、分步骤的没有给出;

内容获取有困难

● 很难通过搜索引擎,openLooKeng官网,相关博客找到所需内容;

示例代码有错误

● 命令、命令参数等错误;

● 命令无法执行或无法完成对应功能;

内容有缺失

● 关键步骤错误或缺失,无法指导用户完成任务,比如安装、配置、部署等;

● 逻辑不清晰,该分类、分项、分步骤的没有给出

● 图形、表格、文字等晦涩难懂

● 缺少必要的前提条件、注意事项等;

● 描述存在歧义

0/500

您对文档的总体满意度

非常不满意
非常满意

请问是什么原因让您参与到这个问题中

您的邮箱

创Issue赢奖品
根据您的反馈,会自动生成issue模板。您只需点击按钮,创建issue即可。
有奖捉虫