Skip to content

Instantly share code, notes, and snippets.

@jsanda
Created May 28, 2014 02:45
Show Gist options
  • Save jsanda/1fce253d835e8be08e8a to your computer and use it in GitHub Desktop.
Save jsanda/1fce253d835e8be08e8a to your computer and use it in GitHub Desktop.
tags with UDTs
CREATE TYPE data_point (time timestamp, value map<int, double>);
CREATE TABLE tags (
tag_name text,
tag_value text,
metric_id text,
values list<data_point>,
PRIMARY KEY (tag_name, tag_value, metric_id)
);
INSERT INTO tags (tag_name, tag_value, metric_id, values) VALUES (
'test',
'one',
'foo',
[
{time: '2014-05-21 22:16:27-0400', value: {0: 1.23}},
{time: 2014-05-21 22:20:00-0400', value: {0: 2.22}}
]
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment