Hi I am trying to create a hive table with some constraints using jdbc,which is giving me an error String sql1="CREATE TABLE sample_hive_table_2 (key1 int PRIMARY KEY ,value1 string)"; System.out.println(sql1); res = stmt.executeQuery(sql1); Exception in thread "main" java.sql.SQLException: Query returned non-zero code: 40000, cause: FAILED: ParseException line 1:43 mismatched input 'PRIMARY' expecting ) near 'int' in create table statement
at org.apache.hadoop.hive.jdbc.HiveStatement.executeQuery(HiveStatement.java:194)
I need to do two things 1) create a table with constraints 2)find the constraints on columns of a table using jdbc program. Thanks Hitz