pig-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Santhosh Srinivasan (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (PIG-1922) null is being treated as string constant in expressions
Date Mon, 21 Mar 2011 22:29:05 GMT

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

Santhosh Srinivasan commented on PIG-1922:
------------------------------------------

bq. Yes, an filter expression such as (col1 == col2) should not result in error if either
of them is null. But that does not mean that we need to support (col1 == null) in the syntax,
as it is unlikely that the user's intention is to get UNKOWN as the result.

SQL allows the use of = and != with NULL. The resulting value is UNKNOWN. Granted that we
don't have UNKNOWN today. Its something that we should think about for a few reasons:

1. SQL allows it (to use your argument :)
2. Bailing out with an error will surprise (existing) users.

> null is being treated as string constant in expressions
> -------------------------------------------------------
>
>                 Key: PIG-1922
>                 URL: https://issues.apache.org/jira/browse/PIG-1922
>             Project: Pig
>          Issue Type: Bug
>    Affects Versions: 0.8.0, 0.9.0
>            Reporter: Thejas M Nair
>             Fix For: 0.9.0
>
>
> In following statement, the null gets translated to string constant. The statement is
invalid, and should result in an error. 
> {code}
> fil = filter l by a != null; -- This does not give an error, the correct usage is "a
is not null"
> fil = filter l by a != adsf; -- this does give an error message saying that there is
no column asdf
> {code}

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message