Uploaded image for project: 'MariaDB ColumnStore'
  1. MariaDB ColumnStore
  2. MCOL-5068

Extract Quarter does not always return correct values

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Fixed
    • 23.02.3
    • 23.02.4
    • None
    • None
    • 2023-6

    Description

      QUARTER(q.claim_closing_date) as QUARTER,
      and
      EXTRACT(QUARTER FROM claim_closing_date) as EXTRACT_QUARTER

      should return the same values, but they do not from a columnstore table:

       
      show create table extract_quarter_example\G
      *************************** 1. row ***************************
             Table: extract_quarter_example
      Create Table: CREATE TABLE `extract_quarter_example` (
        `claim_id` int(11) NOT NULL,
        `claim_name` varchar(11) DEFAULT NULL,
        `claim_closing_date` date DEFAULT NULL
      ) ENGINE=Columnstore DEFAULT CHARSET=utf8mb3
       
      select count(1) from extract_quarter_example;
      +----------+
      | count(1) |
      +----------+
      |   500000 |
      +----------+
       
      SELECT q.claim_id,
             q.claim_closing_date,
             QUARTER(q.claim_closing_date) as QUARTER,
             EXTRACT(QUARTER FROM claim_closing_date) as EXTRACT_QUARTER
      FROM extract_quarter_example q limit 10;
      +-----------+--------------------+---------+-----------------+
      | claim_id  | claim_closing_date | QUARTER | EXTRACT_QUARTER |
      +-----------+--------------------+---------+-----------------+
      | 234751530 | 2014-06-11         |       2 |               2 |
      |  14834870 | 2012-07-28         |       3 |               2 |
      |  36617706 | 2019-11-13         |       4 |               3 |
      |   2170626 | 2022-06-12         |       2 |               2 |
      | 124181396 | 2021-06-25         |       2 |               2 |
      | 128071009 | NULL               |    NULL |            NULL |
      | 177692964 | NULL               |    NULL |            NULL |
      | 193813621 | 2015-07-02         |       3 |               2 |
      | 305626077 | 2012-07-15         |       3 |               2 |
      |  59257621 | 2022-06-22         |       2 |               2 |
      +-----------+--------------------+---------+-----------------+
      

      A factor in this might be that some rows include null values for the date column.

      Attachments

        Activity

          edward Edward Stoever created issue -
          edward Edward Stoever made changes -
          Field Original Value New Value
          Attachment example.sh [ 63420 ]

          I have attached a script you can use to populate the table with sample data using cpimport.

          edward Edward Stoever added a comment - I have attached a script you can use to populate the table with sample data using cpimport.
          toddstoffel Todd Stoffel (Inactive) made changes -
          Rank Ranked higher
          toddstoffel Todd Stoffel (Inactive) made changes -
          Fix Version/s Icebox [ 22302 ]

          CS0397277 - Customer asks why this has taken so long to get fixed.

          edward Edward Stoever added a comment - CS0397277 - Customer asks why this has taken so long to get fixed.
          drrtuy Roman made changes -
          Assignee Leonid Fedorov [ JIRAUSER48443 ]
          drrtuy Roman made changes -
          Assigned for Review Roman [ drrtuy ]
          Assigned for Testing Daniel Lee [ dleeyh ]
          Sprint 2023-6 [ 706 ]
          drrtuy Roman made changes -
          Status Open [ 1 ] Confirmed [ 10101 ]
          drrtuy Roman made changes -
          Assignee Leonid Fedorov [ JIRAUSER48443 ] Roman [ drrtuy ]
          drrtuy Roman made changes -
          Status Confirmed [ 10101 ] In Review [ 10002 ]
          drrtuy Roman made changes -
          Status In Review [ 10002 ] In Testing [ 10301 ]
          drrtuy Roman made changes -
          Assignee Roman [ drrtuy ] Leonid Fedorov [ JIRAUSER48443 ]
          drrtuy Roman made changes -
          Fix Version/s 23.02.4 [ 28909 ]
          Fix Version/s Icebox [ 22302 ]
          drrtuy Roman made changes -
          Affects Version/s 23.02.3 [ 28901 ]

          Must be fixed with MCOL:5503

          leonid.fedorov Leonid Fedorov added a comment - Must be fixed with MCOL:5503
          leonid.fedorov Leonid Fedorov made changes -
          Resolution Fixed [ 1 ]
          Status In Testing [ 10301 ] Closed [ 6 ]
          toddstoffel Todd Stoffel (Inactive) made changes -
          Rank Ranked higher

          This ticket also has been verified by QA.

          dleeyh Daniel Lee (Inactive) added a comment - This ticket also has been verified by QA.
          mariadb-jira-automation Jira Automation (IT) made changes -
          Zendesk Related Tickets 149412

          People

            leonid.fedorov Leonid Fedorov
            edward Edward Stoever
            Roman Roman
            Daniel Lee Daniel Lee (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Git Integration

                Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.