trafodion-codereview mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From DaveBirdsall <...@git.apache.org>
Subject [GitHub] incubator-trafodion pull request: JIRA TRAFODION-1873
Date Tue, 08 Mar 2016 23:26:28 GMT
Github user DaveBirdsall commented on a diff in the pull request:

    https://github.com/apache/incubator-trafodion/pull/371#discussion_r55447498
  
    --- Diff: core/sql/exp/exp_datetime.h ---
    @@ -49,67 +49,65 @@
     class SQLEXP_LIB_FUNC  ExpDatetime : public SimpleType {
     
     public:
    -  enum asciiFormats 
    +  // these enums must be in the same order as the datetimeFormat[] array 
    +  // (defined in exp_datetime.cpp).
    +  enum DatetimeFormats 
       { 
    -    DATETIME_FORMAT_DEFAULT  = 0,  // YYYY-MM-DD
    -    DATETIME_FORMAT_USA      = 1,  // MM/DD/YYYY AM|PM
    -    DATETIME_FORMAT_EUROPEAN = 2,  // DD.MM.YYYY
    -    DATETIME_FORMAT_DEFAULT2,      // YYYY-MM
    -    DATETIME_FORMAT_USA2,          // MM/DD/YYYY
    -    DATETIME_FORMAT_USA3,          // YYYY/MM/DD
    -    DATETIME_FORMAT_USA4,          // YYYYMMDD
    -    DATETIME_FORMAT_USA5,          // YY/MM/DD
    -    DATETIME_FORMAT_USA6,          // MM/DD/YY
    -    DATETIME_FORMAT_USA7,          // MM-DD-YYYY
    -    DATETIME_FORMAT_USA8,          // YYYYMM
    -    DATETIME_FORMAT_EUROPEAN2,     // DD-MM-YYYY
    -    DATETIME_FORMAT_EUROPEAN3,     // DD-MON-YYYY
    -    DATETIME_FORMAT_EUROPEAN4,     // DDMONYYYY
    -    DATETIME_FORMAT_TIME1,         // 99:99:99:99
    -    DATETIME_FORMAT_TIME2,         // -99:99:99:99
    -    DATETIME_FORMAT_TS1,           // YYYYMMDDHH24MISS
    -    DATETIME_FORMAT_TS2,           // DD.MM.YYYY:HH24:MI:SS
    -    DATETIME_FORMAT_TS3,           // YYYY-MM-DD HH24:MI:SS
    -    DATETIME_FORMAT_TS4,           // HH24:MI:SS
    -    DATETIME_FORMAT_TS5,           // YYYYMMDD:HH24:MI:SS
    -    DATETIME_FORMAT_TS6,           // MMDDYYYY HH24:MI:SS
    -    DATETIME_FORMAT_TS7,           // MM/DD/YYYY HH24:MI:SS
    -    DATETIME_FORMAT_TS8,           // DD-MON-YYYY HH:MI:SS
    -    DATETIME_FORMAT_DATE_STR,      // format in str
    -    DATETIME_FORMAT_TIME_STR,      // format in str
    +    DATETIME_FORMAT_MIN       =  0,
    +    DATETIME_FORMAT_MIN_DATE  =  DATETIME_FORMAT_MIN,
    +    DATETIME_FORMAT_DEFAULT   =  DATETIME_FORMAT_MIN_DATE, // YYYY-MM-DD
    +    DATETIME_FORMAT_USA,        // MM/DD/YYYY AM|PM
    +    DATETIME_FORMAT_EUROPEAN,   // DD.MM.YYYY
    +    DATETIME_FORMAT_DEFAULT2,   // YYYY-MM
    +    DATETIME_FORMAT_USA2,       // MM/DD/YYYY
    +    DATETIME_FORMAT_USA3,       // YYYY/MM/DD
    +    DATETIME_FORMAT_USA4,       // YYYYMMDD
    +    DATETIME_FORMAT_USA5,       // YY/MM/DD
    +    DATETIME_FORMAT_USA6,       // MM/DD/YY
    +    DATETIME_FORMAT_USA7,       // MM-DD-YYYY
    +    DATETIME_FORMAT_USA8,       // YYYYMM
    +    DATETIME_FORMAT_EUROPEAN2,  // DD-MM-YYYY
    +    DATETIME_FORMAT_EUROPEAN3,  // DD-MON-YYYY
    +    DATETIME_FORMAT_EUROPEAN4,  // DDMONYYYY
    +    DATETIME_FORMAT_MAX_DATE  = DATETIME_FORMAT_EUROPEAN4,
    +
    +    DATETIME_FORMAT_MIN_TIME,
    +    DATETIME_FORMAT_TS4       = DATETIME_FORMAT_MIN_TIME, // HH24:MI:SS
    +    DATETIME_FORMAT_MAX_TIME  = DATETIME_FORMAT_TS4,
    +
    +    DATETIME_FORMAT_MIN_TS,
    +    DATETIME_FORMAT_TS1       = DATETIME_FORMAT_MIN_TS, // YYYYMMDDHH24MISS
    +    DATETIME_FORMAT_TS2,     // DD.MM.YYYY:HH24:MI:SS
    +    DATETIME_FORMAT_TS3,     // YYYY-MM-DD HH24:MI:SS
    +    DATETIME_FORMAT_TS5,     // YYYYMMDD:HH24:MI:SS
    +    DATETIME_FORMAT_TS6,     // MMDDYYYY HH24:MI:SS
    +    DATETIME_FORMAT_TS7,     // MM/DD/YYYY HH24:MI:SS
    +    DATETIME_FORMAT_TS8,     // DD-MON-YYYY HH:MI:SS
    +    DATETIME_FORMAT_TS9,     // MONTH DD, YYYY, HH:MI AM|PM
    +    DATETIME_FORMAT_MAX_TS    = DATETIME_FORMAT_TS9,
    +
    +    DATETIME_FORMAT_MAX       = DATETIME_FORMAT_MAX_TS,
    +
    +    DATETIME_FORMAT_MIN_NUM = DATETIME_FORMAT_MAX,
    +    DATETIME_FORMAT_NUM1,     // 99:99:99:99
    +    DATETIME_FORMAT_NUM2,     // -99:99:99:99
    +    DATETIME_FORMAT_MAX_NUM = DATETIME_FORMAT_NUM2,
    +
    +    DATETIME_FORMAT_DATE_STR, // format in str
    +    DATETIME_FORMAT_TIME_STR, // format in str
         DATETIME_FORMAT_NONE,
    -    DATETIME_FORMAT_ERROR
    +    DATETIME_FORMAT_ERROR     = -1
       };
    -  enum asciiFormtLen {
    -    DATETIME_FORMAT_DEFAULT_LEN   = 10,  // YYYY-MM-DD
    -    DATETIME_FORMAT_USA_LEN       = 10,  // MM/DD/YYYY AM|PM
    -    DATETIME_FORMAT_EUROPEAN_LEN  = 10,  // DD.MM.YYYY
    -    DATETIME_FORMAT_DEFAULT2_LEN  =  7,  // YYYY-MM
    -    DATETIME_FORMAT_USA2_LEN      = 10,  // MM/DD/YYYY
    -    DATETIME_FORMAT_USA3_LEN      = 10,  // YYYY/MM/DD
    -    DATETIME_FORMAT_USA4_LEN      =  8,  // YYYYMMDD
    -    DATETIME_FORMAT_USA5_LEN      =  8,  // YY/MM/DD
    -    DATETIME_FORMAT_USA6_LEN      =  8,  // MM/DD/YY
    -    DATETIME_FORMAT_USA7_LEN      = 10,  // MM-DD-YYYY
    -    DATETIME_FORMAT_USA8_LEN      =  6,  // YYYYMM
    -    DATETIME_FORMAT_EUROPEAN2_LEN = 10,  // DD-MM-YYYY
    -    DATETIME_FORMAT_EUROPEAN3_LEN = 11,  // DD-MON-YYYY
    -    DATETIME_FORMAT_EUROPEAN4_LEN =  9,  // DDMONYYYY
    -    DATETIME_FORMAT_TIME1_LEN     = 11,  // 99:99:99:99
    -    DATETIME_FORMAT_TIME2_LEN     = 12,  // -99:99:99:99
    -    DATETIME_FORMAT_TS1_LEN       = 14,  // YYYYMMDDHH24MISS
    -    DATETIME_FORMAT_TS2_LEN       = 19,  // DD.MM.YYYY:HH24:MI:SS
    -    DATETIME_FORMAT_TS3_LEN       = 19,  // YYYY-MM-DD HH24:MI:SS
    -    DATETIME_FORMAT_TS4_LEN       =  8,  // HH24:MI:SS
    -    DATETIME_FORMAT_TS5_LEN       = 17,  // YYYYMMDD:HH24:MI:SS
    -    DATETIME_FORMAT_TS6_LEN       = 17,  // MMDDYYYY HH24:MI:SS
    -    DATETIME_FORMAT_TS7_LEN       = 19,  // MM/DD/YYYY HH24:MI:SS
    -    DATETIME_FORMAT_TS8_LEN       = 20,  // DD-MON-YYYY HH:MI:SS
    -    DATETIME_FORMAT_DATE_STR_LEN  = -1,  // format in str
    -    DATETIME_FORMAT_TIME_STR_LEN  = -1,  // format in str
    -    DATETIME_FORMAT_NONE_LEN      = -1,
    -    DATETIME_FORMAT_ERROR_LEN     = -1
    +
    +  struct DatetimeFormatInfo
    +  {
    +    Lng32 format;       // defined by enum DatetimeFormats
    --- End diff --
    
    Could define this as DatetimeFormats format;


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message