AnsweredAssumed Answered

Is this the correct way to create external table?

Question asked by sun.frank on May 18, 2016
Latest reply on Jun 21, 2016 by onelson

on DA_440_On-Demand_Slide_Guide.PDF,  the page 52 of 94 show the syntax on how to create an external table (see below picture), it seems correct. but when I practice in MapR_Sandbox_For_Apache_Drill-1.6.0-5.1.0, it failed.

 

 

External table Q1 - 1.JPG

 

The scenario is we put temperature.csv file under folder /user/user01/DA440_LabFiles then run the create external table command, see below:

 

External table Q1 - 2.JPG

 

It failed. the error message is:

(message:maprfs:/user/user01/DA440_LabFiles/temperature.csv is not a directory or unable to create one)

 

It means we need to use 'location' in the comand to specify a directory or folder, not a data file such as temperature.csv.

 

if I delete the file temperature.csv from the directory /user/user01/DA440_LabFiles, that command will be successful. but you will find temperature.csv under /user/user01/DA440_LabFiles is also a directory.

 

The correct way to create an external table in this situation list below:

-- assume we want to put the external table in folder /user/user01/ExternalTables

External table Q1 - 3.JPG

 

I have not used the production of Apache Drill, is there anyone who have used the production can verify this?

 

Thanks!

Outcomes