Uploaded image for project: 'Hive'
  1. Hive
  2. HIVE-11544

LazyInteger should avoid throwing NumberFormatException

Log workAgile BoardRank to TopRank to BottomVotersWatch issueWatchersCreate sub-taskConvert to sub-taskMoveLinkCloneLabelsUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments


    • Release Note:
      Improve LazySimpleSerDe null data handling for Byte, Short, Integer, Float, Long and Double.


      LazyInteger#parseInt will throw a NumberFormatException under these conditions:

      1. bytes are null
      2. radix is invalid
      3. length is 0
      4. the string is '+' or '-'
      5. LazyInteger#parse throws a NumberFormatException

      Most of the time, such as in LazyInteger#init and LazyByte#init, the exception is caught, swallowed, and isNull is set to true.

      This is generally a bad workflow, as exception creation is a performance bottleneck, and potentially repeating for many rows in a query can have a drastic performance consequence.

      It would be better if this method returned an Optional<Integer>, which would provide similar functionality with a higher throughput rate.

      I've tested against 0.14.0, and saw that the logic is unchanged in 1.2.0, so I've marked those as affected. Any version in between would also suffer from this.


        1. HIVE-11544.4.patch
          19 kB
          Gopal Vijayaraghavan
        2. HIVE-11544.3.patch
          19 kB
          Gopal Vijayaraghavan
        3. HIVE-11544.2.patch
          18 kB
          Gopal Vijayaraghavan
        4. HIVE-11544.1.patch
          5 kB
          Gopal Vijayaraghavan

        Issue Links


          $i18n.getText('security.level.explanation', $currentSelection) Viewable by All Users


            • Assignee:
              gopalv Gopal Vijayaraghavan Assign to me
              bills William Slacum


              • Created:

                Issue deployment