Uploaded image for project: 'Pig'
  1. Pig
  2. PIG-3259

Optimize byte to Long/Integer conversions

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 0.11, 0.11.1
    • 0.18.0
    • None
    • None

    Description

      These conversions can be performing better. If the input is not numeric (1234abcd) the code calls Double.valueOf(String) regardless before finally returning null. Any script that inadvertently (user's mistake or not) tries to cast non-numeric column to int or long would result in many wasteful calls.

      We can avoid this and only handle the cases we find the input to be a decimal number (1234.56) and return null otherwise even before trying Double.valueOf(String).

      Attachments

        1. byteToLong.xlsx
          51 kB
          Prashant Kommireddi

        Activity

          People

            prkommireddi Prashant Kommireddi
            prkommireddi Prashant Kommireddi
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated: