[ 
https://issues.apache.org/jira/browse/PIG-427?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12632422#action_12632422
 ] 

Olga Natkovich commented on PIG-427:
------------------------------------

Hi Shravan,

Thanks for the patch. I have a couple of comments:

(1) We don't support BOOLEAN is type in the language so we don't need it in the 
mapping
(2) I don't think we should cast numeric types to chararrays because we don't 
know what encoding to use
(3) I don't think we should cast bytearrays to anything implicitely since we 
don't know what is a safe cast in this case
(4) I think that if multiple function get the same score, we should say that it 
is ambiguous and ask for explicit cast. For instance, we have 2 functions (int, 
float) and (float, int) and the input (int, int) - we should say that we can't 
choose.

> casting parameters of a UDF
> ---------------------------
>
>                 Key: PIG-427
>                 URL: https://issues.apache.org/jira/browse/PIG-427
>             Project: Pig
>          Issue Type: Improvement
>    Affects Versions: types_branch
>            Reporter: Olga Natkovich
>            Assignee: Shravan Matthur Narayanamurthy
>             Fix For: types_branch
>
>         Attachments: 427.patch
>
>
> Currently if we have a UDF that declares via getArgToFuncMapping that it can 
> only handle a subset of types, passing any other types to the function would 
> result in an error. However, some types can be promoted to others and it 
> would be useful if typechecker to perform best fit cast. For instance, if the 
> input parameter has type of Long and the UDF support Int and Double, the code 
> should cast the paraneter into Double.
> This would be very useful for conversion of the UDFs from the piigybank to 
> the new code.

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

Reply via email to