-
Notifications
You must be signed in to change notification settings - Fork 236
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Prepare internal API for shared use between PB and WM callbacks [1/3] #1396
Conversation
with tweaks to decode_query_permissions return value per dialyzer hints.
* use provided human descriptions for compiler errors instead of forcing {MnemonicAtom, Description} through "~p" into #rpberrresp.errmsg; * handle lexer errors (they are signalled via {'EXIT', {Msg, Stacktrace}}, so make sure ony Msg is reported to the client.
after the maps and other not-simple field types were removed from riak_ql.
@@ -118,8 +257,10 @@ maybe_await_query_results(_) -> | |||
% we can't use a gen_server call here because the reply needs to be | |||
% from an fsm but one is not assigned if the query is queued. | |||
receive | |||
Result -> | |||
Result | |||
{ok, Result} -> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are simply guarding against bad results? For proper responses, this should be the same.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's dialyzer wisperings. Because this function returns whatever it receives, dialyzer has no way of knowing what the return type would be. By constraining the terms on reception to only be one of {ok, Result}
or {error, Reason}
, we give dialyzer a useful hint.
This ensures that both TTB and PB versions of riakc_ts:query get the same {ok, {[], []}} on empty result set.
@@ -87,3 +87,9 @@ | |||
["The '", ParamName, "' parameter is part the primary key, and must have an ", | |||
"equals clause in the query but the ", atom_to_list(Op), " operator was used."]) | |||
). | |||
|
|||
-define( | |||
E_TOO_MANY_SUBQUERIES(N), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why have this as a macro instead of a function? Looks like it's only called in one place anyway.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm following the local conventions here (alternatively, following the path of least resistance).
@hmmr Looks like these are required, too, right? |
@javajolt All eventually required, yes. In particular, basho/riak_pb#190 is required for #1397, and so also is basho/riak-erlang-client#277. The r_t one uses emended error messages, and is therefore needed for #1396. My recommendation is to merge the riak_pb PR first, then erlang-client, then proceed with this one. |
Here are explanation of failures:
|
|
|
👍 169492a |
What's the "seventy" code for Amen? |
This is Part 1/3 of #1382 broken up and reassembled into new commits.
After the merge of TTB branch, and in anticipation of the merge of HTTP API branch, this PR proposes a code reorg consisting of the following steps:
get_data
,put_data
,delete_data
,query
andcompile_to_per_quantum_queries
(used to produce coverage results, withriak_kv_ts_util:sql_to_cover
) into the newly created moduleriak_kv_ts_api
. These will constitute the TS internal API.riak_kv_ts_svc
intoriak_kv_qry
. Now the call toriak_kv_qry:submit("INSERT ...")
will actually take effect (previously, the 'submit' part was a no-op while all the validations, conversions and the eventual call ofriak_kv_ts_util:put_data
happened as a side effect).