You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Apache Drill无法连接PostgreSQL,求助排查配置问题

Apache Drill连接PostgreSQL配置问题

配置与启动操作

我尝试通过以下配置让Apache Drill连接PostgreSQL数据库:

storage-plugins-override.conf 配置内容:

"postgresql": {
      "type": "jdbc",
      "driver": "org.postgresql.Driver",
      "url": "${POSTGRES_URL}",
      "username": "${POSTGRES_USER}",
      "password": "${POSTGRES_PASSWORD}",
      "enabled": true,
      "sourceParameters": {
        "minimumIdle": 0,
        "autoCommit": true,
        "connectionTestQuery": "select version() as postgresql_version",
        "dataSource.cachePrepStmts": true,
        "dataSource.prepStmtCacheSize": 250
      }

执行Docker命令启动Apache Drill:

docker run -it --name drill -p 8048:8047 -p 31011:31010 \
  -e GCS_KEY_FILE -e DATA_PATH -e POSTGRES_URL -e POSTGRES_USER -e POSTGRES_PASSWORD \
  -v /home/indio/drill/bq:/tmp/data \
  -v /home/indio/drill/drill-override.conf:/opt/drill/conf/drill-override.conf \
  -v /home/indio/drill/storage-plugins-override.conf:/opt/drill/conf/storage-plugins-override.conf \
  -v /home/indio/drill/postgres-sample-data:/opt/drill/sample-data/postgres \
  -v /home/indio/drill/postgresql-42.6.0.jar:/opt/drill/jars/3rdparty/postgresql-42.6.0.jar \
  apache/drill \
  /opt/drill/bin/sqlline -u "jdbc:drill:zk=local" -n admin -p admin

其中postgresql-42.6.0.jar是按照Apache Drill官方文档说明下载的。

遇到的问题

  1. 执行SHOW SCHEMAS命令未显示postgresql相关模式,执行use pgdb时提示Schema无效:
apache drill> SHOW SCHEMAS;
+--------------------+
|    SCHEMA_NAME     |
+--------------------+
| dfs.default        |
| dfs.root           |
| dfs.tmp            |
| information_schema |
| sys                |
| cp.default         |
+--------------------+
6 rows selected (0.104 seconds)

apache drill> use pgdb;
Error: VALIDATION ERROR: Schema [pgdb] is not valid with respect to either root schema or current default schema.

Current default schema: No default schema selected

[Error Id: 3fffb76d-92f8-4c17-97e7-1d5f022a9ee1 ] (state=,code=0)
apache drill> 
  1. 在WebUI的存储标签页“Enabled Storage Plugins”中未看到rdbms插件。

请问我哪里配置出错了?


内容的提问来源于stack exchange,提问作者Índio

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.06 10:10:32