# Query.jl: "type UnionAll has no field parameters"

**URL:** <https://discourse.julialang.org/t/query-jl-type-unionall-has-no-field-parameters/7673>\
**Category:** General Usage\
**Tags:** query\
**Created:** [December 10, 2017, 3:52pm UTC](https://discourse.julialang.org/t/query-jl-type-unionall-has-no-field-parameters/7673 "2017-12-10T15:52:33Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![IljaK91](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/iljak91/32/44301_2.png) [@IljaK91](https://discourse.julialang.org/u/IljaK91)\
**Post date:** [December 10, 2017, 3:52pm UTC](https://discourse.julialang.org/t/query-jl-type-unionall-has-no-field-parameters/7673/1 "2017-12-10T15:52:33Z")

</div>

I am playing around with Query.jl. I have a big dataset with many observations per day. I would like to group the observations together by observation date and then compute mean and variance of one indicator. I use the following code for the mean:

```julia
x = @from i in df
    @where Dates.year.(i.Date)>=2011
    @group i by i.Date into g
    @select {Date=g.key, mean=mean(g..compound)}
    @collect DataFrame
end

```

And it works perfectly fine. In contrast, trying to do the same with the variance:

```julia
x = @from i in df begin
    @where Dates.year.(i.Date)>=2011
    @group i by i.Date into g
    @select {Date=g.key, var=var(g..compound)}
    @collect DataFrame
end

```

Throws the following error:

```julia
type UnionAll has no field parameters
in collect at Query\src\sinks\sink_type.jl:2
in DataFrames.DataFrame at IterableTables\src\integrations\dataframes-dataarray.jl:127
in _DataFrame at IterableTables\src\integrations\dataframes-dataarray.jl:105
in column_types at TableTraits\src\utilities.jl:20 <inlined>

```

Does anybody know what this is about?

Edit: I get the same error for

```julia
x = @from i in df begin
    @where Dates.year.(i.Date)>=2011
    @group i by i.Date into g
    @select {Date=g.key, q80=quantile(g..compound,0.80)}
    @collect DataFrame
end

```

---

<div class="post-metadata">

**Author:** ![ssfrr](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ssfrr/32/3736_2.png) [@ssfrr](https://discourse.julialang.org/u/ssfrr)\
**Post date:** [December 10, 2017, 9:25pm UTC](https://discourse.julialang.org/t/query-jl-type-unionall-has-no-field-parameters/7673/2 "2017-12-10T21:25:58Z")

</div>

Possibly related to [this bug](https://github.com/JuliaLang/julia/issues/20872) in `Base`. Some discussion [here](https://github.com/JunoLab/Atom.jl/issues/90) where it popped up in the Junoverse.
