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

Jenny Thompson commented on PIG-3805:
-------------------------------------

That only tests the exec function of ToString, not the getArgToFuncMapping 
functions. This means that when using the Pig script 
"ToString(ToDate('2009-01-07T01:07:01.000Z'))" I get the error:

Caused by: org.apache.pig.impl.logicalLayer.validators.TypeCheckerException: 
ERROR 1045: 
<line 2, column 144> Could not infer the matching function for 
org.apache.pig.builtin.ToString as multiple or none of them fit. Please use an 
explicit cast.
        at 
org.apache.pig.newplan.logical.visitor.TypeCheckingExpVisitor.visit(TypeCheckingExpVisitor.java:784)

though
ToDate('2009-01-07T01:07:01.000Z') works fine.


> ToString(datetime [, format string]) doesn't work without the second argument
> -----------------------------------------------------------------------------
>
>                 Key: PIG-3805
>                 URL: https://issues.apache.org/jira/browse/PIG-3805
>             Project: Pig
>          Issue Type: Bug
>          Components: internal-udfs
>    Affects Versions: 0.12.0
>            Reporter: Jenny Thompson
>            Priority: Minor
>              Labels: easyfix
>
> The exec function of ToString is written to handle 1 or 2 arguments (it 
> defaults to ISO, which is consistent with ToDate).
> However, the getArgToFuncMapping function returns only one FuncSpec, 
> requiring the formatString argument.
> To fix: just return add another FuncSpec to getArcToFuncMapping.



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to