You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@drill.apache.org by Wang Darrell <da...@gmail.com> on 2015/03/26 09:46:31 UTC

mongodb query all return with * problem

Hi there

When query mongo like

select  *  from mongo.test.`zips` limit 20

it return ,

+------------+
|     *      |
+------------+
| { "city" : "AGAWAM" , "loc" : [ -72.622739 , 42.070206] , "pop" : 15338.0
, "state" : "MA"} |
| { "city" : "BARRE" , "loc" : [ -72.108354 , 42.409698] , "pop" : 4546.0 ,
"state" : "MA"} |
| { "city" : "BELCHERTOWN" , "loc" : [ -72.410953 , 42.275103] , "pop" :
10579.0 , "state" : "MA"} |
| { "city" : "BLANDFORD" , "loc" : [ -72.936114 , 42.182949] , "pop" :
1240.0 , "state" : "MA"} |
| { "city" : "BRIMFIELD" , "loc" : [ -72.188455 , 42.116543] , "pop" :
3706.0 , "state" : "MA"} |
| { "city" : "CHESTER" , "loc" : [ -72.988761 , 42.279421] , "pop" : 1688.0
, "state" : "MA"} |
| { "city" : "CHESTERFIELD" , "loc" : [ -72.833309 , 42.38167] , "pop" :
177.0 , "state" : "MA"} |
| { "city" : "CHICOPEE" , "loc" : [ -72.607962 , 42.162046] , "pop" :
23396.0 , "state" : "MA"} |
| { "city" : "CHICOPEE" , "loc" : [ -72.576142 , 42.176443] , "pop" :
31495.0 , "state" : "MA"} |
| { "city" : "WESTOVER AFB" , "loc" : [ -72.558657 , 42.196672] , "pop" :
1764.0 , "state" : "MA"} |
+------------+

Is there any way that it can return all the fields but not " * " ?
like this

|    city    |    loc     |    pop     |   state    |
+------------+------------+------------+------------+
| AGAWAM     | [-72.622739,42.070206] | 15338.0    | MA         |
| BARRE      | [-72.108354,42.409698] | 4546.0     | MA         |
| BELCHERTOWN | [-72.410953,42.275103] | 10579.0    | MA         |

or Can I query all the field in the collection first ?

Thanks you all in advanced.

Re: mongodb query all return with * problem

Posted by Jinfeng Ni <ji...@gmail.com>.
This seems to have been fixed in Drill's master branch, in
https://issues.apache.org/jira/browse/DRILL-1692#

Which version of Drill are you using?

On Thu, Mar 26, 2015 at 1:46 AM, Wang Darrell <da...@gmail.com>
wrote:

> Hi there
>
> When query mongo like
>
> select  *  from mongo.test.`zips` limit 20
>
> it return ,
>
> +------------+
> |     *      |
> +------------+
> | { "city" : "AGAWAM" , "loc" : [ -72.622739 , 42.070206] , "pop" : 15338.0
> , "state" : "MA"} |
> | { "city" : "BARRE" , "loc" : [ -72.108354 , 42.409698] , "pop" : 4546.0 ,
> "state" : "MA"} |
> | { "city" : "BELCHERTOWN" , "loc" : [ -72.410953 , 42.275103] , "pop" :
> 10579.0 , "state" : "MA"} |
> | { "city" : "BLANDFORD" , "loc" : [ -72.936114 , 42.182949] , "pop" :
> 1240.0 , "state" : "MA"} |
> | { "city" : "BRIMFIELD" , "loc" : [ -72.188455 , 42.116543] , "pop" :
> 3706.0 , "state" : "MA"} |
> | { "city" : "CHESTER" , "loc" : [ -72.988761 , 42.279421] , "pop" : 1688.0
> , "state" : "MA"} |
> | { "city" : "CHESTERFIELD" , "loc" : [ -72.833309 , 42.38167] , "pop" :
> 177.0 , "state" : "MA"} |
> | { "city" : "CHICOPEE" , "loc" : [ -72.607962 , 42.162046] , "pop" :
> 23396.0 , "state" : "MA"} |
> | { "city" : "CHICOPEE" , "loc" : [ -72.576142 , 42.176443] , "pop" :
> 31495.0 , "state" : "MA"} |
> | { "city" : "WESTOVER AFB" , "loc" : [ -72.558657 , 42.196672] , "pop" :
> 1764.0 , "state" : "MA"} |
> +------------+
>
> Is there any way that it can return all the fields but not " * " ?
> like this
>
> |    city    |    loc     |    pop     |   state    |
> +------------+------------+------------+------------+
> | AGAWAM     | [-72.622739,42.070206] | 15338.0    | MA         |
> | BARRE      | [-72.108354,42.409698] | 4546.0     | MA         |
> | BELCHERTOWN | [-72.410953,42.275103] | 10579.0    | MA         |
>
> or Can I query all the field in the collection first ?
>
> Thanks you all in advanced.
>