我通过以下方式使用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"
}
}
}
显然accessKeyId
和secretAccessKey
已更改...
red-queen
是我的s3 bucket
,并且在广告文件框中directory
作为文件夹。
答案 0 :(得分:0)
请尝试使用反引号和您的目录名称:
USE `s3`.`directory`;
SHOW files; //should list file
SELECT * FROM `filename.extension`;
请查看此Drill pull request和blog。