Uploaded image for project: 'Apache Drill'
  1. Apache Drill
  2. DRILL-7740

LEAST and GREATEST does not work well with date in embedded mode

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 1.17.0
    • Fix Version/s: None
    • Labels:
      None

      Description

      There seems to be a huge problem with LEAST and GREATEST functions in embedded modewhen using them with DATE type

      bash bin/drill-embedded
      apache drill> SELECT a, b, LEAST(a,b) AS min_a_b, GREATEST(a,b) AS max_a_b FROM (select to_date('2018-02-26','yyyy-MM-dd') AS a, to_date('2018-02-28','yyyy-MM-dd') AS b);
      +------------+------------+------------+------------+
      |     a      |     b      |  min_a_b   |  max_a_b   |
      +------------+------------+------------+------------+
      | 2018-02-26 | 2018-02-28 | 2018-02-25 | 2018-02-27 |
      +------------+------------+------------+------------+
      

      min_a_b = 2018-02-25 instead of 2018-02-26
      max_a_b = 2018-02-27 instead of 2018-02-28

      Please note that first time I use LEAST or GREATEST I have a warning:

      WARNING: An illegal reflective access operation has occurred
      WARNING: Illegal reflective access by org.apache.hadoop.hive.common.StringInternUtils (file:.../apache-drill-1.17.0/jars/drill-hive-exec-shaded-1.17.0.jar) to field java.net.URI.string
      WARNING: Please consider reporting this to the maintainers of org.apache.hadoop.hive.common.StringInternUtils
      WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
      WARNING: All illegal access operations will be denied in a future release
      

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              benj641 benj
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated: