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

Khurram Faraaz edited comment on DRILL-3562 at 3/31/17 9:32 AM:
----------------------------------------------------------------

[~arina] thanks for confirming. Verified that SQL reported in this JIRA returns 
correct results on Drill 1.11.0
Test added here framework/resources/Functional/json/json_storage/drill_3562.q

{noformat}
0: jdbc:drill:schema=dfs.tmp> select count(*) from (select FLATTEN(t.a.b.c) AS 
c from `empty_array.json` t) flat WHERE flat.c.d.e = 'f' ;
+---------+
| EXPR$0  |
+---------+
| 1       |
+---------+
1 row selected (0.241 seconds)
{noformat}


was (Author: khfaraaz):
[~arina] thanks for confirming. Verified that SQL reported in this JIRA returns 
correct results on Drill 1.10.0
Test added here framework/resources/Functional/json/json_storage/drill_3562.q

{noformat}
0: jdbc:drill:schema=dfs.tmp> select count(*) from (select FLATTEN(t.a.b.c) AS 
c from `empty_array.json` t) flat WHERE flat.c.d.e = 'f' ;
+---------+
| EXPR$0  |
+---------+
| 1       |
+---------+
1 row selected (0.241 seconds)
{noformat}

> Query fails when using flatten on JSON data where some documents have an 
> empty array
> ------------------------------------------------------------------------------------
>
>                 Key: DRILL-3562
>                 URL: https://issues.apache.org/jira/browse/DRILL-3562
>             Project: Apache Drill
>          Issue Type: Bug
>          Components: Storage - JSON
>    Affects Versions: 1.1.0
>            Reporter: Philip Deegan
>            Assignee: Serhii Harnyk
>             Fix For: 1.10.0
>
>
> Drill query fails when using flatten when some records contain an empty array 
> {noformat}
> SELECT COUNT(*) FROM (SELECT FLATTEN(t.a.b.c) AS c FROM dfs.`flat.json` t) 
> flat WHERE flat.c.d.e = 'f' limit 1;
> {noformat}
> Succeeds on 
> { "a": { "b": { "c": [  { "d": {  "e": "f" } } ] } } }
> Fails on
> { "a": { "b": { "c": [] } } }
> Error
> {noformat}
> Error: SYSTEM ERROR: ClassCastException: Cannot cast 
> org.apache.drill.exec.vector.NullableIntVector to 
> org.apache.drill.exec.vector.complex.RepeatedValueVector
> {noformat}
> Is it possible to ignore the empty arrays, or do they need to be populated 
> with dummy data?



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Reply via email to