trafodion-codereview mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kakaxi3019 <...@git.apache.org>
Subject [GitHub] trafodion pull request #1622: [TRAFODION-3118] Improve on parts of EXTRACT
Date Thu, 05 Jul 2018 06:17:16 GMT
Github user kakaxi3019 commented on a diff in the pull request:

    https://github.com/apache/trafodion/pull/1622#discussion_r200242167
  
    --- Diff: core/sql/optimizer/SynthType.cpp ---
    @@ -4416,6 +4416,22 @@ const NAType *Extract::synthesizeType()
     
         return NULL;
       }
    +  if ( type != NA_DATETIME_TYPE )
    +    {
    +      enum rec_datetime_field eField = getExtractField();
    +      NAString sErr;
    +      if ( REC_DATE_WEEK == eField
    +          || REC_DATE_DOW == eField
    +          || REC_DATE_DOY == eField
    +          || REC_DATE_WOM == eField
    +          || REC_DATE_CENTURY == eField)
    --- End diff --
    
    DECADE,EPOCH,QUARTER should not be in this list, because DECADE support interval.
    exp.
    EXTRACT(DECADE FROM INTERVAL '9' YEAR - INTERVAL '99' YEAR);


---

Mime
View raw message