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

    https://github.com/apache/incubator-trafodion/pull/618#discussion_r72301153
  
    --- Diff: core/sql/optimizer/NATable.cpp ---
    @@ -3676,6 +3680,76 @@ NAType* getSQColTypeForHive(const char* hiveType, 
NAMemory* heap)
                                        CharInfo::IMPLICIT);
       } 
     
    +  if ( !strncmp(hiveType, "decimal", 7) )
    +  {
    +    Lng32 i=0, pstart=0, pend=0, sstart=0, send=0, p=-1, s = -1;
    +    Lng32 hiveTypeLen = strlen(hiveType);
    +    char pstr[MAX_NUM_LEN], sstr[MAX_NUM_LEN];
    +    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)
    --- End diff --
    
    What about a type DECIMAL(4). There is no comma, therefore pend is not set, 
and it would not be accepted. Maybe Hive never generates this syntax?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to