drill-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andries Engelbrecht <aengelbre...@maprtech.com>
Subject Re: Query a field with empty list
Date Mon, 02 Nov 2015 21:09:25 GMT
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 <nrentachintala@maprtech.com>
wrote:
> 
> Empty list sounds like the appropriate thing.
> What would be the result of we do flatten on this list?
> I think user should get a row back in the results.
> 
> 
> 
> On Mon, Nov 2, 2015 at 11:53 AM, Hsuan Yi Chu <hyichu@maprtech.com> wrote:
> 
>> I agree. I think in any context, empty list should appear as [] in the
>> result.
>> 
>> Any opposition?
>> 
>> On Mon, Nov 2, 2015 at 11:50 AM, Zelaine Fong <zfong@maprtech.com> wrote:
>> 
>>> Wouldn't it make more sense to return an empty list in this case?  Null
>> is
>>> not quite the same as an empty list.  So, I would think you'd want a
>>> distinction between the two.
>>> 
>>> -- Zelaine
>>> 
>>> On Mon, Nov 2, 2015 at 11:41 AM, Hsuan Yi Chu <hyichu@maprtech.com>
>> wrote:
>>> 
>>>> There could be inconsistent results:
>>>> https://issues.apache.org/jira/browse/DRILL-4007
>>>> 
>>>> On Mon, Nov 2, 2015 at 8:17 AM, Andries Engelbrecht <
>>>> aengelbrecht@maprtech.com> wrote:
>>>> 
>>>>> 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
>>>>> org.apache.drill.exec.vector.NullableIntVector to
>>>>> org.apache.drill.exec.vector.complex.RepeatedValueVector
>>>>> 
>>>>> Ideally both should return similar responses, in most cases it may be
>>>>> easier to work with a null being returned than no record or an empty
>>>>> string. Returning [] might be interpreted as a string data type
>> pending
>>>>> user experience or tools being used??
>>>>> 
>>>>> —Andries
>>>>> 
>>>>> 
>>>>> 
>>>>>> On Oct 31, 2015, at 4:44 PM, Hsuan Yi Chu <hyichu@maprtech.com>
>>> wrote:
>>>>>> 
>>>>>> Hi,
>>>>>> For example, say, we are querying a field with empty list:
>>>>>> 
>>>>>> select a from `XXX,json`
>>>>>> 
>>>>>> {
>>>>>> a: []
>>>>>> }
>>>>>> 
>>>>>> What is the expected result in the sqlline? Which one of the
>>> following
>>>>>> should it be?
>>>>>> 
>>>>>> 1. []
>>>>>> 2. null
>>>>>> 3. no record
>>>>>> 
>>>>>> Thanks.
>>>>> 
>>>>> 
>>>> 
>>> 
>> 


Mime
View raw message