Return-Path: X-Original-To: apmail-pig-dev-archive@www.apache.org Delivered-To: apmail-pig-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 E3A0BCE8E for ; Tue, 22 May 2012 23:44:43 +0000 (UTC) Received: (qmail 91003 invoked by uid 500); 22 May 2012 23:44:43 -0000 Delivered-To: apmail-pig-dev-archive@pig.apache.org Received: (qmail 90946 invoked by uid 500); 22 May 2012 23:44:43 -0000 Mailing-List: contact dev-help@pig.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@pig.apache.org Delivered-To: mailing list dev@pig.apache.org Received: (qmail 90935 invoked by uid 500); 22 May 2012 23:44:43 -0000 Delivered-To: apmail-hadoop-pig-dev@hadoop.apache.org Received: (qmail 90932 invoked by uid 99); 22 May 2012 23:44:43 -0000 Received: from issues-vm.apache.org (HELO issues-vm) (140.211.11.160) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 22 May 2012 23:44:43 +0000 Received: from isssues-vm.apache.org (localhost [127.0.0.1]) by issues-vm (Postfix) with ESMTP id 016E414281C for ; Tue, 22 May 2012 23:44:43 +0000 (UTC) Date: Tue, 22 May 2012 23:44:42 +0000 (UTC) From: "Andy Schlaikjer (JIRA)" To: pig-dev@hadoop.apache.org Message-ID: <1823403831.10027.1337730283008.JavaMail.jiratomcat@issues-vm> In-Reply-To: <1036799060.5980.1337646101178.JavaMail.jiratomcat@issues-vm> Subject: [jira] [Commented] (PIG-2715) Cannot specify schema field alias for map value via piglatin 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/PIG-2715?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13281319#comment-13281319 ] Andy Schlaikjer commented on PIG-2715: -------------------------------------- > When you print out the schema, there is no alias: "map[int]". And we will not parse "map[count:int]". When I "DESCRIBE relation_with_map_with_value_alias" I *do* see map value alias e.g. "map[count: int]" when code has programmatically set the alias, in this case within a LoadFunc implementation. > Cannot specify schema field alias for map value via piglatin > ------------------------------------------------------------ > > Key: PIG-2715 > URL: https://issues.apache.org/jira/browse/PIG-2715 > Project: Pig > Issue Type: Bug > Components: parser > Affects Versions: 0.10.0 > Reporter: Andy Schlaikjer > > Programmatically, pig components are able to define schema field aliases for map values, but the same cannot be done via piglatin. For example: > {code} > %default INPUT_PATH 'map_value_alias_bug.tsv'; > A = LOAD '$INPUT_PATH' AS ( > id: long, > -- events: [count: int] -- parse failure > events: [int] > ); > DESCRIBE A; > A = FOREACH A GENERATE > id, > -- (map[count: int]) events -- parse failure > -- ([count: int]) events -- parse failure > -- events: [count: int] -- parse failure > -- events AS [count: int] -- parse failure > -- events AS events: [count: int] -- parse failure > ([int]) events -- this is okay > ; > DESCRIBE A; > quit; > {code} > When using the [Elephant Bird project|https://github.com/kevinweil/elephant-bird/]'s [ThriftToPig utility|https://github.com/kevinweil/elephant-bird/blob/master/src/java/com/twitter/elephantbird/pig/util/ThriftToPig.java#L273] along with a Thrift message spec containing a map field, I see schemas of the following form: > {code} > message: {id: long,events: map[events: int])}} > {code} > This same DESCRIBE output does not parse if used within piglatin. -- 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