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

Adam Szita commented on PIG-4748:
---------------------------------

[~rohini] I think this behaviour is consistent with what we have in trunk now:
{code}
grunt> cat fruits.csv
apple   1       red     1971-01-01T00:00:00.000+00:00
orange  2       orange  1972-01-01T00:00:00.000+00:00
kiwi    3       green   1973-01-01T00:00:00.000+01:00
orange  4       orange  1974-01-01T00:00:00.000
grunt> A = LOAD 'fruits.csv' as (name:chararray, id:int, fruit:chararray, 
fut:datetime);
grunt> dump A;
(apple,1,red,1971-01-01T00:00:00.000Z)
(orange,2,orange,1972-01-01T00:00:00.000Z)
(kiwi,3,green,1973-01-01T00:00:00.000+01:00)
(orange,4,orange,1974-01-01T00:00:00.000+01:00)
{code}
(On my US-based cluster I get (-07:00) for the last record using the same data 
and query)

> DateTimeWritable forgets Chronology
> -----------------------------------
>
>                 Key: PIG-4748
>                 URL: https://issues.apache.org/jira/browse/PIG-4748
>             Project: Pig
>          Issue Type: Bug
>          Components: impl
>    Affects Versions: 0.16.0
>            Reporter: Martin Junghanns
>            Assignee: Adam Szita
>             Fix For: 0.17.0
>
>         Attachments: PIG-4748.2.patch, PIG-4748.3.patch, PIG-4748.patch
>
>
> The following test fails:
> {code}
> @Test
> public void foo() throws IOException {
>     DateTime nowIn = DateTime.now();
>     DateTimeWritable in = new DateTimeWritable(nowIn);
>     ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
>     DataOutputStream dataOut = new DataOutputStream(outputStream);
>     in.write(dataOut);
>     dataOut.flush();
>     // read from byte[]
>     DateTimeWritable out = new DateTimeWritable();
>     ByteArrayInputStream inputStream = new ByteArrayInputStream(
>       outputStream.toByteArray());
>     DataInputStream dataIn = new DataInputStream(inputStream);
>     out.readFields(dataIn);
>     assertEquals(in.get(), out.get());
> }
> {code}
> In equals(), the original instance has
> {code}
> ISOChronology[Europe/Berlin]
> {code}
> while the deserialized instance has
> {code}
> ISOChronology[+01:00]
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Reply via email to