0

我正在通过以下方式查询我的s3存储桶:apache drill

0: jdbc:drill:zk=local> use s3;
+-------+---------------------------------+
|  ok   |             summary             |
+-------+---------------------------------+
| true  | Default schema changed to [s3]  |
+-------+---------------------------------+
1 row selected (1.182 seconds)
0: jdbc:drill:zk=local> show tables;
+--+
|  |
+--+
+--+
No rows selected (1.438 seconds)
0: jdbc:drill:zk=local> 

常规也会发生同样的情况select

0: jdbc:drill:zk=local> select * from s3.`directory/file.csv` limit 10;
oct 28, 2015 11:13:51 AM org.apache.calcite.sql.validate.SqlValidatorException <init>
GRAVE: org.apache.calcite.sql.validate.SqlValidatorException: Table '/denue/DENUE_INEGI_01_.csv' not found
oct 28, 2015 11:13:51 AM org.apache.calcite.runtime.CalciteException <init>
GRAVE: org.apache.calcite.runtime.CalciteContextException: From line 1, column 15 to line 1, column 42: Table '/denue/DENUE_INEGI_01_.csv' not found
Error: PARSE ERROR: From line 1, column 15 to line 1, column 42: Table '/denue/DENUE_INEGI_01_.csv' not found


[Error Id: 560c6ec3-e4b0-4fe3-8b32-fd3fa56e1dd1 on heliodromus:31010] (state=,code=0)

select * from如果我使用directory/file.csv 也会发生同样的事情;

我做错了什么?

我的存储插件文件如下:

{
  "type": "file",
  "enabled": true,
  "connection": "s3n://accessKeyId:secretAccesKey@red-queen/",
  "workspaces": {},
  "formats": {
    "psv": {
      "type": "text",
      "extensions": [
        "tbl"
      ],
      "delimiter": "|"
    },
    "csv": {
      "type": "text",
      "extensions": [
        "csv"
      ],
      "delimiter": ","
    },
    "tsv": {
      "type": "text",
      "extensions": [
        "tsv"
      ],
      "delimiter": "\t"
    },
    "parquet": {
      "type": "parquet"
    },
    "json": {
      "type": "json"
    },
    "avro": {
      "type": "avro"
    }
  }
}

哪里明显accessKeyIdsecretAccessKey被改变了......

red-queen是我s3 bucket的,桶里面是directory一个文件夹。

4

1 回答 1

0

请尝试使用反引号和您的目录名称:

USE `s3`.`directory`; 
SHOW files; //should list file
SELECT * FROM `filename.extension`;

看看这个Drill 拉取请求博客

于 2015-10-30T13:39:50.150 回答