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

Cheolsoo Park commented on PIG-3014:
------------------------------------

Here is how I ended up fixing the test with hadoop-2.0.x:

from
{code:title=MapReduceLauncher.java}
for (Job job : jc.getWaitingJobs()) {
    job.getJobConf().set("pig.script.submitted.timestamp", 
Long.toString(scriptSubmittedTimestamp));
    job.getJobConf().set("pig.job.submitted.timestamp", 
Long.toString(System.currentTimeMillis()));
}
{code}
to
{code:title=MapReduceLauncher.java}
for (Job job : jc.getWaitingJobs()) {
    JobConf jobConfCopy = job.getJobConf();
    jobConfCopy.set("pig.script.submitted.timestamp", 
Long.toString(scriptSubmittedTimestamp));
    jobConfCopy.set("pig.job.submitted.timestamp", 
Long.toString(System.currentTimeMillis()));
    job.setJobConf(jobConfCopy);
}
{code}
Apparently, {{job.getJobConf()}} returns a different JobConf object each time, 
so properties that are set by {{job.getJobConf().set()}} do not last at all.

This is quite surprising to me because this means that there are many other 
properties that are not properly set with hadoop-2.0.x now. I will open another 
jira to get this issue fixed.
                
> CurrentTime() UDF has undesirable characteristics
> -------------------------------------------------
>
>                 Key: PIG-3014
>                 URL: https://issues.apache.org/jira/browse/PIG-3014
>             Project: Pig
>          Issue Type: Bug
>            Reporter: Jonathan Coveney
>            Assignee: Jonathan Coveney
>             Fix For: 0.12
>
>         Attachments: PIG-3014-0.patch, PIG-3014-1.patch
>
>
> As part of the explanation of the new DateTime datatype I noticed that we had 
> added a CurrentTime() UDF. The issue with this UDF is that it returns the 
> current time _of every exec invocation_, which can lead to confusing results. 
> In PIG-1431 I proposed a way such that every instance of the same NOW() will 
> return the same time, which I think is better. Would enjoy thoughts.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to