pig-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From roh...@apache.org
Subject svn commit: r1819354 - in /pig/trunk: CHANGES.txt src/org/apache/pig/builtin/ToDate3ARGS.java test/org/apache/pig/test/TestBuiltin.java
Date Wed, 27 Dec 2017 19:10:10 GMT
Author: rohini
Date: Wed Dec 27 19:10:10 2017
New Revision: 1819354

URL: http://svn.apache.org/viewvc?rev=1819354&view=rev
Log:
PIG-3864: ToDate(userstring, format, timezone) computes DateTime with strange handling of
Daylight Saving Time with location based timezones (daijy via rohini)

Modified:
    pig/trunk/CHANGES.txt
    pig/trunk/src/org/apache/pig/builtin/ToDate3ARGS.java
    pig/trunk/test/org/apache/pig/test/TestBuiltin.java

Modified: pig/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/pig/trunk/CHANGES.txt?rev=1819354&r1=1819353&r2=1819354&view=diff
==============================================================================
--- pig/trunk/CHANGES.txt (original)
+++ pig/trunk/CHANGES.txt Wed Dec 27 19:10:10 2017
@@ -59,6 +59,9 @@ PIG-5251: Bump joda-time to 2.9.9 (dbist
 OPTIMIZATIONS
  
 BUG FIXES
+
+PIG-3864: ToDate(userstring, format, timezone) computes DateTime with strange handling of
Daylight Saving Time with location based timezones (daijy via rohini)
+
 PIG-5312: Uids not set in inner schemas after UNION ONSCHEMA (tmwoodruff via knoguchi)
 
 PIG-5300: hashCode for Bag needs to be order independent (knoguchi)

Modified: pig/trunk/src/org/apache/pig/builtin/ToDate3ARGS.java
URL: http://svn.apache.org/viewvc/pig/trunk/src/org/apache/pig/builtin/ToDate3ARGS.java?rev=1819354&r1=1819353&r2=1819354&view=diff
==============================================================================
--- pig/trunk/src/org/apache/pig/builtin/ToDate3ARGS.java (original)
+++ pig/trunk/src/org/apache/pig/builtin/ToDate3ARGS.java Wed Dec 27 19:10:10 2017
@@ -39,8 +39,7 @@ public class ToDate3ARGS extends EvalFun
         }
         DateTimeFormatter dtf = DateTimeFormat.forPattern(DataType
                 .toString(input.get(1)));
-        DateTimeZone dtz = DateTimeZone.forOffsetMillis(DateTimeZone.forID(
-                DataType.toString(input.get(2))).getOffset(null));
+        DateTimeZone dtz = DateTimeZone.forID(DataType.toString(input.get(2)));
         return dtf.withZone(dtz).parseDateTime(DataType.toString(input.get(0)));
     }
 

Modified: pig/trunk/test/org/apache/pig/test/TestBuiltin.java
URL: http://svn.apache.org/viewvc/pig/trunk/test/org/apache/pig/test/TestBuiltin.java?rev=1819354&r1=1819353&r2=1819354&view=diff
==============================================================================
--- pig/trunk/test/org/apache/pig/test/TestBuiltin.java (original)
+++ pig/trunk/test/org/apache/pig/test/TestBuiltin.java Wed Dec 27 19:10:10 2017
@@ -533,9 +533,16 @@ public class TestBuiltin {
         ToMilliSeconds func7 = new ToMilliSeconds();
         Tuple t13 = TupleFactory.getInstance().newTuple(1);
         t13.set(0, new DateTime(1231290421000L));
-        Long ut2 = func7.exec(t11);
+        Long ut2 = func7.exec(t13);
         assertEquals(ut2.longValue(), 1231290421000L);
 
+        Tuple t14 = TupleFactory.getInstance().newTuple(3);
+        t14.set(0, "2014-02-02 18:00:00.000Z");
+        t14.set(1, "yyyy-MM-dd HH:mm:ss.SSSZ");
+        t14.set(2, "Europe/Berlin");
+        DateTime dt8 = func4.exec(t14);
+        assertEquals(dt8.toString(), "2014-02-02T19:00:00.000+01:00");
+
         // Null handling
         t1.set(0, null);
         assertEquals(func1.exec(t1), null);



Mime
View raw message