Return-Path: Delivered-To: apmail-hadoop-pig-dev-archive@www.apache.org Received: (qmail 58777 invoked from network); 20 Oct 2009 23:14:22 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 20 Oct 2009 23:14:22 -0000 Received: (qmail 12961 invoked by uid 500); 20 Oct 2009 23:14:22 -0000 Delivered-To: apmail-hadoop-pig-dev-archive@hadoop.apache.org Received: (qmail 12941 invoked by uid 500); 20 Oct 2009 23:14:22 -0000 Mailing-List: contact pig-dev-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: pig-dev@hadoop.apache.org Delivered-To: mailing list pig-dev@hadoop.apache.org Received: (qmail 12927 invoked by uid 99); 20 Oct 2009 23:14:22 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 20 Oct 2009 23:14:22 +0000 X-ASF-Spam-Status: No, hits=-10.5 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 20 Oct 2009 23:14:19 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 5EB65234C045 for ; Tue, 20 Oct 2009 16:13:59 -0700 (PDT) Message-ID: <2081132721.1256080439380.JavaMail.jira@brutus> Date: Tue, 20 Oct 2009 23:13:59 +0000 (UTC) From: "Viraj Bhat (JIRA)" To: pig-dev@hadoop.apache.org Subject: [jira] Created: (PIG-1031) PigStorage interpreting chararray/bytearray for a tuple element inside a bag as float or double MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 PigStorage interpreting chararray/bytearray for a tuple element inside a bag as float or double ----------------------------------------------------------------------------------------------- Key: PIG-1031 URL: https://issues.apache.org/jira/browse/PIG-1031 Project: Pig Issue Type: Bug Components: impl Affects Versions: 0.5.0 Reporter: Viraj Bhat Fix For: 0.5.0, 0.6.0 I have a data stored in a text file as: {(4153E765)} {(AF533765)} I try reading it using PigStorage as: {code} A = load 'pigstoragebroken.dat' using PigStorage() as (intersectionBag:bag{T:tuple(term:bytearray)}); dump A; {code} I get the following results: {code} ({(Infinity)}) ({(AF533765)}) {code} The problem seems to be with the method: parseFromBytes(byte[] b) in class Utf8StorageConverter. This method uses the TextDataParser (class generated via jjt) to interpret the type of data from content, even though the schema tells it is a bytearray. TextDataParser.jjt sample code {code} TOKEN : { ... < DOUBLENUMBER: (["-","+"])? ( ["e","E"] ([ "-","+"])? )?> < FLOATNUMBER: (["f","F"])? > ... } {code} I tried the following options, but it will not work as we need to call bytesToBag(byte[] b) in the Utf8StorageConverter class. {code} A = load 'pigstoragebroken.dat' using PigStorage() as (intersectionBag:bag{T:tuple(term)}); A = load 'pigstoragebroken.dat' using PigStorage() as (intersectionBag:bag{T:tuple(term:chararray)}); {code} Viraj -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.