Return-Path: X-Original-To: apmail-hive-user-archive@www.apache.org Delivered-To: apmail-hive-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 13CE18B83 for ; Wed, 10 Aug 2011 08:07:23 +0000 (UTC) Received: (qmail 64657 invoked by uid 500); 10 Aug 2011 07:48:33 -0000 Delivered-To: apmail-hive-user-archive@hive.apache.org Received: (qmail 64621 invoked by uid 500); 10 Aug 2011 07:48:06 -0000 Mailing-List: contact user-help@hive.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@hive.apache.org Delivered-To: mailing list user@hive.apache.org Received: (qmail 64598 invoked by uid 99); 10 Aug 2011 07:47:58 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 10 Aug 2011 07:47:58 +0000 X-ASF-Spam-Status: No, hits=2.2 required=5.0 tests=FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_NONE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [98.138.91.65] (HELO nm8-vm1.bullet.mail.ne1.yahoo.com) (98.138.91.65) by apache.org (qpsmtpd/0.29) with SMTP; Wed, 10 Aug 2011 07:47:44 +0000 Received: from [98.138.90.53] by nm8.bullet.mail.ne1.yahoo.com with NNFMP; 10 Aug 2011 07:47:21 -0000 Received: from [98.138.86.157] by tm6.bullet.mail.ne1.yahoo.com with NNFMP; 10 Aug 2011 07:47:21 -0000 Received: from [127.0.0.1] by omp1015.mail.ne1.yahoo.com with NNFMP; 10 Aug 2011 07:47:21 -0000 X-Yahoo-Newman-Property: ymail-3 X-Yahoo-Newman-Id: 687155.29055.bm@omp1015.mail.ne1.yahoo.com Received: (qmail 21785 invoked by uid 60001); 10 Aug 2011 07:47:21 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1312962441; bh=pTmcdTxMD3BEMJbxIzqiacvuIbKwqftQakAIXNUsl14=; h=X-YMail-OSG:Received:X-Mailer:Message-ID:Date:From:Reply-To:Subject:To:MIME-Version:Content-Type; b=W8N3SpyR8Dq3b/sxcVUYV/Nz9WZjL4+rGRtB3On56wNBKp6uyGoPZPiTQCpKVNlcQu3WCXuJc/6VzjJm+xPiO+OCRh4eHQCtR+JmrfZ7RksR/cQwmEvXo42euu9PjyPH5Mhpky0vpTfNTJtulrc0sEcQ7WtgS+pS1QxDEYtKIAU= DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=X-YMail-OSG:Received:X-Mailer:Message-ID:Date:From:Reply-To:Subject:To:MIME-Version:Content-Type; b=2COApy+NM1Rp3Br7MBsLc7pqGbhsr7xHdBHb6S6viIGrbPxUU/v2O2J0P0+RDCqz/iSZYVtyO0dKE/1Bd/tAe5I4g4m9srg8gIOVMjrsANnm2P6OedWUHViW0vXXFrynVuLFo6tHrOGOZjqVQdTK065+RWpfVn9ZosdT1WcDqHg=; X-YMail-OSG: dCL1bJIVM1n4nLSx.qpaSYQnB02bPa6_S17dm7sjGLE_ayj nUWiK7L7kw2yApW03qgfXX_VK4ShsH355Duhrhuhj8DDknxohqoYphRcpJ04 FTkcLVWygkq5mvhPBzZmNocds8n0DpWV3aav8wA177qBFNp.ZS4HkY_NP8zT u9qOtV2ho76S7m92MQ_R0_pnOl9so_F5mK4OgD8Uqg3lz5wy0QB9gdPh9Ham shGnlZ1C3zQdqaKJc3sixWkZKN1ax1JyCD2s0B9Ytd9N7DFtttHasAgaTGrq GvqDTKcVQzUUfuz3xUFWM_KYviJEidKV9UAom7wuGbbCRlZTxy4JPDWLjRbk 4cgN3VI3t8klq7_ZyLnLmRBGoPUHC8HyBxPjx_P3gPJXlXh5Ky8P6ZzIVwZS CtOvozzBIzQraNRwmCbivVpYmcbWsOU6xeghhtxiB9BdO2o86Rp8AkPm6Ioi 21VAKvIuMVEal2smpurWGpDBTJcXtN8yFuzcWZ5018AqmyBOL97kEcL7jAau 512V3i20wNbJcAZO63PhdeIBUULQOlVMHsmBwg6A6p11bWKp2jRnjnNY.wyX VOExFxujXTyrdc5MyGdKAA2rNf0.mWkXVCLmYeqlAp.ZZfy37T5fhSv4chAq Jm5eeh1eG Received: from [107.3.143.80] by web110509.mail.gq1.yahoo.com via HTTP; Wed, 10 Aug 2011 00:47:21 PDT X-Mailer: YahooMailWebService/0.8.113.313619 Message-ID: <1312962441.3547.YahooMailNeo@web110509.mail.gq1.yahoo.com> Date: Wed, 10 Aug 2011 00:47:21 -0700 (PDT) From: Ayon Sinha Reply-To: Ayon Sinha Subject: Adding UDF permanently to my Hive install To: Hive Mailinglist MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="0-1712898956-1312962441=:3547" --0-1712898956-1312962441=:3547 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Hi,=0AI know I have asked this question before but the answers didn't quite= satisfy my requirements. Our problem stems from the fact that there is not= built-in UDF equivalent to yearweek of Mysql. This gives the year + week c= oncatenated, with the week starting on Sunday.=0ASo we wrote our UDF but no= w we want it to be available to everyone in the company regardless of how t= hey are using Hive, through web client of CLi. I want to install this jar i= n a place where it gets added to the Hive classpath (This part is not hard)= . Whats hard is simulating=A0=0A"create temporary function yearweek as 'cla= ssname'"=A0=0A=0AI want the ability to have this registered permanently. I = traced it down to FunctionRegistry class where the build-ins are registered= at init time and there is a statis public method available=0Apublic static= void registerUDF(boolean isNative, String functionName,=0A=A0 =A0 =A0 Clas= s UDFClass, boolean isOperator) {=0A=A0 =A0 registerUDF(isNa= tive, functionName, UDFClass, isOperator, functionName=0A=A0 =A0 =A0 =A0 .t= oLowerCase());=0A=A0 }=0A=0Awhich I just want to trigger like FunctionRegis= try.registerUDF(true, "yearweek", myclass, false)=0AIs there any switch/set= ting anywhere I can trigger this ?=A0=0AI need this the most for the Hive s= erver.=0AShort of patching the code, I can't seem to find a way.=0A=0AIdeal= ly there would be a version like:=A0=0Acreate [permanent] function yearweek= as 'classname'=0A=A0=0A-Ayon=0ASee My Photos on Flickr=0AAlso check out my= Blog for answers to commonly asked questions.=0A --0-1712898956-1312962441=:3547 Content-Type: text/html; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable
Hi,
= I know I have asked this question before but the answers didn't quite= satisfy my requirements. Our problem stems from the fact that there is not= built-in UDF equivalent to yearweek of Mysql. This gives the year + week c= oncatenated, with the week starting on Sunday.
So we= wrote our UDF but now we want it to be available to everyone in the compan= y regardless of how they are using Hive, through web client of CLi. I want = to install this jar in a place where it gets added to the Hive classpath (T= his part is not hard). Whats hard is simulating 
"create temporary function yearweek as 'classname'" 

I want the ability to have this registe= red permanently. I traced it down to FunctionRegistry class where the build-ins are registered at init time and there is a statis public method = available
=0A=0A=0A=0A=0A=0A=0A=0A=0A=0A=0A
public static = void registerUDF(boolean isNative, String functionName,
=0A
    &n= bsp; Class<? extends UDF> UDFClass, boolean isOperator) {
=0A
  &= nbsp; registerUDF(isNative, functionName, UDFClass, isOperator, functionNam= e
=0A
        .toLowerCase());=0A
  }

which I just want to trigger like FunctionRegistry.registerUDF(tru= e, "yearweek", myclass, false)
Is there any switch/s= etting anywhere I can trigger this ? 
I need th= is the most for the Hive server.
Short of patching t= he code, I can't seem to find a way.

Ideally there would be a version like: 
create [permanent] function yearweek as 'classname'
 
--0-1712898956-1312962441=:3547--