Commit 779fc543 authored by Heinz N. Gies's avatar Heinz N. Gies

dialyzer updates

parent c14c6aff
......@@ -12,9 +12,24 @@
-export([prepare/1, run/1, run/2, error_string/1, init/0]).
-type query_reply() :: [{Name :: binary(),
Data :: binary(),
Resolution :: pos_integer()}].
-type metric_reply() :: #{
name => binary(),
type => metrics,
resolution => pos_integer(),
metadata => maps:map(),
data => binary()
}.
-type event_reply() :: #{
name => binary(),
type => events,
resolution => pos_integer(),
data => binary()
}.
-type reply_element() :: metric_reply() | event_reply().
-type query_reply() :: [reply_element()].
-type query_error() :: {'error', 'no_results' |
'significant_figures' |
......@@ -290,7 +305,8 @@ extract_gets(#{op := get, args := [_, _,_, B, M]}) ->
%%
%% @end
%%--------------------------------------------------------------------
-spec translate(DQLTerm :: dql:query_part() | dql:dqe_fun()) ->
-spec translate(DQLTerm :: dql:query_part() | dql:dqe_fun()
| dql:event_getter()) ->
{ok, pos_integer(), dflow:step()}.
translate(#{op := events, times := [Start, End],
args := #{bucket := Bucket, filter := Filter}}) ->
......
......@@ -4,7 +4,8 @@
-ignore_xref([parse/1]).
-export_type([query_part/0, dqe_fun/0, query_stmt/0, get_stmt/0, flat_stmt/0,
statement/0, named/0, time/0, raw_query/0, limit/0]).
statement/0, named/0, time/0, raw_query/0, limit/0,
event_getter/0, dqe_fun_writh_return/0, return/0]).
-type time_unit() :: ms | s | m | h | d | w.
......@@ -23,6 +24,17 @@
-type sig_element() :: string | number | metric.
-type event_filter() :: term().
-type return() :: events | metric | time.
-type event_getter() :: #{
return => events,
op => events,
times => list(),
args => #{
bucket => binary(),
filter => event_filter()
}
}.
-type dqe_fun() ::
#{
op => fcall,
......@@ -30,6 +42,14 @@
args => #{}
}.
-type dqe_fun_writh_return() ::
#{
return => return(),
op => fcall,
signature => [sig_element()],
args => #{}
}.
-type get_stmt() ::
#{op => get, args => [[binary()] | non_neg_integer()]} |
#{op => sget, args => [[binary() | '*'] | non_neg_integer()]}.
......@@ -50,8 +70,11 @@
-type flat_stmt() ::
{calc, [dqe_fun()], flat_terminal() | get_stmt()}.
-type named() :: #{op => named, args => [binary() | {binary(), term()} |
flat_stmt()]}.
-type named() :: #{op => named,
return => dql:return(),
signature => [sig_element()],
args => [binary() | {binary(), term()} |
flat_stmt()]}.
-type query_stmt() :: {named, binary(), [{binary(), binary()}], flat_stmt()}.
......
......@@ -13,8 +13,8 @@
flatten(Qs) ->
[flatten_(Q) || Q <- Qs].
-spec flatten_(dql:dqe_fun() | dql:get_stmt()) ->
#{op => named, args => [binary() | dql:flat_stmt()]}.
-spec flatten_(dql:dqe_fun_writh_return() | dql:statement()) ->
dql:named().
flatten_(#{op := named, args := [undefined, M, Child]}) ->
N = dql_unparse:unparse(Child),
......@@ -46,7 +46,7 @@ flatten_(Child = #{return := R}) ->
return => R
}.
-spec flatten_(dql:statement(), [dql:dqe_fun()]) ->
-spec flatten_(dql:dqe_fun_writh_return() | dql:statement(), [dql:dqe_fun()]) ->
dql:flat_stmt().
flatten_(#{op := timeshift, args := [Time, Child]}, Chain) ->
C = flatten_(Child, Chain),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment