unable to create linked table on hive database/tables

27 views
Skip to first unread message

Joseph Varghese

unread,
Apr 12, 2020, 6:49:15 PM4/12/20
to H2 Database
Code: CREATE LINKED TABLE EMP_DATA3 ('org.apache.hive.jdbc.HiveDriver', 'jdbc:hive2://192.168.0.36:10000/default;user=hive;password=****' ,'hive', '****' , 'emp_data');

Hive driver: hive-jdbc-uber-2.6.5.0-292.jar


Error
Method not supported; SQL statement:
CREATE LINKED TABLE EMP_DATA3('org.apache.hive.jdbc.HiveDriver', 'jdbc:hive2://192.168.0.36:10000/default;user=hive;password=hive' ,'hive', 'hive' , 'emp_data') [0-200]
 null/0 (Help)
org.h2.jdbc.JdbcSQLException: Method not supported; SQL statement:
CREATE LINKED TABLE EMP_DATA3('org.apache.hive.jdbc.HiveDriver', 'jdbc:hive2://192.168.0.36:10000/default;user=hive;password=hive' ,'hive', 'hive' , 'emp_data') [0-200]
    at org.h2.message.DbException.getJdbcSQLException(DbException.java:629)
    at org.h2.message.DbException.addSQL(DbException.java:159)
    at org.h2.command.Command.executeUpdate(Command.java:263)
    at org.h2.jdbc.JdbcStatement.executeInternal(JdbcStatement.java:228)
    at org.h2.jdbc.JdbcStatement.execute(JdbcStatement.java:201)
    at org.h2.server.web.WebApp.getResult(WebApp.java:1459)
    at org.h2.server.web.WebApp.query(WebApp.java:1116)
    at org.h2.server.web.WebApp$1.next(WebApp.java:1078)
    at org.h2.server.web.WebApp$1.next(WebApp.java:1065)
    at org.h2.server.web.WebThread.process(WebThread.java:178)
    at org.h2.server.web.WebThread.run(WebThread.java:94)
    at java.lang.Thread.run(Unknown Source)
Caused by: java.sql.SQLException: Method not supported
    at org.apache.hive.jdbc.HiveDatabaseMetaData.storesLowerCaseIdentifiers(HiveDatabaseMetaData.java:822)
    at org.h2.table.TableLink.readMetaData(TableLink.java:119)
    at org.h2.table.TableLink.connect(TableLink.java:99)
    at org.h2.table.TableLink.<init>(TableLink.java:79)
    at org.h2.schema.Schema.createTableLink(Schema.java:736)
    at org.h2.command.ddl.CreateLinkedTable.update(CreateLinkedTable.java:77)
    at org.h2.command.CommandContainer.update(CommandContainer.java:198)
    at org.h2.command.Command.executeUpdate(Command.java:251)
    ... 9 more


checked in hive driver looks like storesLowerCaseIdentifiers are set set to throw exception is there a way around to link tables from hive?

pls help.

Evgenij Ryazanov

unread,
Apr 12, 2020, 10:30:04 PM4/12/20
to H2 Database
Hello.

H2 needs to know some information about the linked database to work with its tables. Each JDBC driver must implement these basic methods. You need to report your problem as an issue with Apache Hive it its bugtracker:
There is nothing to do with H2.

You can use an own build of Hive with your own implementation of them or own build of H2 with hard-coded properties of Hive as a temporary workaround.

Joseph Varghese

unread,
Apr 13, 2020, 5:09:29 PM4/13/20
to H2 Database
thx Evgenij for the direction I was able to build a custom driver and issue is resolved.
Reply all
Reply to author
Forward
0 new messages