使用 apache drill 在 mysql 数据库中创建 table

Create table in mysql db using apache drill

我尝试使用 apache drill 在 mysql 数据库中创建一个 table。它抛出了一个错误:模式是 immutable。我想出的一个解决方法是使用 CTAS 语句创建一个临时的 table。但是我想使用 drill 在 mysql 中创建一个永久的 table。请帮忙。

这是我的 MySQL 插件配置:

{
  "type": "jdbc",
  "driver": "com.mysql.jdbc.Driver",
  "url": "jdbc:mysql://hostname:3306",
  "username": "root",
  "password": "",
  "enabled": true
}

如果您尚未安装 Drill,请安装它。

将数据库的 JDBC 驱动程序复制到 jars/3rdparty 目录中。 (您需要在每个节点上执行此操作。)

重新启动 Drill。请参阅以分布式模式启动演练。

通过 Web 控制台向钻取添加新的存储配置。下面提供了 Oracle、SQL 服务器、MySQL 和 Postgres 的示例配置。

https://drill.apache.org/docs/create-table-as-ctas/

Drill 无法在 MySql 中创建 tables。

Restrictions You can only create new tables in workspaces. You cannot create tables using storage plugins, such as Hive and HBase, that do not specify a workspace.

You must use a writable (mutable) workspace when creating Drill tables.

您能够创建的临时 table 是在文件系统而不是 MySql 中创建的。

By default, Drill creates temporary tables within the default temporary workspace, dfs.tmp. The default temporary workspace must be writable, file-based, and point to a location that already exists, otherwise temporary table creation fails. You cannot create a temporary table outside of the default temporary workspace.

[1] https://drill.apache.org/docs/create-table-as-ctas/

[2] https://drill.apache.org/docs/create-temporary-table-as-cttas/