You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pig.apache.org by "Daniel Dai (JIRA)" <ji...@apache.org> on 2015/11/04 08:27:27 UTC

[jira] [Commented] (PIG-4726) "Incompatable field schema" with MIN(datetime_field) and explicit output type

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

Daniel Dai commented on PIG-4726:
---------------------------------

The walk around is not declare type in AS subclause.

This might be some type checking error before Pig infer the right MIN implementation.

> "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)