Hive
  1. Hive
  2. HIVE-5918

int / int division does not vectorize due to type checks

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Duplicate
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Vectorization
    • Labels:
      None

      Description

      When I try to vectorize e.g. select cbigint / 0 from alltypesorc, (with some logging added), I get my logging
      physical.Vectorizer (Vectorizer.java:validateExprNodeDescRecursive(642)) - failed to validate type: decimal(25,6); (cbigint / 0)

        Issue Links

          Activity

          Sergey Shelukhin created issue -
          Sergey Shelukhin made changes -
          Field Original Value New Value
          Component/s Vectorization [ 12321300 ]
          Sergey Shelukhin made changes -
          Link This issue is depended upon by HIVE-5895 [ HIVE-5895 ]
          Hide
          Eric Hanson added a comment -

          Good catch. We need regression tests for this too. I have a feeling this might be a regression due to recent decimal work.

          Show
          Eric Hanson added a comment - Good catch. We need regression tests for this too. I have a feeling this might be a regression due to recent decimal work.
          Sergey Shelukhin made changes -
          Link This issue is related to HIVE-5356 [ HIVE-5356 ]
          Sergey Shelukhin made changes -
          Summary simple arithmetic expressions may not vectorize due to type checks int / int division does not vectorize due to type checks
          Hide
          Sergey Shelukhin added a comment -

          We discussed w/Jitendra Nath Pandey; the cause appears to be GenericUDFOPDivide::deriveResultExactTypeInfo, which is always decimal, from HIVE-5356. So, ints are exact types, and this goes to decimal. Didn't discuss solutions yet.
          Ideally, we should have vectorization support for decimal.

          Show
          Sergey Shelukhin added a comment - We discussed w/ Jitendra Nath Pandey ; the cause appears to be GenericUDFOPDivide::deriveResultExactTypeInfo, which is always decimal, from HIVE-5356 . So, ints are exact types, and this goes to decimal. Didn't discuss solutions yet. Ideally, we should have vectorization support for decimal.
          Hide
          Sergey Shelukhin added a comment -

          This is by design right now. Exact type division has to produce exact type according to SQL standard. Double as it previously did would break that... making it int is probably not what users expect (given that it was previously double). Optionally we could do a hack that converts to-from double, but that is ugly and would change query results from vectorization when conversion is lossy.

          For proper fix, decimal support would need to be added. That is tracked in HIVE-5937

          Show
          Sergey Shelukhin added a comment - This is by design right now. Exact type division has to produce exact type according to SQL standard. Double as it previously did would break that... making it int is probably not what users expect (given that it was previously double). Optionally we could do a hack that converts to-from double, but that is ugly and would change query results from vectorization when conversion is lossy. For proper fix, decimal support would need to be added. That is tracked in HIVE-5937
          Sergey Shelukhin made changes -
          Link This issue Is contained by HIVE-5937 [ HIVE-5937 ]
          Sergey Shelukhin made changes -
          Status Open [ 1 ] Resolved [ 5 ]
          Resolution Duplicate [ 3 ]
          Sergey Shelukhin made changes -
          Link This issue is depended upon by HIVE-5895 [ HIVE-5895 ]
          Eric Hanson made changes -
          Link This issue Is contained by HIVE-5762 [ HIVE-5762 ]
          Transition Time In Source Status Execution Times Last Executer Last Execution Date
          Open Open Resolved Resolved
          1d 1h 12m 1 Sergey Shelukhin 04/Dec/13 01:04

            People

            • Assignee:
              Sergey Shelukhin
              Reporter:
              Sergey Shelukhin
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development