# Unexpected behavior of Query.jl @map

**URL:** <https://discourse.julialang.org/t/unexpected-behavior-of-query-jl-map/10474>\
**Category:** Data\
**Tags:** query\
**Created:** [April 21, 2018, 11:27pm UTC](https://discourse.julialang.org/t/unexpected-behavior-of-query-jl-map/10474 "2018-04-21T23:27:35Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![SebastianM-C](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/sebastianm-c/32/2480_2.png) [@SebastianM-C](https://discourse.julialang.org/u/SebastianM-C)\
**Post date:** [April 21, 2018, 11:27pm UTC](https://discourse.julialang.org/t/unexpected-behavior-of-query-jl-map/10474/1 "2018-04-21T23:27:35Z")

</div>

I tried to call a function for each selected row with Query.jl with the following code:

```julia
test = DataFrame()
test[:a] = [1,2,3,4]
test[:b] = [1,1,2,3]
test |> @filter(_.b==1) |> @map(println(_.a))

```

and I noticed that in Juno and in the REPL the function is evaluated more than once for each value as the console output is

```julia
julia> 1
2
1
2

```

for Juno and

```julia
julia> test |> @filter(_.b==1) |> @map(println(_.a))
?-element query result
1
 1nothing

2
2
 nothing

```

for the REPL. Beside the fact that I did not expect the function to be evaluated more than once per value I noticed that in Jupyter it seems that it is evaluated only once per value:

 ![Sketch](https://global.discourse-cdn.com/julialang/original/3X/d/9/d9df1c001584381a7502ecf2e6e58cf67372f2ff.jpeg)

Is this behavior intended?
