Hi Sankar, You need to create an external table in order to specify the location of data (i.e. using CREATE EXTERNAL TABLE user1 .... LOCATION). You can take a look at this page <https://cwiki.apache.org/confluence/display/Hive/LanguageManual+DDL#LanguageManualDDL-Create/Drop/TruncateTable> for reference.
Thanks, Yin On Thu, Aug 21, 2014 at 11:12 PM, S Malligarjunan < smalligarju...@yahoo.com.invalid> wrote: > Hello All, > > When i execute the following query > > > val hiveContext = new org.apache.spark.sql.hive.HiveContext(sc) > > CREATE TABLE user1 (time string, id string, u_id string, c_ip string, > user_agent string) ROW FORMAT DELIMITED FIELDS TERMINATED BY '\t' LINES > TERMINATED BY '\n' STORED AS TEXTFILE LOCATION 's3n:// > hadoop.anonymous.com/output/qa/cnv_px_ip_gnc/ds=2014-06-14/') > > I am getting the following error > org.apache.spark.sql.hive.HiveQl$ParseException: Failed to parse: CREATE > TABLE user1 (time string, id string, u_id string, c_ip string, user_agent > string) ROW FORMAT DELIMITED FIELDS TERMINATED BY ' ' LINES TERMINATED BY > ' > ' STORED AS TEXTFILE LOCATION 's3n:// > hadoop.anonymous.com/output/qa/cnv_px_ip_gnc/ds=2014-06-14/') > at org.apache.spark.sql.hive.HiveQl$.parseSql(HiveQl.scala:215) > at org.apache.spark.sql.hive.HiveContext.hiveql(HiveContext.scala:98) > at org.apache.spark.sql.hive.HiveContext.hql(HiveContext.scala:102) > at $iwC$$iwC$$iwC$$iwC$$iwC.<init>(<console>:22) > at $iwC$$iwC$$iwC$$iwC.<init>(<console>:27) > at $iwC$$iwC$$iwC.<init>(<console>:29) > at $iwC$$iwC.<init>(<console>:31) > at $iwC.<init>(<console>:33) > at <init>(<console>:35) > > Kindly let me know what could be the issue here. > > I have cloned spark from github. Using Hadoop 1.0.3 > > Thanks and Regards, > Sankar S. > >