Uploaded image for project: 'IMPALA'
  1. IMPALA
  2. IMPALA-4780

Wrong result with next_day() when codegen is enabled.

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Blocker
    • Resolution: Fixed
    • Impala 2.3.0, Impala 2.5.0, Impala 2.4.0, Impala 2.6.0, Impala 2.7.0, Impala 2.8.0
    • Impala 2.9.0
    • Backend

    Description

      next_day() keeps returning NULL as it always complains that the interval parameter being added is always too large. It works perfectly fine when codegen is disabled.

      Execute the following query with query options: EXEC_SINGLE_NODE_ROWS_THRESHOLD=0 and ENABLE_EXPR_REWRITES=0.

      [localhost:21000] > select next_day('2017-01-18', 'Thursday');
      Query: select next_day('2017-01-18', 'Thursday')
      Query submitted at: 2017-01-18 10:37:00 (Coordinator: http://kwho-desktop:25000)
      Query progress can be monitored at: http://kwho-desktop:25000/query_plan?query_id=7e4ad3bce2409928:79899e3100000000
      +------------------------------------+
      | next_day('2017-01-18', 'thursday') |
      +------------------------------------+
      | NULL                               |
      +------------------------------------+
      WARNINGS: UDF WARNING: Cannot add interval 1: Interval value too large
      
      Fetched 1 row(s) in 0.22s
      [localhost:21000] > set disable_codegen=true;
      DISABLE_CODEGEN set to true
      [localhost:21000] > select next_day('2017-01-18', 'Thursday');
      Query: select next_day('2017-01-18', 'Thursday')
      Query submitted at: 2017-01-18 10:37:07 (Coordinator: http://kwho-desktop:25000)
      Query progress can be monitored at: http://kwho-desktop:25000/query_plan?query_id=24454a20d73fed3c:8fef716700000000
      +------------------------------------+
      | next_day('2017-01-18', 'thursday') |
      +------------------------------------+
      | 2017-01-19 00:00:00                |
      +------------------------------------+
      Fetched 1 row(s) in 0.01s
      

      Attachments

        Activity

          People

            kwho Michael Ho
            kwho Michael Ho
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: