# Query.jl - Return all columns with @map

**URL:** <https://discourse.julialang.org/t/query-jl-return-all-columns-with-map/11717>\
**Category:** Data\
**Tags:** question\
**Created:** [June 16, 2018, 2:21pm UTC](https://discourse.julialang.org/t/query-jl-return-all-columns-with-map/11717 "2018-06-16T14:21:26Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![joshualeond](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/joshualeond/32/230_2.png) [@joshualeond](https://discourse.julialang.org/u/joshualeond)\
**Post date:** [June 16, 2018, 2:21pm UTC](https://discourse.julialang.org/t/query-jl-return-all-columns-with-map/11717/1 "2018-06-16T14:21:26Z")

</div>

Hey there,

I recently watched @davidanthoff’s Queryverse tutorial and am giving Query.jl a go. I like the new pipe-able syntax as I’m a heavy user of dplyr. I see the `@map` macro would be similar to the `select` and `mutate` functions in dplyr. I was wondering though how to return all of the columns of a table after the `@map` macro? It looks like the macro only returns the columns I’ve selected or calculated. Looking at the Linq syntax in the documentation it looks like the `@let` macro is similar to what I’m looking for so I was curious how to do it with the new syntax.

---

<div class="post-metadata">

**Author:** ![davidanthoff](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/davidanthoff/32/223493_2.png) [@davidanthoff](https://discourse.julialang.org/u/davidanthoff)\
**Post date:** [June 17, 2018, 7:05pm UTC](https://discourse.julialang.org/t/query-jl-return-all-columns-with-map/11717/2 "2018-06-17T19:05:47Z")

</div>

There is currently no good story for that in [Query.jl](https://github.com/davidanthoff/Query.jl): you can either pass on all columns with simply `_`, but of course that is kind of pointless 😉 If you want to just manipulate say one column, you have to explicitly also select all the columns that you want to return, say as `@map({_.colA, _.colB, colC = _.colC*2, _.colD})` etc.

I have a complete design mapped out how to do this better, so that we can have more dplyr like functions for these situations. But, it requires julia 0.7 and the native named tuples, so that is why I haven’t added it so far. It will be one of the first new features I’ll add when I port things over to julia 0.7 (I’ve started with that recently).

---

<div class="post-metadata">

**Author:** ![jmboehm](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jmboehm/32/2263_2.png) [@jmboehm](https://discourse.julialang.org/u/jmboehm)\
**Post date:** [August 5, 2019, 6:19pm UTC](https://discourse.julialang.org/t/query-jl-return-all-columns-with-map/11717/3 "2019-08-05T18:19:43Z")

</div>

Sorry to revive this old topic-- if I understand correctly, this was solved with `@mutate`. But is there a way to do that for joins? i.e. something like

```julia
x = df1 |> @join(df2, _.a, _.c, {_.a, keys(__)}) |> DataFrame

```

---

<div class="post-metadata">

**Author:** ![davidanthoff](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/davidanthoff/32/223493_2.png) [@davidanthoff](https://discourse.julialang.org/u/davidanthoff)\
**Post date:** [August 5, 2019, 7:13pm UTC](https://discourse.julialang.org/t/query-jl-return-all-columns-with-map/11717/4 "2019-08-05T19:13:45Z")

</div>

Yes, you can now use splatting syntax inside `{}`, so you can just write the join part as

```julia
@join(df2, _.a, _.c, {_..., __...})

```

That will take all the columns from the first and the second table and combine them.
