[
https://issues.apache.org/jira/browse/PIG-3014?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13491270#comment-13491270
]
Zhijie Shen commented on PIG-3014:
----------------------------------
Hi Jonathan,
thanks for correcting my error. According to you patch, I've also some comments.
As far as I know, getArgToFuncMapping() is called when generating the logic
plan, while exec() is called at runtime. Hence the DateTime object generated in
getArgToFuncMapping() reflects the timestamp when the pig latin statements are
parsed. If there's several statements containing CurrentTime(), the timestamps
will be similar. Please correct me if I'm wrong.
For example,
"
A = load 'justSomeRows' using mock.Storage();
B = foreach A generate *, CurrentTime();
......
C = foreach B generate *, CurrentTime();
"
In this case, there're a bunch of statements between B and C. In B, we want to
get the timestamp before executing the statements, while in C, want to get the
timestamp after executing them. The difference between the two timestamps
should reflect the runtime interval instead of the interval between parsing two
CurrentTime() UDFs.
I think the more accurate behavior of CurrentTime() should be generating a
unique timestamp for a statement when it is executed.
> 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
>
>
> 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