hive-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sateesh Karuturi <sateesh.karutu...@gmail.com>
Subject getting mismatched input 'ROW' expecting <EOF> error in hive creation
Date Tue, 04 Aug 2015 15:22:09 GMT
i want create a hive table using java code. my code is
package com.inndata.services;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Connection;
import java.sql.Statement;
import java.sql.DriverManager;
public class HiveCreateTable {
  private static String driverName =
"com.facebook.presto.jdbc.PrestoDriver";

  public static void main(String[] args) throws SQLException {

     // Register driver and create driver instance
     try {
        Class.forName(driverName);
    } catch (ClassNotFoundException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }
     System.out.println("haiiiiii");
     Connection con = DriverManager.getConnection("jdbc:
presto://192.168.1.118:8023", "hadoop", "cassandra");
     con.setCatalog("hive");
     con.setSchema("log");
     Statement stmt = con.createStatement();
     ResultSet res = stmt.executeQuery("create table access_log (c_ip
varchar,"
                                                                 +
"cs_username varchar,"
                                                                 +
"cs_computername varchar,"
                                                                 + "cs_date
varchar,"
                                                                 + "cs_code
varchar,"
                                                                 +
"cs_method varchar,"
                                                                 +
"cs_uri_stem varchar,"
                                                                 +
"cs_uri_query varchar,"
                                                                 +
"cs_status_code varchar,"
                                                                 +
"cs_bytes varchar)"
                                                                 + "ROW
 FORMAT DELIMITED FIELDS TERMINATED BY '\b' LINES TERMINATED BY '\n'");
     System.out.println("Table access_log created.");
     con.close();
  }
}
and getting
Exception in thread "main" java.sql.SQLException: Query failed
(#20150804_152058_00004_r8ehs): line 1:214: mismatched input 'ROW'
expecting <EOF>

Mime
View raw message