You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@metamodel.apache.org by "Kasper Sørensen (JIRA)" <ji...@apache.org> on 2018/09/01 18:32:00 UTC

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

     [ https://issues.apache.org/jira/browse/METAMODEL-1194?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Kasper Sørensen resolved METAMODEL-1194.
----------------------------------------
       Resolution: Fixed
    Fix Version/s: 5.1.1

> 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
>            Priority: Minor
>             Fix For: 5.1.1
>
>
> 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)