You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "Sivaramakrishnan Narayanan (JIRA)" <ji...@apache.org> on 2014/11/26 05:21:12 UTC

[jira] [Commented] (CALCITE-403) Enumerable gives NullPointerException with NOT on nullable expression

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

Sivaramakrishnan Narayanan commented on CALCITE-403:
----------------------------------------------------

Julian - would the fix work for the following cases:

Select not x from foo (where x is nullable)
Select * from foo where not x is null (where x is nullable)

> Enumerable gives NullPointerException with NOT on nullable expression
> ---------------------------------------------------------------------
>
>                 Key: CALCITE-403
>                 URL: https://issues.apache.org/jira/browse/CALCITE-403
>             Project: Calcite
>          Issue Type: Bug
>            Reporter: Julian Hyde
>            Assignee: Julian Hyde
>              Labels: newbie
>             Fix For: 1.0.0-incubating
>
>
> Foodmart query #6597
> {code:sql}
> select "store"."store_country" as "c0",
>  "store"."store_state" as "c1",
>  "store"."store_city" as "c2",
>  "store"."store_name" as "c3",
>  "Store"."store_type" as "c4",
>  "store"."store_manager" as "c5",
>  "store"."store_sqft" as "c6",
>  "store"."grocery_sqft" as "c7",
>  "store"."frozen_sqft" as "c8",
>  "store"."meat_sqft" as "c9",
>  "store"."coffee_bar" as "c10",
>  "store"."store_street_address" as "c11"
> from "store" as "store"
> group by "store"."store_country",
>  "store"."store_state",
>  "store"."store_city",
>  "store"."store_name",
>  "store"."store_type",
>  "store"."store_manager",
>  "store"."store_sqft",
>  "store"."grocery_sqft",
>  "store"."frozen_sqft",
>  "store"."meat_sqft",
>  "store"."coffee_bar",
>  "store"."store_street_address"
> having NOT((((sum("store"."store_sqft") - sum("store"."grocery_sqft")) < 10000)) )
> order by "store"."store_country" ASC NULLS LAST,
>  "store"."store_state" ASC NULLS LAST,
>  "store"."store_city" ASC NULLS LAST,
>  "store"."store_name" ASC NULLS LAST
> {code}
> gives the following stack:
> {code}
> java.lang.NullPointerException
> 	at Baz$6$1.moveNext(Unknown Source)
> 	at net.hydromatic.optiq.runtime.ObjectEnumeratorCursor.next(ObjectEnumeratorCursor.java:43)
> 	at net.hydromatic.avatica.AvaticaResultSet.next(AvaticaResultSet.java:186)
> 	at net.hydromatic.optiq.test.OptiqAssert.countRows(OptiqAssert.java:493){code}
> More minimal test case:
> {code}
> select 1
> from "store"
> group by "store_street_address"
> having NOT (sum("grocery_sqft") < 10000)
> {code}



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