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

optimize UDF split

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 2.3.0
    • UDF

    Description

      Min Zhou added a comment - 21/Jul/09 07:34 AM
      It's very useful for us .
      some comments:

      1. Can you implement it directly with Text ? Avoiding string decoding and encoding would be faster. Of course that trick may lead to another problem, as String.split uses a regular expression for splitting.
      2. getDisplayString() always return a string in lowercase.

      [ Show » ]
      Min Zhou added a comment - 21/Jul/09 07:34 AM It's very useful for us . some comments:

      1. Can you implement it directly with Text ? Avoiding string decoding and encoding would be faster. Of course that trick may lead to another problem, as String.split uses a regular expression for splitting.
      2. getDisplayString() always return a string in lowercase.

      [ Permlink | « Hide ]
      Namit Jain added a comment - 21/Jul/09 09:22 AM
      Committed. Thanks Emil
      [ Show » ]
      Namit Jain added a comment - 21/Jul/09 09:22 AM Committed. Thanks Emil

      [ Permlink | « Hide ]
      Emil Ibrishimov added a comment - 21/Jul/09 10:48 AM
      There are some easy (compromise) ways to optimize split:

      1. Check if the regex argument actually contains some "regex specific characters" and if it doesn't, do a straightforward split without converting to strings.
      2. Assume some default value for the second argument (for example - split(str) to be equivalent to split(str, ' ') and optimize for this value
      3. Have two separate split functions - one that does regex and one that splits around plain text.

      I think that 1 is a good choice and can be done rather quickly.
      [ Show » ]
      Emil Ibrishimov added a comment - 21/Jul/09 10:48 AM There are some easy (compromise) ways to optimize split: 1. Check if the regex argument actually contains some "regex specific characters" and if it doesn't, do a straightforward split without converting to strings. 2. Assume some default value for the second argument (for example - split(str) to be equivalent to split(str, ' ') and optimize for this value 3. Have two separate split functions - one that does regex and one that splits around plain text. I think that 1 is a good choice and can be done rather quickly.

      Attachments

        1. HIVE-664.1.patch.txt
          6 kB
          Teddy Choi
        2. HIVE-664.2.patch.txt
          6 kB
          Teddy Choi
        3. HIVE-664.3.patch.txt
          6 kB
          Teddy Choi
        4. HIVE-664.4.patch
          3 kB
          Teddy Choi

        Issue Links

          Activity

            People

              teddy.choi Teddy Choi
              namit Namit Jain
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: