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

标签 mysql apache-drill

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

这是我的 MySQL 插件配置:

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

最佳答案

Drill 无法在 MySql 中创建表。

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.

您能够创建的临时表是在文件系统而不是 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/

关于mysql - 使用 apache drill 在 mysql 数据库中创建表,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49504411/

相关文章:

apache-drill - Apache 元模型与 Apache Drill

json - 使用 Apache Drill 查询压缩的 gz 文件

mysql - 事务中回滚后剩余的查询正在运行事件

mysql - 使用先前插入的值进行双重插入

c# - 如何使用c#在apache drill中显示来自sql server的数据

apache-drill - Apache Drill 与 Kerberos

用于 Apache Drill 的 Java 或 C++ API

PHP Zebra Forms 框架从 MySQL 中获取选择框的值

php - 无法在 MySQL 中插入度数符号

php - 使用 JSON 解析 MySQL 数据