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

ASF GitHub Bot commented on TRAFODION-2121:
-------------------------------------------

Github user traflm commented on a diff in the pull request:

    https://github.com/apache/incubator-trafodion/pull/618#discussion_r72054644
  
    --- Diff: core/sql/optimizer/NATable.cpp ---
    @@ -3676,6 +3676,54 @@ NAType* getSQColTypeForHive(const char* hiveType, 
NAMemory* heap)
                                        CharInfo::IMPLICIT);
       } 
     
    +  if ( !strncmp(hiveType, "decimal", 7) )
    +  {
    +    Int16 i=0, pstart=0, pend=0, sstart=0, send=0, p=0, s = 0;
    +    Int16 hiveTypeLen = strlen(hiveType);
    +    char pstr[16], sstr[16];
    +    memset(pstr,0,sizeof(pstr));
    +    memset(sstr,0,sizeof(sstr));
    +
    +    for( i = 0; i < hiveTypeLen; i++ )
    +    {
    +      if(hiveType[i] == '(' )
    +      {
    +        pstart = i+1;
    +      }
    +      else if(hiveType[i] == ',')
    +      {
    +        pend = i;
    +        sstart = i+1;
    +      }
    +      else if(hiveType[i] == ')')
    +      {
    +        send = i;
    +      }
    +      else
    +       continue;
    +    }
    +    if(pend - pstart > 0)
    +    {
    +      strncpy(pstr,hiveType+pstart, pend-pstart);
    --- End diff --
    
    that is a problem, we need to protect this.


> add support of HIVE data type of DECIMAL
> ----------------------------------------
>
>                 Key: TRAFODION-2121
>                 URL: https://issues.apache.org/jira/browse/TRAFODION-2121
>             Project: Apache Trafodion
>          Issue Type: Sub-task
>          Components: sql-cmp
>            Reporter: liu ming
>            Assignee: liu ming
>
> support hive datatype DECIMAL and DECIMAL(p,s)



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to