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

          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.
          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

            People

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

              Dates

              • Created:
                Updated:
                Resolved:

                Development