Check out the FLATTEN function:
https://cwiki.apache.org/confluence/display/DRILL/FLATTEN+Function

On Wed, Apr 29, 2015 at 11:44 PM, Mohit Kaushik <[email protected]>
wrote:

> I have a json file in HDFS named autom.json contains.
> {
>   "company": [
>     {
>       "modelName": {
>         "name": "abc"
>       }
>     },
>     {
>       "modelName": {
>         "name": "xyz"
>       }
>     }
>   ]
> }
> When i query
> select t.company.`modelName`  from hdfs.`autom.json` t ;
> it gives result
> {"name":"abc"}
> However, The expected result was both entries.
> {"name":"abc"}
> {"name":"xyz"}
> Even when I query
> select t.company.`modelName`  from hdfs.`autom.json` t where
> t.company.`modelName`.`name`='xyz' ;
> it does not find anything.
>
>
>

Reply via email to