[ https://issues.apache.org/jira/browse/TRAFODION-2121?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15392985#comment-15392985 ]
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_r72174731 --- 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); + p=atoi(pstr); + } + if(send - sstart > 0) + { + strncpy(sstr,hiveType+sstart,send-sstart); + s=atoi(sstr); + } + + if( (p>0) && (s>0) ) --- End diff -- yes @zellerh , will add this branch. I didn't realize there is decimal(p) , but it is allowed in Hive. > 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)