Member since
09-07-2015
5
Posts
0
Kudos Received
1
Solution
My Accepted Solutions
Title | Views | Posted |
---|---|---|
1674 | 01-10-2017 10:36 AM |
01-10-2017
10:36 AM
The statement should be insert into **TABLE** toTable select * from fromTable, instead of insert into toTable select * from table. Hope this helps somebody else.
... View more
01-09-2017
11:34 AM
Hi, I'm trying to execute a simple hiveql statement like the following: insert into table1 select * from table2. Both tables have the same schema but different store options, that is, table1 is stored as avro and table2 as parquet. I copied jdbc4 driver to project's location and I can obtain a connection to hiveserver2 without any issues. However, when I try to execute the above query, the following exception occurrs. Only AEQuery is supported.
java.sql.SQLException: Only AEQuery is supported.
at com.cloudera.hive.hive.querytranslation.HiveQueryTranslator.translate(HiveQueryTranslator.java:86)
at com.cloudera.hive.hive.querytranslation.HiveQueryTranslator.translate(HiveQueryTranslator.java:74)
at com.cloudera.hive.hivecommon.dataengine.HiveJDBCDSIExtQueryExecutor.execute(HiveJDBCDSIExtQueryExecutor.java:168)
at com.cloudera.hive.jdbc.common.SStatement.executeNoParams(SStatement.java:2719)
at com.cloudera.hive.jdbc.common.SStatement.execute(SStatement.java:549)
at py.com.personal.hive.HiveDataLoad.insert(HiveDataLoad.java:46)
at InsertTest.testHiveInsert(InsertTest.java:23)
Caused by: com.cloudera.hive.support.exceptions.ErrorException: Only AEQuery is supported. Can somebody please tell me what I'm doing wrong or how this can be solved? This is my code: if (this.conn == null) {
this.conn = this.cm.connect();
}
Statement stmt = this.conn.createStatement();
String sql = "INSERT INTO " + toTable + " SELECT * FROM " + fromTable;
stmt.execute(sql);
stmt.close(); Thanks.
... View more
Labels:
- Labels:
-
Apache Hive