Return-Path: X-Original-To: apmail-hadoop-mapreduce-user-archive@minotaur.apache.org Delivered-To: apmail-hadoop-mapreduce-user-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 2BC58DBA8 for ; Tue, 13 Nov 2012 12:57:35 +0000 (UTC) Received: (qmail 22818 invoked by uid 500); 13 Nov 2012 12:57:30 -0000 Delivered-To: apmail-hadoop-mapreduce-user-archive@hadoop.apache.org Received: (qmail 22719 invoked by uid 500); 13 Nov 2012 12:57:30 -0000 Mailing-List: contact user-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@hadoop.apache.org Delivered-To: mailing list user@hadoop.apache.org Received: (qmail 22710 invoked by uid 99); 13 Nov 2012 12:57:30 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 13 Nov 2012 12:57:30 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of harsh@cloudera.com designates 209.85.223.176 as permitted sender) Received: from [209.85.223.176] (HELO mail-ie0-f176.google.com) (209.85.223.176) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 13 Nov 2012 12:57:23 +0000 Received: by mail-ie0-f176.google.com with SMTP id k11so12009923iea.35 for ; Tue, 13 Nov 2012 04:57:03 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type:x-gm-message-state; bh=Nhza1kGNg6Z6G6cscfOWeLA9eZeXq6uwuJj37bvvUu4=; b=oBDWBbCNEYIVB2xsvW3c/F4jjeHU3TdMUEsmlvx19dxL8HGOg6d64PhUdDZXQEpZmj YpyBWP5L7+JWr0apG0lZF4S1okv/UqCv0pOBrFz2qELgB1oATrzdUMgK4ZkuEz5Q5jME yuoPGMHwG06QvRKH5nTCDqopxGBIqhPMu88Mr2S6Qjfwhwm4a7BbBhx1hCHTLpfkl6mW Z/MVvOwapdphqMgVRK/CRFEZ2aHopKlkOTM9xMqrF865qAPK/B9hXe+tOXSY+FNNoAKt CMEvrdOeF+lnTKMvtMAgfBH9Z/P6cyJZjLTrqX7ORAxYrIwFCK2V51WmMeZ69hljqG3o i6yg== Received: by 10.43.125.133 with SMTP id gs5mr3415885icc.54.1352811423429; Tue, 13 Nov 2012 04:57:03 -0800 (PST) MIME-Version: 1.0 Received: by 10.64.64.41 with HTTP; Tue, 13 Nov 2012 04:56:43 -0800 (PST) In-Reply-To: References: From: Harsh J Date: Tue, 13 Nov 2012 18:26:43 +0530 Message-ID: Subject: Re: Reading from sequence file using java FS api To: user@hadoop.apache.org Content-Type: text/plain; charset=ISO-8859-1 X-Gm-Message-State: ALoCoQk1ULioSmofd8DoVPBfthRs+hSnDaajl9CGs24NIu2RPFkEb494JMrWc7o1+BPve0XKOO6/ X-Virus-Checked: Checked by ClamAV on apache.org Yes, the codec information is stored in the file's header. Same goes for Avro where even the deserialization schema logic is stored in addition, so you can just directly read into usable primitive/compound objects and not have to do manual transformation work. On Tue, Nov 13, 2012 at 6:07 AM, Mohit Anchlia wrote: > I was simple able to read using below code. Didn't have to decompress. It > looks like reader automatically knows and decompresses the file before > returning it to the user. > > > On Mon, Nov 12, 2012 at 3:16 PM, Mohit Anchlia > wrote: >> >> I am looking for an example that read snappy compressed snappy file. Could >> someone point me to it? What I have so far is this: >> >> >> Configuration conf = >> >> new Configuration(); >> >> FileSystem fs = FileSystem.get(URI.create(uri), conf); >> >> Path path = >> >> new Path(uri); >> >> SequenceFile.Reader reader = >> >> null; >> >> org.apache.hadoop.io.LongWritable key = >> >> new org.apache.hadoop.io.LongWritable(); >> >> org.apache.hadoop.io.Text value = >> >> new org.apache.hadoop.io.Text(); >> >> try { >> >> reader = new SequenceFile.Reader(fs, path, conf); > > -- Harsh J