Return-Path: X-Original-To: apmail-hive-dev-archive@www.apache.org Delivered-To: apmail-hive-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 3BE30C9BB for ; Mon, 28 May 2012 18:11:24 +0000 (UTC) Received: (qmail 52813 invoked by uid 500); 28 May 2012 18:11:23 -0000 Delivered-To: apmail-hive-dev-archive@hive.apache.org Received: (qmail 52762 invoked by uid 500); 28 May 2012 18:11:23 -0000 Mailing-List: contact dev-help@hive.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@hive.apache.org Delivered-To: mailing list dev@hive.apache.org Received: (qmail 52752 invoked by uid 500); 28 May 2012 18:11:23 -0000 Delivered-To: apmail-hadoop-hive-dev@hadoop.apache.org Received: (qmail 52749 invoked by uid 99); 28 May 2012 18:11:23 -0000 Received: from issues-vm.apache.org (HELO issues-vm) (140.211.11.160) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 28 May 2012 18:11:23 +0000 Received: from isssues-vm.apache.org (localhost [127.0.0.1]) by issues-vm (Postfix) with ESMTP id 8DB1A140B94 for ; Mon, 28 May 2012 18:11:23 +0000 (UTC) Date: Mon, 28 May 2012 18:11:23 +0000 (UTC) From: "Edward Capriolo (JIRA)" To: hive-dev@hadoop.apache.org Message-ID: <722612855.9054.1338228683584.JavaMail.jiratomcat@issues-vm> In-Reply-To: <1377532295.51411.1323300162015.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] [Commented] (HIVE-2633) Implement a Join_Array Functions within Hive. Join Elements of the Array with a delimiter and return a string. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/HIVE-2633?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13284502#comment-13284502 ] Edward Capriolo commented on HIVE-2633: --------------------------------------- concat_ws takes both strings and string arrays. https://issues.apache.org/jira/browse/HIVE-2203 This works. join(["a", "b", "c"], ",") -> "a,b,c". > Implement a Join_Array Functions within Hive. Join Elements of the Array with a delimiter and return a string. > --------------------------------------------------------------------------------------------------------------- > > Key: HIVE-2633 > URL: https://issues.apache.org/jira/browse/HIVE-2633 > Project: Hive > Issue Type: New Feature > Components: SQL > Affects Versions: 0.7.1 > Environment: New feature for Hive QL > Reporter: John Omernik > Labels: SQL > > 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. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira