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

Implement a Join_Array Functions within Hive. Join Elements of the Array with a delimiter and return a string.

    XMLWordPrintableJSON

Details

    • New Feature
    • Status: Resolved
    • Major
    • Resolution: Won't Fix
    • 0.7.1
    • None
    • SQL
    • New feature for Hive QL

    • HiveQL

    Description

      When working with arrays, there are times where it would be very beneficial to take the results of an array generating functions such as collect_set and convert that to a delimited string for text processing. In Perlish Pseudo code, the function would work as follows:

      sub array_join($delimiter (string), @input_array(array)){
      my $outputvar = '';
      foreach my $array_item(@input_array)

      { $outputvar = $outputvar.$array_item.$delimeter; }

      $outputvar =~ s/$delimeter$//;
      return $outputvar;
      }

      Basically, pass the function a string to delimit items, and the array, and return the results. Perhaps there can be a limit of sum sort imposted on the return string to alleviate memory concerns, maybe that limit could be defaulted, and then overridden.

      Attachments

        Activity

          People

            Unassigned Unassigned
            mandoskippy John Omernik
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: