Uploaded image for project: 'Search and Discovery'
  1. Search and Discovery
  2. SEARCH-2304

Support for CAST AS TIMESTAMP function for Date and Datetime fields

    Details

    • Type: Story
    • Status: Done
    • Resolution: Done
    • Affects Version/s: Search Services 1.4
    • Fix Version/s: Search Services 2.0
    • Labels:
      None

      Description

      When using Tableau, date fields are drilled down using CAST functions when gathering hour, minutes and seconds. This produces queries including the following pattern:

      SELECT HOUR(CAST(`cm_created` AS TIMESTAMP))
      FROM alfresco
      GROUP BY HOUR(CAST(`cm_created` AS TIMESTAMP))
      

      We can simplify the case testing following query:

      SELECT CAST(`cm_created` AS TIMESTAMP)
      FROM alfresco
      

      That produces this exception when executed:

      java.lang.ClassCastException: class java.lang.String cannot be cast to class java.lang.Number
      

      Acceptance criteria:

      • SELECT CAST in SELECT, WHERE and GROUP BY
      • Support CAST as an inner operator

        Attachments

          Issue Links

            Structure

              Activity

                People

                • Assignee:
                  Unassigned
                  Reporter:
                  aborroy Angel Borroy
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  5 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved:

                    Structure Helper Panel