Skip to content

Commit 6518d50

Browse files
authored
Merge pull request #31 from queryverse/issue29
minimum and maximum
2 parents 61ff8c1 + 5b9bece commit 6518d50

4 files changed

Lines changed: 7 additions & 3 deletions

File tree

src/QuerySQLite.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
module QuerySQLite
22

33
import Base: !, &, |, ==, !=, *, /, +, -, %, abs, Char, coalesce, collect, convert, eltype, getproperty, length,
4-
lowercase, in, isdone, isequal, isless, ismissing, iterate, IteratorSize, join, max, min,
4+
lowercase, in, isdone, isequal, isless, ismissing, iterate, IteratorSize, join, max, min, maximum, minimum,
55
occursin, rand, replace, repr, round, show, showerror, startswith, string, strip, SubString, uppercase
66
using Base: Generator, NamedTuple, RefValue, SizeUnknown, tail
77
using Base.Meta: quot

src/code_instead.jl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,10 +201,12 @@ end
201201
@code_instead QueryOperators.join SourceCode SourceCode Any Expr Any Expr Any Expr
202202

203203
@code_instead max SourceCode Vararg{Any}
204+
@code_instead maximum SourceCode
204205

205206
@code_instead mean SourceCode
206207

207208
@code_instead min SourceCode Vararg{Any}
209+
@code_instead minimum SourceCode
208210

209211
@code_instead length SourceCode
210212

src/translate.jl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,10 +186,12 @@ function translate_call(::typeof(QueryOperators.map), select_table, call, call_e
186186
end
187187

188188
@translate_default ::typeof(max) :max
189+
@translate_default ::typeof(maximum) :max
189190

190191
@translate_default ::typeof(mean) :AVG
191192

192193
@translate_default ::typeof(min) :min
194+
@translate_default ::typeof(minimum) :min
193195

194196
translate_call(::typeof(occursin), needle, haystack; _primary = true) =
195197
SQLExpression(

test/runtests.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,8 @@ group_by_row =
8585
AlbumId = key(_),
8686
length = length(_.AlbumId),
8787
sum = sum(_.Milliseconds),
88-
min = min(_.Milliseconds),
89-
max = max(_.Milliseconds),
88+
min = minimum(_.Milliseconds),
89+
max = maximum(_.Milliseconds),
9090
mean = mean(_.Milliseconds)
9191
}) |>
9292
collect |>

0 commit comments

Comments
 (0)