December 2018
Beginner to intermediate
500 pages
12h 10m
English
You might've noticed in the previous screenshots that the type of the returned value was query result. A query will return an iterator that can be further used to loop over the individual elements of the result set. But we can use the @collect statement to materialize the result into a specific data structure, most commonly Array or DataFrame. This is shown as follows:
julia> @from p in shopping_list begin
@select { PRODUCE = uppercase(p.produce), double_qty = 2p.qty }
@collect
end
We get the following:

By default, @collect will produce an Array of NamedTuple elements. But we can pass it an extra argument for the data type we desire: ...
Read now
Unlock full access