Re: Query a field with empty list

2015-11-02 Thread Hsuan Yi Chu
There could be inconsistent results: https://issues.apache.org/jira/browse/DRILL-4007 On Mon, Nov 2, 2015 at 8:17 AM, Andries Engelbrecht < aengelbre...@maprtech.com> wrote: > Currently in 1.2 I observe the following. > > 0: jdbc:drill:> select a from dfs.json.`/test.json`; > +---+ > | a

Re: Query a field with empty list

2015-11-02 Thread Andries Engelbrecht
Currently in 1.2 I observe the following. 0: jdbc:drill:> select a from dfs.json.`/test.json`; +---+ | a | +---+ | null | +———+ But then flatten produces an error 0: jdbc:drill:> select flatten(a) from dfs.json.`/test.json`; Error: SYSTEM ERROR: ClassCastException: Cannot cast

Re: Query a field with empty list

2015-11-02 Thread Jinfeng Ni
Sounds to me that FLATTEN over an empty list NULL should produce 0 row. That's actually the behavior of UNNEST of empty array, or NULL, in Postgres. Unless we have a strong reason that FLATTEN should behavior differently than UNNEST, I think it makes sense for FLATTEN to produce 0 row over empty

Re: Query a field with empty list

2015-11-02 Thread Andries Engelbrecht
Seems empty list is getting the vote for select. For consistency would it then make sense to have flatten produce a single row with an empty list in the result? —Andries > On Nov 2, 2015, at 12:55 PM, Neeraja Rentachintala > wrote: > > Empty list sounds like