Skip to content
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

Floats (Doubles) Not Supported #1

Open
pulltab opened this issue May 3, 2014 · 1 comment
Open

Floats (Doubles) Not Supported #1

pulltab opened this issue May 3, 2014 · 1 comment

Comments

@pulltab
Copy link

pulltab commented May 3, 2014

After extending examples/voltkv in the open source voltdb distribution to use strings as the primary key and double types as the value I attempted to store a value as follows:

crypto:start(), application:start(erlvolt).
erlvolt:add_pool(kv, [{"localhost", 21212}]).
erlvolt:call_procedure(kv, "Put", [{9, <<"key">>}, {8, 9.99}]).

This resulted in the following deserialization error:

{result,{voltresponse,{0,
                       <<0,0,53,0,0,0,0,0>>,
                       -2,
                       <<"Exception while deserializing procedure params, procedure=Put\njava.lang.RuntimeExcep"...>>,
                       128,<<>>,<<>>,10},
                      []}}

I then attempted to store the key/value as follows:

crypto:start(), application:start(erlvolt).
erlvolt:add_pool(kv, [{"localhost", 21212}]).
erlvolt:call_procedure(kv, "Put", ["key", 9.99]).

Which resulted in:

\///////////////////////////////////////////////////////////////////////////////////
///   <0.49.0> | ###  ERROR: [wire level] Procedure call failed: error, {missing_parameter_type,9.99}
###                           Call: "Put" ["key",9.99]
###                           Call ID: <<0,0,53,0,0,0,0,0>>
###                           Conn id: {1399,89586,365790}
###                           Socket: #Port<0.3812>.
///                   Process: <0.49.0>
///                   Trace: [{erlvolt_wire,volt_parameter,1,
                                  [{file,"src/erlvolt_wire.erl"},{line,2428}]},
                              {erlvolt_wire,'-volt_parameters/1-lc$^0/1-0-',
                                  1,
                                  [{file,"src/erlvolt_wire.erl"},{line,2399}]},
                              {erlvolt_wire,'-volt_parameters/1-lc$^0/1-0-',
                                  1,
                                  [{file,"src/erlvolt_wire.erl"},{line,2399}]},
                              {erlvolt_wire,volt_parameters,1,
                                  [{file,"src/erlvolt_wire.erl"},{line,2399}]},
                              {erlvolt_wire,volt_invoke,3,
                                  [{file,"src/erlvolt_wire.erl"},{line,2338}]},
                              {erlvolt_wire,call_procedure,5,
                                  [{file,"src/erlvolt_wire.erl"},{line,2323}]},
                              {erlvolt_conn,tx_loop,2,
                                  [{file,"src/erlvolt_conn.erl"},{line,189}]}]
////////////////////////////////////////////////////////////////////////////////////

=ERROR REPORT==== 2-May-2014::21:00:04 ===
Error in process <0.49.0> with exit value: {{nocatch,{erlvolt_asynch_proc_call_failed,{error,{missing_parameter_type,9.990000e+00},{1399,89586,365790},#Port<0.3812>,"Put",["key",9.990000e+00],<<8 bytes>>}}},[{erlvolt_wire,call_procedure,5,[{file,"src/erlvolt_wire.erl"},{line,2329}]},{erlvolt_conn,tx_loop,2,[{file,"src/erlvolt_... 
@pulltab
Copy link
Author

pulltab commented May 3, 2014

voltdb's wire protocol supports only 64 bit double values.

Increasing float binary representations to 64 bits seems to resolve this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant