Nathan Smith created PIG-4726:
---------------------------------

             Summary: "Incompatable field schema" with MIN(datetime_field) and 
explicit output type
                 Key: PIG-4726
                 URL: https://issues.apache.org/jira/browse/PIG-4726
             Project: Pig
          Issue Type: Bug
    Affects Versions: 0.15.0
            Reporter: Nathan Smith
            Priority: Minor


Example:

{code}
grunt> data = LOAD 'file.csv' USING PigStorage(',') AS 
(f1:chararray,f2:datetime);
grunt> earliest_datum = FOREACH (GROUP data ALL) GENERATE MIN(data.f2);
grunt> earliest_datum = FOREACH (GROUP data ALL) GENERATE MIN(data.f2) AS 
earliest;
grunt> describe earliest_datum;
earliest_datum: {earliest: datetime}
grunt> earliest_datum = FOREACH (GROUP data ALL) GENERATE MIN(data.f2) AS 
earliest:datetime;
2015-11-03 23:20:00,422 [main] ERROR org.apache.pig.tools.grunt.Grunt - ERROR 
1031: Incompatable field schema: declared is "earliest:datetime", infered is 
":double"
grunt> earliest_datum = FOREACH (GROUP data ALL) GENERATE MIN(data.f2) AS 
earliest:double;
2015-11-03 23:20:07,454 [main] ERROR org.apache.pig.tools.grunt.Grunt - ERROR 
1031: Incompatable field schema: declared is "earliest:double", infered is 
":datetime"
{code}

The example is contrived, but applying MIN to other field types in the same 
fashion seems to behave as expected.

Also affects MAX.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to