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

Rohini Palaniswamy commented on PIG-4748:
-----------------------------------------

[~szita],

Couple of questions:
  1) When will zone id be -1 ? When user specifies just offset?
  2) Why not do writeShort for offset as before?
   
Comments:
1) Can you move the config from PigConfiguration to PigImplConstants which is 
for configs used internally for implementation purposes.
2) availableZoneIDs.size() > 0 check is redundant in availableZoneIDs != null 
&& availableZoneIDs.size() > 0
3) Does it work with Tez e2e? Currently it is only set in the vertex conf which 
will only be available to PigProcessor and not available to the PigInputFormat 
or PigOutputFormat which will actually be deserializing the input or 
serializing it as output. I would suggest adding it to UDFContext instead like 
a UDF does. That will take care of compressing the setting as well so that it 
occupies less space.
4) testDateTimeZoneOnCluster - Please validate the value of DateTime objects as 
well. You can use Util.checkQueryOutputsAfterSort for comparing exact values 
with a expected list.
5) Can you move testDateTimeWritables from TestDataModel.java to 
TestDateTime.java?
5) Can you move tests from TestDefaultDateTimeZone.java into TestDateTime.java 
and delete TestDefaultDateTimeZone.java? Each new test class is fork of a new 
jvm which makes the tests take more time. So wherever possible would be good to 
avoid creating a new class.



> 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.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