Search code examples
hivebigdatahqletl

What is Hive Tablename maximum character limit?


Could not locate a suitable specification about the maximum character limit for a Hive Table.

I am developing an ETL process involving hive tables that have specified naming conventions with the format _ and the table names provided are quite larger than 30 byte (normal limit for pl/sql), a straight google search lands me with column name limit but no info on tablename.


Solution

  • Apache Hive is Open Source. In Source Code Veritas.

    With branch 2.1 for instance, the Javadoc and the Java source for "Metastore API" -- as well as the Thrift message format -- manage table names as generic Strings. No specific limit there.

    But the Metastore service uses a RDBMS as back-end, and you can see that the standard MySQL schema defines

    CREATE TABLE IF NOT EXISTS `TBLS` (
    ...
     `TBL_NAME` varchar(128) CHARACTER SET latin1 COLLATE latin1_bin DEFAULT NULL,
    ...
    

    Note that this 128-char-in-Latin-alphabet limit is the default when setting up Hive. A plain ALTER TABLE command afterwards would be sufficient to change that limit at database level, without having to recompile anything.