使用Apache Drill查询到S3存储桶时出现NullPointerException

时间:2015-10-28 01:15:38

标签: amazon-s3 apache-drill

我通过以下方式使用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目录/ 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作为文件夹。

1 个答案:

答案 0 :(得分:0)

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

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

请查看此Drill pull requestblog