Archives of Support Questions (Read Only)

This is an archived board for historical reference. Information and links may no longer be available or relevant
Announcements
This board is archived and read-only for historical reference. To ask a new question, please post a new topic on the appropriate active board.

JDBC4 Hive Driver error: Only AEQuery is supported.

avatar
Explorer

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.

1 ACCEPTED SOLUTION

avatar
Explorer

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 solution in original post

1 REPLY 1

avatar
Explorer

The statement should be insert into **TABLE** toTable select * from fromTable, instead of insert into toTable select * from table. Hope this helps somebody else.