Created
          May 28, 2014 02:45 
        
      - 
      
- 
        Save jsanda/1fce253d835e8be08e8a to your computer and use it in GitHub Desktop. 
    tags with UDTs
  
        
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | 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