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

Add blob support #211

Merged
merged 3 commits into from
Nov 30, 2016
Merged

Add blob support #211

merged 3 commits into from
Nov 30, 2016

Conversation

macintux
Copy link
Contributor

See basho/riak_kv#1540 for details.

@@ -111,6 +112,7 @@ message TsCell {
optional sint64 timestamp_value = 3;
optional bool boolean_value = 4;
optional double double_value = 5;
optional bytes blob_value = 6;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did talk to @lukebakken a while back about putting the blob data into the varchar column to avoid an extra record field per row, did that have problems?

@@ -111,6 +112,7 @@ message TsCell {
optional sint64 timestamp_value = 3;
optional bool boolean_value = 4;
optional double double_value = 5;
optional bytes blob_value = 6;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will definitely need an upgrade/downgrade test, with the added flag with queries, we might be in a position where the clients can't handle upgraded messages from TS because of this change and TS can't handle upgraded client messages because of the new flag on the query message.

@macintux
Copy link
Contributor Author

That's a typical situation with the clients. I wasn't aware of the discussion to overload the existing varchar field, will investigate.

Sent from my iPad

On Nov 21, 2016, at 6:23 AM, Andy Till notifications@github.com wrote:

@andytill commented on this pull request.

In src/riak_ts.proto:

@@ -111,6 +112,7 @@ message TsCell {
optional sint64 timestamp_value = 3;
optional bool boolean_value = 4;
optional double double_value = 5;

  • optional bytes blob_value = 6;
    This will definitely need an upgrade/downgrade test, with the added flag with queries, we might be in a position where the clients can't handle upgraded messages from TS because of this change and TS can't handle upgraded client messages because of the new flag on the query message.


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or mute the thread.

@andytill
Copy link
Contributor

@macintux ah damn, I thought I'd sent you the email chain, will resend.

@macintux
Copy link
Contributor Author

You did send it to me, just forgot about it.

One significant downside to removing the blob option in PB: riak-shell uses the column type to decide to display the data as hex instead of a string. Unclear there's a good alternative.

/cc @alexmoore who's starting the client side of all this

@andytill
Copy link
Contributor

My initial plan was to have a new enum value for blob like there is here and if the type is varchar or blob, pull the value from the varchar field of the TsCell message.

@macintux
Copy link
Contributor Author

Gotcha, will look again, thanks.

@macintux
Copy link
Contributor Author

Reviewing the code, I've realized I completely missed making important changes to riak_pb_ts_codec.erl, yet riak-shell works fine. Curious.

@andytill
Copy link
Contributor

It could be because it uses the ttb encoder which doesn't require any changes because it just runs term_to_binary/1 on whatever it is given.

@alexmoore
Copy link
Contributor

alexmoore commented Nov 21, 2016

riak_pb_ts_codec.erl would need a change to add the blob the column types definition, and then that would trickle down to encode_cell, or anywhere else tscolumntype() is referenced.

https://github.com/basho/riak_pb/blob/develop/src/riak_pb_ts_codec.erl#L55

The response wouldn't change much for a TTB message though, it'd just now have blob included in the columnDescriptions list:

{ tsqueryresp,
   {
      [<<"geohash">>,<<"user">>,<<"time">>,<<"weather">>,<<"temperature">>,<<"uv_index">>,<<"observed">>,<<"sensor_data">>],
      [varchar,varchar,timestamp,varchar,double,sint64,boolean,blob],
      [
         {<<"hash1">>,<<"user2">>,1443806600000,<<"cloudy">>,[],[],true,<<0,1,2,3,4,5,6,7>>}
      ]
   }
}

@lukebakken
Copy link
Contributor

@macintux re-using varchar means the existing client libs won't have to change.

* Stuff `blob` values into the `varchar` field in `tscell`.
* Add `blob` to column type handling (it'll still be in column headers).
@andytill
Copy link
Contributor

+1 7e6260d

borshop added a commit that referenced this pull request Nov 30, 2016
Add blob support

Reviewed-by: andytill
@macintux macintux merged commit 2278151 into develop Nov 30, 2016
@macintux
Copy link
Contributor Author

Ok, Bors has left the building. YOLOmerging

@hazen hazen deleted the feature_jrd_blob-type branch November 30, 2016 21:33
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

Successfully merging this pull request may close these issues.

5 participants