hadoop-pig-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Santhosh Srinivasan (JIRA)" <j...@apache.org>
Subject [jira] Updated: (PIG-159) Make changes to the parser to support new types functionality
Date Fri, 16 May 2008 19:21:56 GMT

     [ https://issues.apache.org/jira/browse/PIG-159?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Santhosh Srinivasan updated PIG-159:
------------------------------------

    Attachment: parser_chages_v8.patch

The patch supersedes the  v7 patch. The patch includes:

1. Type declaration for map types which was left out
2. Additional test case for grunt to check for the absence of the keyword define

A point that needs some discussion is the declaration of map type and the map constant. The
functional spec states that the map type should be declared as map(type) where type is the
type of the key. This implies that the map can contain keys of a given type.

The map constant on the other hand allows keys of any basic type (int, long, float, double,
string). This makes it inconsistent with the map type declaration.

For now, I have implemented the map type declaration to not include the key type. This will
be consistent with the map constant declaration.

However in procedural languages like C++ and Java, the key type in a map is restricted to
be of the same type, i.e.,  Map<Integer, String>, Map<String, Long>, ...

We need to decide the direction which option should be supported:

1. Keys of the map in a given map restricted to a single type like procedural languages
2. Keys of the map in a given map are allowed to be of any basic type

> Make changes to the parser to support new types functionality
> -------------------------------------------------------------
>
>                 Key: PIG-159
>                 URL: https://issues.apache.org/jira/browse/PIG-159
>             Project: Pig
>          Issue Type: Sub-task
>          Components: impl
>            Reporter: Alan Gates
>            Assignee: Alan Gates
>         Attachments: parser_chages_v5.patch, parser_chages_v6.patch, parser_chages_v7.patch,
parser_chages_v8.patch
>
>
> In order to support the new types functionality described in http://wiki.apache.org/pig/PigTypesFunctionalSpec,
the parse needs to change in the following ways:
> 1) AS needs to support types in addition to aliases.  So where previously it was legal
to say:
> a = load 'myfile' as a, b, c;
> it will now also be legal to say
> a = load 'myfile' as a integer, b float, c chararray;
> 2) Non string constants need to be supported.  This includes non-string atomic types
(integer, long, float, double) and the non-atomic types bags, tuples, and maps.
> 3) A cast operator needs to be added so that fields can be explicitly casted.
> 4) Changes to DEFINE, to allow users to declare arguments and return types for UDFs

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message