[jira] Commented: (PIG-1430) ISODateTime - DateTime: DateTime UDFs Should Also Support int/second Unix Times in All Operations

2010-07-12 Thread Alan Gates (JIRA)

[ 
https://issues.apache.org/jira/browse/PIG-1430?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=12887546#action_12887546
 ] 

Alan Gates commented on PIG-1430:
-

I think it's fine to start with just putting conversion functions into Pig 
Latin.  What I'd like to clarify though is what is the desired end state?  Does 
Pig eventually have a datetime type that does all the datetime stuff you can 
dream of (timezones, etc.)?  Or does Pig only ever have longs or strings to 
represent times and a set of functions to work with those?  Are you proposing 
that latter, or delaying the former in interest of getting something into 0.8?  

 ISODateTime - DateTime: DateTime UDFs Should Also Support int/second Unix 
 Times in All Operations
 --

 Key: PIG-1430
 URL: https://issues.apache.org/jira/browse/PIG-1430
 Project: Pig
  Issue Type: Improvement
  Components: impl
Affects Versions: 0.7.0
Reporter: Russell Jurney
 Fix For: 0.8.0


 All functions in 
 contrib.piggybank.java.src.main.java.org.apache.pig.piggybank.evaluation.datetime
  should seamlessly accept integer Unix/POSIX times, and return Unix time 
 output when given an int, and ISO output when given a chararray.
 Note: Unix/POSIX times are the number of seconds elapsed since midnight 
 proleptic Coordinated Universal Time (UTC) of January 1, 1970, not counting 
 leap seconds.  See http://en.wikipedia.org/wiki/Unix_time

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



[jira] Commented: (PIG-1430) ISODateTime - DateTime: DateTime UDFs Should Also Support int/second Unix Times in All Operations

2010-07-02 Thread Russell Jurney (JIRA)

[ 
https://issues.apache.org/jira/browse/PIG-1430?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=12884557#action_12884557
 ] 

Russell Jurney commented on PIG-1430:
-

I've been thinking about the feedback at the contributors meeting Monday. I 
propose that we postpone the addition of a full datetime PIG-1314 type in lieu 
of the builtins described below. This change is easy and I can do it 
immediately and get it in 0.8. The original proposal is quite hard, and I can't 
really estimate when I could have it completed. I'm not sure we need it. There 
are many other more important things I would rather do. 

I'd like to remove the piggybank classes 
org.apache.pig.piggybank.evaluation.datetime.* or at least deprecate them. 

I'd like to add the following builtins, which act on both ISO8601 datetime 
strings and long unix times. These could be made into many functions each, but 
I'd prefer to keep them as short as possible. I suggest we mirror the oracle 
date/time functions when possible: http://psoug.org/reference/date_func.html 

* Units 

When listed below, units are defined as one of: 

YEAR 
MONTH 
WEEK 
DAY 
HOUR 
MINUTE 
SECOND 

* Truncations 

TRUNC(date, unit) or TRUNC_DATE(date, unit) 

long/epoch input returns long/epoch output. 
ISO8601 string input returns IS08601 datetime output. 

* Dates to durations 

DURATION(date, unit) 

long/epoch input returns long output in the unit specified. 
ISO8601 input returns an ISO8601 duration 

* Adding/subtracting durations and dates: use longs. 

* Utilities 

CURRENT_ISOTIME 
CURRENT_UNIXTIME 
ISOTOUNIX 
UNIXTOISO 

The only ugly part to this is that ISO times are 2nd class citizens in that 
they cannot be added/subtracted. I'm prepared to live with that :)

 ISODateTime - DateTime: DateTime UDFs Should Also Support int/second Unix 
 Times in All Operations
 --

 Key: PIG-1430
 URL: https://issues.apache.org/jira/browse/PIG-1430
 Project: Pig
  Issue Type: Improvement
  Components: impl
Affects Versions: 0.7.0
Reporter: Russell Jurney
 Fix For: 0.8.0


 All functions in 
 contrib.piggybank.java.src.main.java.org.apache.pig.piggybank.evaluation.datetime
  should seamlessly accept integer Unix/POSIX times, and return Unix time 
 output when given an int, and ISO output when given a chararray.
 Note: Unix/POSIX times are the number of seconds elapsed since midnight 
 proleptic Coordinated Universal Time (UTC) of January 1, 1970, not counting 
 leap seconds.  See http://en.wikipedia.org/wiki/Unix_time

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



[jira] Commented: (PIG-1430) ISODateTime - DateTime: DateTime UDFs Should Also Support int/second Unix Times in All Operations

2010-05-28 Thread Russell Jurney (JIRA)

[ 
https://issues.apache.org/jira/browse/PIG-1430?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=12873217#action_12873217
 ] 

Russell Jurney commented on PIG-1430:
-

Actually, I think it should interpret int as unix time in seconds, and long as 
unix time in miliseconds.  Thoughts?

 ISODateTime - DateTime: DateTime UDFs Should Also Support int/second Unix 
 Times in All Operations
 --

 Key: PIG-1430
 URL: https://issues.apache.org/jira/browse/PIG-1430
 Project: Pig
  Issue Type: Improvement
  Components: impl
Affects Versions: 0.7.0
Reporter: Russell Jurney
 Fix For: 0.8.0


 All functions in 
 contrib.piggybank.java.src.main.java.org.apache.pig.piggybank.evaluation.datetime
  should seamlessly accept integer Unix/POSIX times, and return Unix time 
 output when given an int, and ISO output when given a chararray.
 Note: Unix/POSIX times are the number of seconds elapsed since midnight 
 proleptic Coordinated Universal Time (UTC) of January 1, 1970, not counting 
 leap seconds.  See http://en.wikipedia.org/wiki/Unix_time

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



[jira] Commented: (PIG-1430) ISODateTime - DateTime: DateTime UDFs Should Also Support int/second Unix Times in All Operations

2010-05-28 Thread Dmitriy V. Ryaboy (JIRA)

[ 
https://issues.apache.org/jira/browse/PIG-1430?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=12873232#action_12873232
 ] 

Dmitriy V. Ryaboy commented on PIG-1430:


I think int vs long doing different things is dangerous.

iirc ISO specifies to the second, so getting an int or a long should assume 
seconds.

I suggest implementing a duplicate set of functions for millisecond timestamps 
that actually have Ms in the name (and of course a set of sec to millisec and 
sec to millisec and both to ISO conversions :-).

-D

 ISODateTime - DateTime: DateTime UDFs Should Also Support int/second Unix 
 Times in All Operations
 --

 Key: PIG-1430
 URL: https://issues.apache.org/jira/browse/PIG-1430
 Project: Pig
  Issue Type: Improvement
  Components: impl
Affects Versions: 0.7.0
Reporter: Russell Jurney
 Fix For: 0.8.0


 All functions in 
 contrib.piggybank.java.src.main.java.org.apache.pig.piggybank.evaluation.datetime
  should seamlessly accept integer Unix/POSIX times, and return Unix time 
 output when given an int, and ISO output when given a chararray.
 Note: Unix/POSIX times are the number of seconds elapsed since midnight 
 proleptic Coordinated Universal Time (UTC) of January 1, 1970, not counting 
 leap seconds.  See http://en.wikipedia.org/wiki/Unix_time

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



[jira] Commented: (PIG-1430) ISODateTime - DateTime: DateTime UDFs Should Also Support int/second Unix Times in All Operations

2010-05-28 Thread Russell Jurney (JIRA)

[ 
https://issues.apache.org/jira/browse/PIG-1430?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=12873233#action_12873233
 ] 

Russell Jurney commented on PIG-1430:
-

Good idea, will do!

 ISODateTime - DateTime: DateTime UDFs Should Also Support int/second Unix 
 Times in All Operations
 --

 Key: PIG-1430
 URL: https://issues.apache.org/jira/browse/PIG-1430
 Project: Pig
  Issue Type: Improvement
  Components: impl
Affects Versions: 0.7.0
Reporter: Russell Jurney
 Fix For: 0.8.0


 All functions in 
 contrib.piggybank.java.src.main.java.org.apache.pig.piggybank.evaluation.datetime
  should seamlessly accept integer Unix/POSIX times, and return Unix time 
 output when given an int, and ISO output when given a chararray.
 Note: Unix/POSIX times are the number of seconds elapsed since midnight 
 proleptic Coordinated Universal Time (UTC) of January 1, 1970, not counting 
 leap seconds.  See http://en.wikipedia.org/wiki/Unix_time

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