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 DC58F10ADE for ; Mon, 14 Oct 2013 13:30:13 +0000 (UTC) Received: (qmail 36790 invoked by uid 500); 14 Oct 2013 13:30:08 -0000 Delivered-To: apmail-hive-dev-archive@hive.apache.org Received: (qmail 36147 invoked by uid 500); 14 Oct 2013 13:30:05 -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 36124 invoked by uid 99); 14 Oct 2013 13:30:03 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 14 Oct 2013 13:30:03 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of hsubramaniyan@hortonworks.com designates 74.125.82.169 as permitted sender) Received: from [74.125.82.169] (HELO mail-we0-f169.google.com) (74.125.82.169) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 14 Oct 2013 13:29:58 +0000 Received: by mail-we0-f169.google.com with SMTP id q58so7149849wes.0 for ; Mon, 14 Oct 2013 06:29:38 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=qH+8WrZUjp4H8u3gwZ+ZNFNo7MNtEj6YlYToxyA/VzY=; b=US9ybgqsHzbehE/t2LzLMnUaiZTDeA/HCVuVXvhDBkcg5Wncz3tYs9JmG15WQ6ub3R gt3z9vBs0wBTDNNR9g1fnjXzK+3QfzrhluMQrcrCNBZc8LjrNfrAe7eNrQTSqWt5AfhJ udL4Nt3knNUPBDV2drhdnTTSskeeHBE7iW4ZrK+/ou3FJZ0GSlk3Tg46E1wot6fwjkb8 gEpeXw/s81gDtQmFmNTWid+LKlPkaInUecK1zRjs0BxqNi9g4caaCa4xTVh/OWqeow01 WjBMF1D/EU/id0R+T9qzmHsHCOwfq+8ExFcWDSwtYmc9JSZECQK/n840x78S+Mwo/DpO +lQg== X-Gm-Message-State: ALoCoQmT3MVNJwQQSpUCFq9hTuwtfuvPMjdTy463yfPSmFfdzt0TvwnH+asEB8+xBhHUOTXDHIARKwht2EuxyhfDdimZgpWN4ZRaFcLL5k88MJsKg1HpuBo= MIME-Version: 1.0 X-Received: by 10.195.13.164 with SMTP id ez4mr29730990wjd.11.1381757377907; Mon, 14 Oct 2013 06:29:37 -0700 (PDT) Received: by 10.216.238.2 with HTTP; Mon, 14 Oct 2013 06:29:37 -0700 (PDT) In-Reply-To: References: Date: Mon, 14 Oct 2013 18:59:37 +0530 Message-ID: Subject: Re: Custom SerDe: Initialize() passes a null configuration to my Custom SerDe From: Hari Subramaniyan To: dev@hive.apache.org, Rui Martins Cc: user@hive.apache.org Content-Type: multipart/alternative; boundary=047d7bb04f68ad2fe704e8b375ee X-Virus-Checked: Checked by ClamAV on apache.org --047d7bb04f68ad2fe704e8b375ee Content-Type: text/plain; charset=US-ASCII Please see https://svn.apache.org/repos/asf/hive/trunk/serde/src/java/org/apache/hadoop/hive/serde2/avro/AvroSerDe.java https://svn.apache.org/repos/asf/hive/trunk/ql/src/test/queries/clientpositive/ to see how a non-null conf is passed to initialize() Thanks Hari On Mon, Oct 14, 2013 at 6:29 PM, Yin Huai wrote: > Can you try to set serde properties? > > https://cwiki.apache.org/confluence/display/Hive/LanguageManual+DDL#LanguageManualDDL-AddSerDeProperties > > I have not tried it, but seems it is the right way to pass configurations > to serde class. > > Thanks, > > Yin > > > On Mon, Oct 14, 2013 at 8:20 AM, Rui Martins wrote: > > > +dev hive mailing list that I should've mailed in the first place. > > > > (apologies for the spam) > > > > > > On Mon, Oct 14, 2013 at 1:16 PM, Rui Martins wrote: > > > >> Hi hive users, > >> > >> I am writing a custom SerDe that loads any protocol buffer generated > >> class. > >> For flexibility this class can live in a jar external to the SerDe's jar > >> and then I just use the Hive Configuration class passed in the > initiliaze > >> to dynamically load it and set the schema for the Hive table. > >> > >> > >> > http://grepcode.com/file/repository.cloudera.com/content/repositories/releases/org.apache.hadoop.hive/hive-serde/0.7.0-cdh3u0/org/apache/hadoop/hive/serde2/Serializer.java#Serializer > >> > >> When I use my custom SerDe as a Deserializer it all works well, I get a > >> Configuration and I correctly load the ProtoBuffer class from the > external > >> Jar. > >> > >> However, when I use the SerDe as a Serializer, the Configuration is > >> always set to null so I have no way of loading the external class from > the > >> Jar. > >> > >> My questions are: > >> > >> * 1) Is the initialize(..) method in Serializer supposed to always pass > >> a null Configuration?* > >> * > >> * > >> * 2) Is there a way of creating or retrieving the current Hadoop/Hive > >> Configuration when this parameter is passed as null?* > >> * > >> * > >> > >> Thank you, > >> rui > >> > > > > > -- CONFIDENTIALITY NOTICE NOTICE: This message is intended for the use of the individual or entity to which it is addressed and may contain information that is confidential, privileged and exempt from disclosure under applicable law. If the reader of this message is not the intended recipient, you are hereby notified that any printing, copying, dissemination, distribution, disclosure or forwarding of this communication is strictly prohibited. If you have received this communication in error, please contact the sender immediately and delete it from your system. Thank You. --047d7bb04f68ad2fe704e8b375ee--