Anas,

Drill can be really handy to explore your data from the SQL interface.

Here is a few examples to use show files to navigate the DFS, notice the 
columns isDirectory and isFiles in the output.

0: jdbc:drill:> use dfs.root;
+-------+---------------------------------------+
|  ok   |                summary                |
+-------+---------------------------------------+
| true  | Default schema changed to [dfs.root]  |
+-------+---------------------------------------+
1 row selected (0.084 seconds)

0: jdbc:drill:> show files;
+------------+--------------+---------+---------+--------+--------+--------------+------------------------+--------------------------+
|    name    | isDirectory  | isFile  | length  | owner  | group  | permissions 
 |       accessTime       |     modificationTime     |
+------------+--------------+---------+---------+--------+--------+--------------+------------------------+--------------------------+
| parquet    | true         | false   | 1       | mapr   | mapr   | rwxrwxr-x   
 | 2015-07-08 23:48:24.0  | 2015-07-08 23:48:24.192  |
| products   | true         | false   | 1       | mapr   | mapr   | rwxrwxr-x   
 | 2015-07-08 23:48:15.0  | 2015-07-08 23:48:15.362  |
| orders     | true         | false   | 10      | mapr   | mapr   | rwxrwxr-x   
 | 2015-07-08 23:48:11.0  | 2015-07-08 23:48:14.455  |
| customers  | true         | false   | 1       | mapr   | mapr   | rwxrwxr-x   
 | 2015-07-08 23:48:10.0  | 2015-07-08 23:48:10.881  |
| flat       | true         | false   | 3       | mapr   | mapr   | rwxrwxr-x   
 | 2015-07-08 23:48:16.0  | 2015-07-08 23:48:27.136  |
| flatten    | true         | false   | 3       | mapr   | mapr   | rwxrwxr-x   
 | 2015-07-08 23:48:10.0  | 2015-07-16 20:28:31.406  |
| views      | true         | false   | 8       | mapr   | mapr   | rwxrwxr-x   
 | 2015-07-08 23:48:15.0  | 2015-07-08 23:48:24.91   |
| nested     | true         | false   | 3       | mapr   | mapr   | rwxrwxr-x   
 | 2015-07-08 23:48:17.0  | 2015-07-08 23:48:20.742  |
+------------+--------------+---------+---------+--------+--------+--------------+------------------------+--------------------------+
8 rows selected (0.165 seconds)

0: jdbc:drill:> show files in `nested`;
+----------+--------------+---------+---------+--------+--------+--------------+------------------------+--------------------------+
|   name   | isDirectory  | isFile  | length  | owner  | group  | permissions  
|       accessTime       |     modificationTime     |
+----------+--------------+---------+---------+--------+--------+--------------+------------------------+--------------------------+
| reviews  | true         | false   | 3       | mapr   | mapr   | rwxrwxr-x    
| 2015-07-08 23:48:20.0  | 2015-07-08 23:48:22.274  |
| clicks   | true         | false   | 2       | mapr   | mapr   | rwxrwxr-x    
| 2015-07-08 23:48:17.0  | 2015-07-08 23:48:18.351  |
| flatten  | true         | false   | 0       | mapr   | mapr   | rwxrwxr-x    
| 2015-07-08 23:48:20.0  | 2015-07-08 23:48:20.455  |
+----------+--------------+---------+---------+--------+--------+--------------+------------------------+--------------------------+
3 rows selected (0.085 seconds)


0: jdbc:drill:> show files in `nested/clicks`;
+-----------------------+--------------+---------+----------+--------+--------+--------------+------------------------+--------------------------+
|         name          | isDirectory  | isFile  |  length  | owner  | group  | 
permissions  |       accessTime       |     modificationTime     |
+-----------------------+--------------+---------+----------+--------+--------+--------------+------------------------+--------------------------+
| clicks.campaign.json  | false        | true    | 8065831  | mapr   | mapr   | 
rwxr-xr-x    | 2015-07-08 23:48:18.0  | 2015-07-08 23:48:20.255  |
| clicks.json           | false        | true    | 5219492  | mapr   | mapr   | 
rwxr-xr-x    | 2015-07-08 23:48:18.0  | 2015-07-08 23:48:20.786  |
+-----------------------+--------------+---------+----------+--------+--------+--------------+------------------------+--------------------------+
2 rows selected (0.121 seconds)


—Andries



> On Jul 28, 2015, at 6:50 AM, Neeraja Rentachintala 
> <[email protected]> wrote:
> 
> You can use 'show files' to get the list of files.
> 'Show schemas' will give you the list of workspace names (not the paths)
> 
> On Tue, Jul 28, 2015 at 6:42 AM, Anas Mesrah <[email protected]> wrote:
> 
>> Thanks Kristine,
>> 
>> Actually I want a query to list of file names not the file content. So, in
>> that case I get the *regions.parquet* and *nation.parquet*. Is that
>> possible? If not possible, Can I query the storage plugins metadata? For
>> example, the workspaces and their paths. I know I can get it from zookeeper
>> but I am trying to find pure jdbc (i.e. SQL) API.
>> 

Reply via email to