Oracle as Hive metabase, build table error

Source: Internet
Author: User

Hive>
>
> CREATE table Test (a string, b int);
Failed:execution Error, return code 1 from Org.apache.hadoop.hive.ql.exec.DDLTask. Metaexception (Message:javax.jdo.JDODataStoreException:An exception is thrown while Adding/validating class (es): ORA-01754: A table can contain only one column of type LONG

java.sql.sqlsyntaxerrorexception:ora-01754: A table can contain only one column of type LONG

At Oracle.jdbc.driver.T4CTTIoer.processError (t4cttioer.java:439)
At Oracle.jdbc.driver.T4CTTIoer.processError (t4cttioer.java:395)
At Oracle.jdbc.driver.T4C8Oall.processError (t4c8oall.java:802)
At Oracle.jdbc.driver.T4CTTIfun.receive (t4cttifun.java:436)
At Oracle.jdbc.driver.T4CTTIfun.doRPC (t4cttifun.java:186)
At Oracle.jdbc.driver.T4C8Oall.doOALL (t4c8oall.java:521)
At Oracle.jdbc.driver.T4CStatement.doOall8 (t4cstatement.java:194)
At Oracle.jdbc.driver.T4CStatement.executeForRows (t4cstatement.java:1000)
At Oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout (oraclestatement.java:1307)
At Oracle.jdbc.driver.OracleStatement.executeInternal (oraclestatement.java:1882)
At Oracle.jdbc.driver.OracleStatement.execute (oraclestatement.java:1847)
At Oracle.jdbc.driver.OracleStatementWrapper.execute (oraclestatementwrapper.java:301)
At Com.jolbox.bonecp.StatementHandle.execute (statementhandle.java:254)
At Org.datanucleus.store.rdbms.table.AbstractTable.executeDdlStatement (abstracttable.java:760)
At Org.datanucleus.store.rdbms.table.AbstractTable.executeDdlStatementList (abstracttable.java:711)
At Org.datanucleus.store.rdbms.table.AbstractTable.create (abstracttable.java:425)
At Org.datanucleus.store.rdbms.table.AbstractTable.exists (abstracttable.java:488)
At Org.datanucleus.store.rdbms.rdbmsstoremanager$classadder.performtablesvalidation (RDBMSStoreManager.java:3380 )
At Org.datanucleus.store.rdbms.rdbmsstoremanager$classadder.addclasstablesandvalidate (RDBMSStoreManager.java : 3190)
At Org.datanucleus.store.rdbms.rdbmsstoremanager$classadder.run (rdbmsstoremanager.java:2841)
At Org.datanucleus.store.rdbms.AbstractSchemaTransaction.execute (abstractschematransaction.java:122)
At Org.datanucleus.store.rdbms.RDBMSStoreManager.addClasses (rdbmsstoremanager.java:1605)
At Org.datanucleus.store.AbstractStoreManager.addClass (abstractstoremanager.java:954)
At Org.datanucleus.store.rdbms.RDBMSStoreManager.getDatastoreClass (rdbmsstoremanager.java:679)
At Org.datanucleus.store.rdbms.RDBMSStoreManager.getPropertiesForGenerator (rdbmsstoremanager.java:2045)
At Org.datanucleus.store.AbstractStoreManager.getStrategyValue (abstractstoremanager.java:1365)
At Org.datanucleus.ExecutionContextImpl.newObjectId (executioncontextimpl.java:3827)
At Org.datanucleus.state.JDOStateManager.setIdentity (jdostatemanager.java:2571)
At Org.datanucleus.state.JDOStateManager.initialiseForPersistentNew (jdostatemanager.java:513)
At Org.datanucleus.state.ObjectProviderFactoryImpl.newForPersistentNew (objectproviderfactoryimpl.java:232)
At Org.datanucleus.ExecutionContextImpl.newObjectProviderForPersistentNew (executioncontextimpl.java:1414)
At Org.datanucleus.ExecutionContextImpl.persistObjectInternal (executioncontextimpl.java:2218)
At Org.datanucleus.ExecutionContextImpl.persistObjectWork (executioncontextimpl.java:2065)
At Org.datanucleus.ExecutionContextImpl.persistObject (executioncontextimpl.java:1913)
At Org.datanucleus.ExecutionContextThreadedImpl.persistObject (executioncontextthreadedimpl.java:217)
At Org.datanucleus.api.jdo.JDOPersistenceManager.jdoMakePersistent (jdopersistencemanager.java:727)
At Org.datanucleus.api.jdo.JDOPersistenceManager.makePersistent (jdopersistencemanager.java:752)
At Org.apache.hadoop.hive.metastore.ObjectStore.createTable (objectstore.java:719)
At Sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
At Sun.reflect.NativeMethodAccessorImpl.invoke (nativemethodaccessorimpl.java:57)
At Sun.reflect.DelegatingMethodAccessorImpl.invoke (delegatingmethodaccessorimpl.java:43)
At Java.lang.reflect.Method.invoke (method.java:606)
At Org.apache.hadoop.hive.metastore.RawStoreProxy.invoke (rawstoreproxy.java:108)
At Com.sun.proxy. $Proxy 7.createTable (Unknown Source)
At Org.apache.hadoop.hive.metastore.hivemetastore$hmshandler.create_table_core (HiveMetaStore.java:1261)
At Org.apache.hadoop.hive.metastore.hivemetastore$hmshandler.create_table_with_environment_context ( hivemetastore.java:1294)
At Sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
At Sun.reflect.NativeMethodAccessorImpl.invoke (nativemethodaccessorimpl.java:57)
At Sun.reflect.DelegatingMethodAccessorImpl.invoke (delegatingmethodaccessorimpl.java:43)
At Java.lang.reflect.Method.invoke (method.java:606)
At Org.apache.hadoop.hive.metastore.RetryingHMSHandler.invoke (retryinghmshandler.java:105)
At Com.sun.proxy. $Proxy 8.create_table_with_environment_context (Unknown Source)
At Org.apache.hadoop.hive.metastore.HiveMetaStoreClient.createTable (hivemetastoreclient.java:558)
At Org.apache.hadoop.hive.metastore.HiveMetaStoreClient.createTable (hivemetastoreclient.java:547)
At Sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
At Sun.reflect.NativeMethodAccessorImpl.invoke (nativemethodaccessorimpl.java:57)
At Sun.reflect.DelegatingMethodAccessorImpl.invoke (delegatingmethodaccessorimpl.java:43)
At Java.lang.reflect.Method.invoke (method.java:606)
At Org.apache.hadoop.hive.metastore.RetryingMetaStoreClient.invoke (retryingmetastoreclient.java:89)
At Com.sun.proxy. $Proxy 9.createTable (Unknown Source)
At Org.apache.hadoop.hive.ql.metadata.Hive.createTable (hive.java:613)
At Org.apache.hadoop.hive.ql.exec.DDLTask.createTable (ddltask.java:4189)
At Org.apache.hadoop.hive.ql.exec.DDLTask.execute (ddltask.java:281)
At Org.apache.hadoop.hive.ql.exec.Task.executeTask (task.java:153)
At Org.apache.hadoop.hive.ql.exec.TaskRunner.runSequential (taskrunner.java:85)
At Org.apache.hadoop.hive.ql.Driver.launchTask (driver.java:1503)
At Org.apache.hadoop.hive.ql.Driver.execute (driver.java:1270)
At Org.apache.hadoop.hive.ql.Driver.runInternal (driver.java:1088)
At Org.apache.hadoop.hive.ql.Driver.run (driver.java:911)
At Org.apache.hadoop.hive.ql.Driver.run (driver.java:901)
At ORG.APACHE.HADOOP.HIVE.CLI.CLIDRIVER.PROCESSLOCALCMD (clidriver.java:268)
At ORG.APACHE.HADOOP.HIVE.CLI.CLIDRIVER.PROCESSCMD (clidriver.java:220)
At Org.apache.hadoop.hive.cli.CliDriver.processLine (clidriver.java:423)
At Org.apache.hadoop.hive.cli.CliDriver.executeDriver (clidriver.java:792)
At Org.apache.hadoop.hive.cli.CliDriver.run (clidriver.java:686)
At Org.apache.hadoop.hive.cli.CliDriver.main (clidriver.java:625)
At Sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
At Sun.reflect.NativeMethodAccessorImpl.invoke (nativemethodaccessorimpl.java:57)
At Sun.reflect.DelegatingMethodAccessorImpl.invoke (delegatingmethodaccessorimpl.java:43)
At Java.lang.reflect.Method.invoke (method.java:606)
At Org.apache.hadoop.util.RunJar.main (runjar.java:212)

Workaround: Open the Hive-metastore-0.13.0.jar in ${hive_home}/lib with the Unzip tool, discover the file named Package.jdo, open the file, and locate the following content.  <<field name= "Vieworiginaltext" default-fetch-group= "false" >        <column Name= "View_original_text" jdbc-type= "LongVarChar"/></field><field name= "ViewExpandedText" Default-fetch-group= "false" >        <column name= "View_expanded_text" jdbc-type= " LongVarChar "/></field>  can discover that the types of columns View_original_text and View_expanded_text are LongVarChar, Corresponds to a long in Oracle, which contradicts the requirement that an Oracle table can only have one column of type long, so there is an error.   Change the value of the jdbc-type of the two columns to CLOB as recommended by the Hive website, as shown in the revised content.  <<field name= "Vieworiginaltext" default-fetch-group= "false" >        <column Name= "View_original_text" jdbc-type= "CLOB"/></field><field name= "Viewexpandedtext" Default-fetch-group= "false" >        <column name= "View_expanded_text" jdbc-type= "CLOB"/ ></field>  Restart OK

Oracle as Hive metabase, build table error

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.