| 1 |
plugin_register functions/string |
| 2 |
[[0,0.0,0.0],true] |
| 3 |
plugin_register functions/vector |
| 4 |
[[0,0.0,0.0],true] |
| 5 |
table_create Lexicon TABLE_PAT_KEY ShortText --normalizer NormalizerNFKC121 --default_tokenizer TokenNgram |
| 6 |
[[0,0.0,0.0],true] |
| 7 |
table_create Logs TABLE_HASH_KEY ShortText |
| 8 |
[[0,0.0,0.0],true] |
| 9 |
column_create Logs message COLUMN_SCALAR ShortText |
| 10 |
[[0,0.0,0.0],true] |
| 11 |
column_create Logs message_tokens COLUMN_VECTOR Lexicon |
| 12 |
[[0,0.0,0.0],true] |
| 13 |
load --table Logs |
| 14 |
[ |
| 15 |
{ |
| 16 |
"_key": "2015-02-03:1", |
| 17 |
"message": "Hello World", |
| 18 |
"message_tokens": ["Hello", "World"] |
| 19 |
}, |
| 20 |
{ |
| 21 |
"_key": "2015-02-03:2", |
| 22 |
"message": "Hello World" |
| 23 |
}, |
| 24 |
{ |
| 25 |
"_key": "2015-02-04:1", |
| 26 |
"message": "Good bye World" |
| 27 |
} |
| 28 |
] |
| 29 |
[[0,0.0,0.0],3] |
| 30 |
select Logs --filter "vector_size(message_tokens) == 0" --load_table Logs --load_columns "_key, message_tokens" --load_values "_key, string_tokenize(message, Lexicon, {\"mode\": \"ADD\"})" --limit 0 |
| 31 |
[ |
| 32 |
[ |
| 33 |
0, |
| 34 |
0.0, |
| 35 |
0.0 |
| 36 |
], |
| 37 |
[ |
| 38 |
[ |
| 39 |
[ |
| 40 |
2 |
| 41 |
], |
| 42 |
[ |
| 43 |
[ |
| 44 |
"_id", |
| 45 |
"UInt32" |
| 46 |
], |
| 47 |
[ |
| 48 |
"_key", |
| 49 |
"ShortText" |
| 50 |
], |
| 51 |
[ |
| 52 |
"message", |
| 53 |
"ShortText" |
| 54 |
], |
| 55 |
[ |
| 56 |
"message_tokens", |
| 57 |
"Lexicon" |
| 58 |
] |
| 59 |
] |
| 60 |
] |
| 61 |
] |
| 62 |
] |
| 63 |
#>select --filter "vector_size(message_tokens) == 0" --limit "0" --load_columns "_key, message_tokens" --load_table "Logs" --load_values "_key, string_tokenize(message, Lexicon, {\"mode\": \"ADD\"})" --table "Logs" |
| 64 |
#:000000000000000 filter(2): equal(vector_size(Logs.message_tokens), 0) |
| 65 |
#:000000000000000 select(2) |
| 66 |
#:000000000000000 load(2): [Logs][3] |
| 67 |
#:000000000000000 output(0) |
| 68 |
#:000000000000000 send(0) |
| 69 |
#<000000000000000 rc=0 |
| 70 |
select --table Logs |
| 71 |
[ |
| 72 |
[ |
| 73 |
0, |
| 74 |
0.0, |
| 75 |
0.0 |
| 76 |
], |
| 77 |
[ |
| 78 |
[ |
| 79 |
[ |
| 80 |
3 |
| 81 |
], |
| 82 |
[ |
| 83 |
[ |
| 84 |
"_id", |
| 85 |
"UInt32" |
| 86 |
], |
| 87 |
[ |
| 88 |
"_key", |
| 89 |
"ShortText" |
| 90 |
], |
| 91 |
[ |
| 92 |
"message", |
| 93 |
"ShortText" |
| 94 |
], |
| 95 |
[ |
| 96 |
"message_tokens", |
| 97 |
"Lexicon" |
| 98 |
] |
| 99 |
], |
| 100 |
[ |
| 101 |
1, |
| 102 |
"2015-02-03:1", |
| 103 |
"Hello World", |
| 104 |
[ |
| 105 |
"hello", |
| 106 |
"world" |
| 107 |
] |
| 108 |
], |
| 109 |
[ |
| 110 |
2, |
| 111 |
"2015-02-03:2", |
| 112 |
"Hello World", |
| 113 |
[ |
| 114 |
"hello", |
| 115 |
"world" |
| 116 |
] |
| 117 |
], |
| 118 |
[ |
| 119 |
3, |
| 120 |
"2015-02-04:1", |
| 121 |
"Good bye World", |
| 122 |
[ |
| 123 |
"good", |
| 124 |
"bye", |
| 125 |
"world" |
| 126 |
] |
| 127 |
] |
| 128 |
] |
| 129 |
] |
| 130 |
] |