[
https://issues.apache.org/jira/browse/PIG-505?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12642637#action_12642637
]
David Ciemiewicz commented on PIG-505:
--------------------------------------
Santhosh,
This sounds fine. I don't quite follow comment #3 but if the result is the
similar to doing a cast of a Java Object to a String, Float, Double, Integer,
Long, etc, then this sounds cool.
It would seem that if some Data was a DataByteArray (bytearray) in the map and
this required conversion, would it be possible to do a double cast such as:
(chararray) (bytearray) mymap#'abytearrayfield' as bytearray_now_chararray
Presumably one might need to add some parentheses:
(chararray) ((bytearray) (mymap#'abytearrayfield')) as bytearray_now_chararray
Maybe it should be okay to have runtime errors in the case of unknown.
Ideally, I'd like compile time errors for unknown which force us to use casts
-- we can never have an unknown detected at compile time without resulting in
the need for a cast.
There is a question though of what load functions that use maps will do that is
different than URLPARSE and other UDFs that return maps.
> Lineage for UDFs that do not return bytearray
> ---------------------------------------------
>
> Key: PIG-505
> URL: https://issues.apache.org/jira/browse/PIG-505
> Project: Pig
> Issue Type: Bug
> Affects Versions: types_branch
> Reporter: Santhosh Srinivasan
> Assignee: Santhosh Srinivasan
> Fix For: types_branch
>
>
> In Pig-335, the lineage design states that UDFs that return bytearrays could
> cause problems in tracing the lineage. For UDFs that do not return bytearray,
> the lineage design should pickup the right load function to use as long as
> there is no ambiguity. In the current implementation, we could have issues
> with scripts like:
> {code}
> a = load 'input' as (field1);
> b = foreach a generate myudf_to_double(field1);
> c = foreach b generate $0 + 2.0;
> {code}
> When $0 has to be cast to a double, the lineage code will complain that it
> hit a UDF and hence cannot determine the right load function to use.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.