我尝试使用 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/