Uploaded image for project: 'Hive'
  1. Hive
  2. HIVE-13554 [Umbrella] SQL:2011 compliance
  3. HIVE-18291

An exception should be raised if the result is outside the range of decimal

    XMLWordPrintableJSON

    Details

    • Type: Sub-task
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 2.3.0
    • Fix Version/s: None
    • Component/s: SQL
    • Labels:
      None

      Description

      Citing SQL:2011 on page 27 available at http://standards.iso.org/ittf/PubliclyAvailableStandards/c053681_ISO_IEC_9075-1_2011.zip:

      If the result cannot be represented exactly in the result type, then whether it is rounded
      or truncated is implementation-defined. An exception condition is raised if the result is
      outside the range of numeric values of the result type, or if the arithmetic operation
      is not defined for the operands.
      

      Currently Hive is returning NULL instead of throwing an exception if the result is out of range, eg.:

      > select 1000000000000000000.000001*1000000000000000000.000001;
      +-------+
      |  _c0  |
      +-------+
      | NULL  |
      +-------+
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                mgaido Marco Gaido
              • Votes:
                0 Vote for this issue
                Watchers:
                7 Start watching this issue

                Dates

                • Created:
                  Updated: