You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@drill.apache.org by Vinay Bhat <vb...@maprtech.com> on 2015/04/14 00:50:36 UTC

Drill - Querying MongoDB

One of our customer is trying to query MongoDB with Drill and have issues
with reading date filed where data type shows up in the value.


This is how lastModified data looks in MongoDB.



[image: Inline image 2]


But when they query the data through sqlline or Drill Explorer, the output
is





Is there a way we can parse or cast that column to just provide the value
itself rather than the data type as well.



Thanks
*Vinay Bhat *
Solution Architect | MapR Technologies | vbhat@maprtech.com | 1-510-304-2990

  <http://www.mapr.com/>

Now Available - Free Hadoop On-Demand Training
<http://www.mapr.com/training?utm_source=Email&utm_medium=Signature&utm_campaign=Free%20available>

Re: Drill - Querying MongoDB

Posted by Jacques Nadeau <ja...@apache.org>.
Note that this should work transparently once my patch for DRILL-2695 goes
in as it adds support for native extended json.  (This also means Drill
will correctly identify the type as date.)

On Mon, Apr 13, 2015 at 4:13 PM, Andries Engelbrecht <
aengelbrecht@maprtech.com> wrote:

> Try to use the returned value as a map.
>
> select foo.field.`$date` from mongodb.table as foo;
>
> If you can try, send a link to the attachments stored somewhere. The
> mailing list does not handle attachments.
>
> —Andries
>
>
> On Apr 13, 2015, at 3:50 PM, Vinay Bhat <vb...@maprtech.com> wrote:
>
> > One of our customer is trying to query MongoDB with Drill and have
> issues with reading date filed where data type shows up in the value.
> >
> >
> >
> > This is how lastModified data looks in MongoDB.
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> > But when they query the data through sqlline or Drill Explorer, the
> output is
> >
> >
> >
> >
> >
> >
> >
> >
> > Is there a way we can parse or cast that column to just provide the
> value itself rather than the data type as well.
> >
> >
> >
> >
> > Thanks
> >
> > Vinay Bhat
> > Solution Architect | MapR Technologies | vbhat@maprtech.com |
> 1-510-304-2990
> >
> >
> > Now Available - Free Hadoop On-Demand Training
> >
> >
> >
>
>

Re: Drill - Querying MongoDB

Posted by Andries Engelbrecht <ae...@maprtech.com>.
Try to use the returned value as a map.

select foo.field.`$date` from mongodb.table as foo;

If you can try, send a link to the attachments stored somewhere. The mailing list does not handle attachments.

—Andries


On Apr 13, 2015, at 3:50 PM, Vinay Bhat <vb...@maprtech.com> wrote:

> One of our customer is trying to query MongoDB with Drill and have issues with reading date filed where data type shows up in the value.
> 
> 
> 
> This is how lastModified data looks in MongoDB. 
> 
>  
> 
> 
> 
> 
>  
> 
> 
> 
> But when they query the data through sqlline or Drill Explorer, the output is
> 
>  
> 
> 
> 
> 
>  
> 
> Is there a way we can parse or cast that column to just provide the value itself rather than the data type as well.
> 
>  
> 
> 
> Thanks  
> 
> Vinay Bhat 
> Solution Architect | MapR Technologies | vbhat@maprtech.com | 1-510-304-2990
>  
> 
> Now Available - Free Hadoop On-Demand Training
> 
> 
>