You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@drill.apache.org by Daniel Haviv <da...@gmail.com> on 2014/10/29 15:39:11 UTC

Querying JSON files on HDFS

Hi,
I can't find a tutorial explaining how to get started with Drill (besides
querying the sample data that comes with Drill).

I have some json data on HDFS that I would like to query, how do I query
these files ?
I know I need to do some configuration for Drill to know HDFS there is no
info about how to..

Thanks,
Daniel

Re: Querying JSON files on HDFS

Posted by Daniel Haviv <da...@gmail.com>.
Thank you

Daniel

> On 29 באוק׳ 2014, at 16:44, mufy <mu...@gmail.com> wrote:
> 
> You'll need to create a storage plugin for JSON as,
> 
> {
> "type": "file",
> "enabled": true,
> "connection": "hdfs:///",
> "workspaces": {
> "root": {
> "location": "/",
> "writable": false,
> "storageformat": "json"
> }
> },
> "formats": {
> "json": {
> "type": "json"
> }
> }
> }
> 
> And you should be able to query the file as shown below,
> 
> select count(1) from json.root.`sample.json`;
> 
> 
> Where sample.json will be your file on the HDFS.
> 
> 
> 
> 
> 
> ---
> Mufeed Usman
> My LinkedIn <http://www.linkedin.com/pub/mufeed-usman/28/254/400> | My
> Social Cause <http://www.vision2016.org.in/> | My Blogs : LiveJournal
> <http://mufeed.livejournal.com>
> 
> 
> 
> 
>> On Wed, Oct 29, 2014 at 8:09 PM, Daniel Haviv <da...@gmail.com> wrote:
>> 
>> Hi,
>> I can't find a tutorial explaining how to get started with Drill (besides
>> querying the sample data that comes with Drill).
>> 
>> I have some json data on HDFS that I would like to query, how do I query
>> these files ?
>> I know I need to do some configuration for Drill to know HDFS there is no
>> info about how to..
>> 
>> Thanks,
>> Daniel
>> 

Re: Querying JSON files on HDFS

Posted by Bob Rumsby <br...@maprtech.com>.
The Drill Tutorial is here:
https://cwiki.apache.org/confluence/display/DRILL/Apache+Drill+Tutorial

On Wed, Oct 29, 2014 at 7:44 AM, mufy <mu...@gmail.com> wrote:

> You'll need to create a storage plugin for JSON as,
>
> {
> "type": "file",
> "enabled": true,
> "connection": "hdfs:///",
> "workspaces": {
> "root": {
> "location": "/",
> "writable": false,
> "storageformat": "json"
> }
> },
> "formats": {
> "json": {
> "type": "json"
> }
> }
> }
>
> And you should be able to query the file as shown below,
>
> select count(1) from json.root.`sample.json`;
>
>
> Where sample.json will be your file on the HDFS.
>
>
>
>
>
> ---
> Mufeed Usman
> My LinkedIn <http://www.linkedin.com/pub/mufeed-usman/28/254/400> | My
> Social Cause <http://www.vision2016.org.in/> | My Blogs : LiveJournal
> <http://mufeed.livejournal.com>
>
>
>
>
> On Wed, Oct 29, 2014 at 8:09 PM, Daniel Haviv <da...@gmail.com>
> wrote:
>
> > Hi,
> > I can't find a tutorial explaining how to get started with Drill (besides
> > querying the sample data that comes with Drill).
> >
> > I have some json data on HDFS that I would like to query, how do I query
> > these files ?
> > I know I need to do some configuration for Drill to know HDFS there is no
> > info about how to..
> >
> > Thanks,
> > Daniel
> >
>

Re: Querying JSON files on HDFS

Posted by mufy <mu...@gmail.com>.
You'll need to create a storage plugin for JSON as,

{
"type": "file",
"enabled": true,
"connection": "hdfs:///",
"workspaces": {
"root": {
"location": "/",
"writable": false,
"storageformat": "json"
}
},
"formats": {
"json": {
"type": "json"
}
}
}

And you should be able to query the file as shown below,

select count(1) from json.root.`sample.json`;


Where sample.json will be your file on the HDFS.





---
Mufeed Usman
My LinkedIn <http://www.linkedin.com/pub/mufeed-usman/28/254/400> | My
Social Cause <http://www.vision2016.org.in/> | My Blogs : LiveJournal
<http://mufeed.livejournal.com>




On Wed, Oct 29, 2014 at 8:09 PM, Daniel Haviv <da...@gmail.com> wrote:

> Hi,
> I can't find a tutorial explaining how to get started with Drill (besides
> querying the sample data that comes with Drill).
>
> I have some json data on HDFS that I would like to query, how do I query
> these files ?
> I know I need to do some configuration for Drill to know HDFS there is no
> info about how to..
>
> Thanks,
> Daniel
>