0
votes

I am querying to my s3 bucket with apache drill in the following way:

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> 

The same occurs with a regular 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)

The same thing happens if I use select * fromdirectory/file.csv;

What I am doing wrong?

My Storage plugin file is the following:

{
  "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"
    }
  }
}

Where obviously accessKeyId and secretAccessKey are changed ...

red-queen is my s3 bucket, and inside the bucket is directory as a folder.

1
please try using backticks and your dir name: USE s3.directory; SHOW files; //should list file SELECT * FROM filename.extension; Sorry, backticks do not show up in this comment. See answercatpaws

1 Answers

0
votes

Please try using backticks and your directory name:

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

Take a look at this Drill pull request and blog.