You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@metamodel.apache.org by "Gerard Dellemann (JIRA)" <ji...@apache.org> on 2018/08/28 08:27:00 UTC

[jira] [Created] (METAMODEL-1194) Stop supporting primary keys with Hive tables

Gerard Dellemann created METAMODEL-1194:
-------------------------------------------

             Summary: Stop supporting primary keys with Hive tables
                 Key: METAMODEL-1194
                 URL: https://issues.apache.org/jira/browse/METAMODEL-1194
             Project: Apache MetaModel
          Issue Type: Bug
            Reporter: Gerard Dellemann


Hive tables don't have primary (or foreign) keys. Hive tables get created using a JDBC driver. Other types of datastores, that also use JDBC, do support this key. Right now it's not prevented that a MetaModel user can try to create a Hive table containing a primary key. This will result in a Exception being thrown:
{code:java}
ERROR 14:58:33 JdbcUtils - Could not execute create table statement: CREATE TABLE default.mytable (ID INT, myfield STRING, PRIMARY KEY(ID)): Error while compiling statement: FAILED: ParseException line 1:69 cannot recognize input near ')' '<EOF>' '<EOF>' in enable specification, Error code=40000, SQL state=42000
org.apache.hive.service.cli.HiveSQLException: Error while compiling statement: FAILED: ParseException line 1:69 cannot recognize input near ')' '<EOF>' '<EOF>' in enable specification
	at org.apache.hive.jdbc.Utils.verifySuccess(Utils.java:256)
	at org.apache.hive.jdbc.Utils.verifySuccessWithInfo(Utils.java:242)
	at org.apache.hive.jdbc.HiveStatement.execute(HiveStatement.java:254)
	at org.apache.hive.jdbc.HiveStatement.executeUpdate(HiveStatement.java:406)
	at org.apache.metamodel.jdbc.JdbcCreateTableBuilder.execute(JdbcCreateTableBuilder.java:61)
{code}
Basically the exception means that it doesn't understand the primary key part of the statement.

 



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)