PageRenderTime 9ms CodeModel.GetById 7ms app.highlight 0ms RepoModel.GetById 1ms app.codeStats 0ms

/tags/release-0.0.0-rc0/hive/external/ql/src/test/queries/clientpositive/udf_find_in_set.q

#
text | 23 lines | 19 code | 4 blank | 0 comment | 0 complexity | e79a9381626b612710d69d98c370535b MD5 | raw file
 1DESCRIBE FUNCTION find_in_set;
 2DESCRIBE FUNCTION EXTENDED find_in_set; 
 3
 4EXPLAIN
 5FROM src1 SELECT find_in_set(src1.key,concat(src1.key,',',src1.value));
 6
 7FROM src1 SELECT find_in_set(src1.key,concat(src1.key,',',src1.value));
 8
 9SELECT find_in_set('ab','ab,abc,abcde') FROM src1 LIMIT 1;
10SELECT find_in_set('ab','abc,ab,bbb') FROM src1 LIMIT 1;
11SELECT find_in_set('ab','def,abc,ab') FROM src1 LIMIT 1;
12SELECT find_in_set('ab','abc,abd,abf') FROM src1 LIMIT 1;
13SELECT find_in_set(null,'a,b,c') FROM src1 LIMIT 1;
14SELECT find_in_set('a',null) FROM src1 LIMIT 1;
15SELECT find_in_set('', '') FROM src1 LIMIT 1;
16SELECT find_in_set('',',') FROM src1 LIMIT 1;
17SELECT find_in_set('','a,,b') FROM src1 LIMIT 1;
18SELECT find_in_set('','a,b,') FROM src1 LIMIT 1;
19SELECT find_in_set(',','a,b,d,') FROM src1 LIMIT 1;
20SELECT find_in_set('a','') FROM src1 LIMIT 1;
21SELECT find_in_set('a,','a,b,c,d') FROM src1 LIMIT 1;
22
23SELECT * FROM src1 WHERE NOT find_in_set(key,'311,128,345,2,956')=0;