Home | About | Sematext search-lucene.com search-hadoop.com
 Search Hadoop and all its subprojects:

Switch to Threaded View
Hive >> mail # dev >> Oracle-backed metastore: Modify package.jdo?


Copy link to this message
-
Oracle-backed metastore: Modify package.jdo?
Hello, hive-dev.

I'm working on the HCatalog project. I'm trying to get the Hive-Metastore to work when backed by an Oracle backend. There's a change to hive's package.jdo that I'd like advice/comments on.

One sticking point on the Oracle thingie has been the TBLS table (MTable) and its 2 LONGVARCHAR properties (VIEW_ORIGINAL_TEXT and VIEW_EXPANDED_TEXT). Oracle doesn't support more than one LONGVARCHAR property per table (for reason of legacy), and prefers that one use CLOBs instead. If one switches to CLOB properties, with no modification to hive's package.jdo, one sees the following exception:

<quote>
Incompatible data type for column TBLS.VIEW_EXPANDED_TEXT : was CLOB
(datastore), but type expected was LONGVARCHAR (metadata). Please check that
the type in the datastore and the type specified in the MetaData are
consistent.
org.datanucleus.store.rdbms.exceptions.IncompatibleDataTypeException:
Incompatible data type for column TBLS.VIEW_EXPANDED_TEXT : was CLOB
(datastore), but type expected was LONGVARCHAR (metadata). Please check that
the type in the datastore and the type specified in the MetaData are
consistent. at
org.datanucleus.store.rdbms.table.ColumnImpl.validate(ColumnImpl.java:521) at
org.datanucleus.store.rdbms.table.TableImpl.validateColumns(TableImpl.java:2
</quote>

But if one rebuilds Hive with the package.jdo changed to use CLOBs instead of LONGVARCHARs, things look promising:
1. The exception no longer occurs. Things seem to work with Oracle. (I'm still testing this.)
2. These modified hive-libraries work as is with pre-existing mysql metastores. Migrating data isn't a worry.
3. The unit-tests seem to run through. (Still running.)

Would there be opposition to changing the package.jdo's LONGVARCHAR references to CLOB, if this works with mysql and with Oracle? Any advice would be appreciated greatly.

Mithun

P.S. I also have a working hive-schema-0.9.0-oracle.sql script that I'm testing, for the related issue of creating the required tables in Oracle.