[ 
https://issues.apache.org/jira/browse/HIVE-15249?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15889965#comment-15889965
 ] 

Mass Dosage edited comment on HIVE-15249 at 3/1/17 10:53 AM:
-------------------------------------------------------------

Can we just remove the 
{code}
if (type.length() > MAX_MS_TYPENAME_LENGTH) {
      return "type name is too long: " + type;
}
{code}
entirely so we don't have to keep these lengths synchronised in two places? Or 
somehow derive the max length from the length of the type in the db rather than 
having it a hard coded constant in that class?


was (Author: massdos...@gmail.com):
Can we just remove the 
{code}
if (type.length() > MAX_MS_TYPENAME_LENGTH) {
      return "type name is too long: " + type;
}
{code}
entirely so we don't have to keep these lengths synchronised in two places? Or 
somehow derive the length from the length of the type in the db rather than 
having it a hard coded constant in that class?

> HIve 2.1.0 is throwing InvalidObjectException(message:Invalid column type 
> name is too long
> ------------------------------------------------------------------------------------------
>
>                 Key: HIVE-15249
>                 URL: https://issues.apache.org/jira/browse/HIVE-15249
>             Project: Hive
>          Issue Type: Bug
>          Components: Hive
>            Reporter: vishal.rajan
>
> HIve 2.1.0 is throwing InvalidObjectException(message:Invalid column type 
> name is too long
>  If you go through MetaStoreUtils.java you can see MAX_MS_TYPENAME_LENGTH is 
> hard coded to 2000, but this can be set to higher value in mysql.Table create 
> doesn't happen , for tables with higher type length. Different users can 
> change this variable based on different use cases/metastore if this can be a 
> config variable.
>   public static final int MAX_MS_TYPENAME_LENGTH = 2000;
>   public static final String TYPE_FROM_DESERIALIZER = "<derived from 
> deserializer>";
>   /**
>    * validate column type
>    *
>    * if it is predefined, yes. otherwise no
>    * @param name
>    * @return
>    */
>   static public String validateColumnType(String type) {
>     if (type.equals(TYPE_FROM_DESERIALIZER)) return null;
>     if (type.length() > MAX_MS_TYPENAME_LENGTH) {
>       return "type name is too long: " + type;
>     }



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Reply via email to