2022-07-27 00:24:29 +00:00
-- test String Functions --
-- Customers |where Education contains \'degree\'
Latoya Shen Professional Graduate Degree 25
Peter Nara Skilled Manual Graduate Degree 26
-- Customers |where Education !contains \'degree\'
\N why Professional Partial College 38
Theodore Diaz Skilled Manual Bachelors 28
Stephanie Cox Management abcd defg Bachelors 33
Apple Skilled Manual Bachelors 28
-- Customers |where Education contains \'Degree\'
Latoya Shen Professional Graduate Degree 25
Peter Nara Skilled Manual Graduate Degree 26
-- Customers |where Education !contains \'Degree\'
\N why Professional Partial College 38
Theodore Diaz Skilled Manual Bachelors 28
Stephanie Cox Management abcd defg Bachelors 33
Apple Skilled Manual Bachelors 28
-- Customers | where FirstName endswith \'RE\'
Theodore Diaz Skilled Manual Bachelors 28
-- Customers | where ! FirstName endswith \'RE\'
Latoya Shen Professional Graduate Degree 25
Peter Nara Skilled Manual Graduate Degree 26
Stephanie Cox Management abcd defg Bachelors 33
Apple Skilled Manual Bachelors 28
--Customers | where FirstName endswith_cs \'re\'
Theodore Diaz Skilled Manual Bachelors 28
-- Customers | where FirstName !endswith_cs \'re\'
Latoya Shen Professional Graduate Degree 25
Peter Nara Skilled Manual Graduate Degree 26
Stephanie Cox Management abcd defg Bachelors 33
Apple Skilled Manual Bachelors 28
-- Customers | where Occupation == \'Skilled Manual\'
Peter Nara Skilled Manual Graduate Degree 26
Theodore Diaz Skilled Manual Bachelors 28
Apple Skilled Manual Bachelors 28
-- Customers | where Occupation != \'Skilled Manual\'
\N why Professional Partial College 38
Latoya Shen Professional Graduate Degree 25
Stephanie Cox Management abcd defg Bachelors 33
-- Customers | where Occupation has \'skilled\'
Peter Nara Skilled Manual Graduate Degree 26
Theodore Diaz Skilled Manual Bachelors 28
Apple Skilled Manual Bachelors 28
-- Customers | where Occupation !has \'skilled\'
\N why Professional Partial College 38
Latoya Shen Professional Graduate Degree 25
Stephanie Cox Management abcd defg Bachelors 33
-- Customers | where Occupation has \'Skilled\'
Peter Nara Skilled Manual Graduate Degree 26
Theodore Diaz Skilled Manual Bachelors 28
Apple Skilled Manual Bachelors 28
-- Customers | where Occupation !has \'Skilled\'
\N why Professional Partial College 38
Latoya Shen Professional Graduate Degree 25
Stephanie Cox Management abcd defg Bachelors 33
-- Customers | where Occupation hasprefix_cs \'Ab\'
-- Customers | where Occupation !hasprefix_cs \'Ab\'
\N why Professional Partial College 38
Latoya Shen Professional Graduate Degree 25
Peter Nara Skilled Manual Graduate Degree 26
Theodore Diaz Skilled Manual Bachelors 28
Stephanie Cox Management abcd defg Bachelors 33
Apple Skilled Manual Bachelors 28
-- Customers | where Occupation hasprefix_cs \'ab\'
Stephanie Cox Management abcd defg Bachelors 33
-- Customers | where Occupation !hasprefix_cs \'ab\'
\N why Professional Partial College 38
Latoya Shen Professional Graduate Degree 25
Peter Nara Skilled Manual Graduate Degree 26
Theodore Diaz Skilled Manual Bachelors 28
Apple Skilled Manual Bachelors 28
-- Customers | where Occupation hassuffix \'Ent\'
Stephanie Cox Management abcd defg Bachelors 33
-- Customers | where Occupation !hassuffix \'Ent\'
\N why Professional Partial College 38
Latoya Shen Professional Graduate Degree 25
Peter Nara Skilled Manual Graduate Degree 26
Theodore Diaz Skilled Manual Bachelors 28
Apple Skilled Manual Bachelors 28
-- Customers | where Occupation hassuffix \'ent\'
Stephanie Cox Management abcd defg Bachelors 33
-- Customers | where Occupation hassuffix \'ent\'
Stephanie Cox Management abcd defg Bachelors 33
-- Customers |where Education in (\'Bachelors\',\'High School\')
Theodore Diaz Skilled Manual Bachelors 28
Stephanie Cox Management abcd defg Bachelors 33
Apple Skilled Manual Bachelors 28
-- Customers | where Education !in (\'Bachelors\',\'High School\')
\N why Professional Partial College 38
Latoya Shen Professional Graduate Degree 25
Peter Nara Skilled Manual Graduate Degree 26
-- Customers | where FirstName matches regex \'P.*r\'
Peter Nara Skilled Manual Graduate Degree 26
-- Customers | where FirstName startswith \'pet\'
Peter Nara Skilled Manual Graduate Degree 26
-- Customers | where FirstName !startswith \'pet\'
Latoya Shen Professional Graduate Degree 25
Theodore Diaz Skilled Manual Bachelors 28
Stephanie Cox Management abcd defg Bachelors 33
Apple Skilled Manual Bachelors 28
-- Customers | where FirstName startswith_cs \'pet\'
-- Customers | where FirstName !startswith_cs \'pet\'
Latoya Shen Professional Graduate Degree 25
Peter Nara Skilled Manual Graduate Degree 26
Theodore Diaz Skilled Manual Bachelors 28
Stephanie Cox Management abcd defg Bachelors 33
Apple Skilled Manual Bachelors 28
-- Customers | where isempty(LastName)
Apple Skilled Manual Bachelors 28
-- Customers | where isnotempty(LastName)
Theodore Diaz Skilled Manual Bachelors 28
Stephanie Cox Management abcd defg Bachelors 33
Peter Nara Skilled Manual Graduate Degree 26
Latoya Shen Professional Graduate Degree 25
\N why Professional Partial College 38
-- Customers | where isnotnull(FirstName)
Latoya Shen Professional Graduate Degree 25
Peter Nara Skilled Manual Graduate Degree 26
Theodore Diaz Skilled Manual Bachelors 28
Stephanie Cox Management abcd defg Bachelors 33
Apple Skilled Manual Bachelors 28
-- Customers | where isnull(FirstName)
\N why Professional Partial College 38
-- Customers | project url_decode(\'https%3A%2F%2Fwww.test.com%2Fhello%20word\') | take 1
https://www.test.com/hello word
-- Customers | project url_encode(\'https://www.test.com/hello word\') | take 1
https%3A%2F%2Fwww.test.com%2Fhello%20word
-- Customers | project name_abbr = strcat(substring(FirstName,0,3), \' \', substring(LastName,2))
2022-10-10 05:44:38 +00:00
\N
Lat en
Pet ra
The az
Ste x
App
2022-07-27 00:24:29 +00:00
-- Customers | project name = strcat(FirstName, \' \', LastName)
\N
Latoya Shen
Peter Nara
Theodore Diaz
Stephanie Cox
Apple
-- Customers | project FirstName, strlen(FirstName)
\N \N
Latoya 6
Peter 5
Theodore 8
Stephanie 9
Apple 5
-- Customers | project strrep(FirstName,2,\'_\')
\N
Latoya_Latoya
Peter_Peter
Theodore_Theodore
Stephanie_Stephanie
Apple_Apple
-- Customers | project toupper(FirstName)
\N
LATOYA
PETER
THEODORE
STEPHANIE
APPLE
-- Customers | project tolower(FirstName)
\N
latoya
peter
theodore
stephanie
apple
-- support subquery for in orerator (https://docs.microsoft.com/en-us/azure/data-explorer/kusto/query/in-cs-operator) (subquery need to be wraped with bracket inside bracket); TODO: case-insensitive not supported yet
Latoya Shen Professional Graduate Degree 25
Peter Nara Skilled Manual Graduate Degree 26
Theodore Diaz Skilled Manual Bachelors 28
Apple Skilled Manual Bachelors 28
-- has_all (https://docs.microsoft.com/en-us/azure/data-explorer/kusto/query/has-all-operator); TODO: subquery not supported yet
Peter Nara Skilled Manual Graduate Degree 26
Theodore Diaz Skilled Manual Bachelors 28
Apple Skilled Manual Bachelors 28
-- has_any (https://docs.microsoft.com/en-us/azure/data-explorer/kusto/query/has-anyoperator); TODO: subquery not supported yet
Theodore Diaz Skilled Manual Bachelors 28
Stephanie Cox Management abcd defg Bachelors 33
Peter Nara Skilled Manual Graduate Degree 26
Apple Skilled Manual Bachelors 28
-- countof (https://docs.microsoft.com/en-us/azure/data-explorer/kusto/query/countoffunction)
3
3
1
-- extract ( https://docs.microsoft.com/en-us/azure/data-explorer/kusto/query/extractfunction)
PINEAPPLE ice cream is 20
PINEAPPLE
20
20
2022-09-28 14:30:20 +00:00
\N
\N
\N
\N
\N
45.6
45.6
2022-07-27 00:24:29 +00:00
-- extract_all (https://docs.microsoft.com/en-us/azure/data-explorer/kusto/query/extractallfunction); TODO: captureGroups not supported yet
[['T','h','e'],['p','ric','e'],['P','INEAPPL','E'],['i','c','e'],['c','rea','m']]
2022-09-30 18:32:16 +00:00
-- extract_json (https://learn.microsoft.com/en-us/azure/data-explorer/kusto/query/extractjsonfunction)
John
iPhone
\N
26
26
26
26
\N
2022-07-27 00:24:29 +00:00
-- split (https://docs.microsoft.com/en-us/azure/data-explorer/kusto/query/splitfunction)
['aa','bb']
['bbb']
['']
['a','','b']
['aa','cc']
2022-10-05 18:39:31 +00:00
['aabbcc']
['aaa','bbb','ccc']
[NULL]
2022-07-27 00:24:29 +00:00
-- strcat_delim (https://docs.microsoft.com/en-us/azure/data-explorer/kusto/query/strcat-delimfunction); TODO: only support string now.
1-2-Ab
-- indexof (https://docs.microsoft.com/en-us/azure/data-explorer/kusto/query/indexoffunction); TODO: length and occurrence not supported yet
2
2
-1
2022-08-12 16:34:03 +00:00
-- base64_encode_fromguid()
2022-11-24 20:53:21 +00:00
8jMxriJurkmwahbmqbIS6w==
2022-08-12 16:34:03 +00:00
-- base64_decode_toarray()
2022-11-24 20:53:21 +00:00
[]
2022-08-12 16:34:03 +00:00
[75,117,115,116,111]
-- base64_decode_toguid()
2022-11-24 20:53:21 +00:00
10e99626-bc2b-4c75-bb3e-fe606de25700
2022-08-12 16:34:03 +00:00
1
2022-11-24 20:53:21 +00:00
-- base64_encode_tostring
S3VzdG8x
-- base64_decode_tostring
Kusto1
2022-08-12 16:34:03 +00:00
-- parse_url()
{"Scheme":"scheme","Host":"","Port":"0","Path":"/this/is/a/path","Username":"username","Password":"password","Query Parameters":{"k1":"v1","k2":"v2"},"Fragment":"fragment"}
-- parse_urlquery()
{"Query Parameters":{"k1":"v1","k2":"v2","k3":"v3"}}
-- strcmp()
0 1 -1 1
2022-10-07 02:38:18 +00:00
-- substring()
CD
2022-08-12 16:34:03 +00:00
-- translate()
kusto xxx
-- trim()
https://www.ibm.com
2022-08-15 21:12:04 +00:00
Te st1
2022-09-12 23:12:34 +00:00
asd
asd
sd
2022-08-12 16:34:03 +00:00
-- trim_start()
www.ibm.com
Te st1// $
2022-09-12 23:12:34 +00:00
asdw
asd
2022-08-12 16:34:03 +00:00
-- trim_end()
https
2022-08-15 21:12:04 +00:00
- Te st1
2022-09-12 23:12:34 +00:00
wasd
asd
2022-09-16 15:42:04 +00:00
-- trim, trim_start, trim_end all at once
--https://bing.com-- -- https://bing.com-- --https://bing.com https://bing.com
2022-08-12 16:34:03 +00:00
-- replace_regex
Number was: 1
-- has_any_index()
0 1 -1 -1
2022-09-28 03:33:20 +00:00
-- parse_version()
1000000020000000300000040
1000000020000000000000000
2022-09-30 18:32:16 +00:00
1000000020000000000000000
2022-10-03 13:15:12 +00:00
\N
\N
\N
\N
2022-09-28 03:33:20 +00:00
1000000020000000300000004
1000000020000000000000000
1000000020000000300000000
1000000000000000000000000
-- parse_json()
[1,2,3]
[{"a":123.5,"b":"{\\"c\\":456}"}]
2022-09-30 18:32:16 +00:00
-- parse_command_line()
2022-10-03 17:53:23 +00:00
[NULL]
[NULL]
2022-09-28 03:33:20 +00:00
-- reverse()
321
43.321
2022-09-30 18:32:16 +00:00
dsa
][
]3,2,1[
]\'redaV\',\'htraD\'[
000000000.00:00:21 51-01-7102
Peter Nara Skilled Manual Graduate Degree 26
Latoya Shen Professional Graduate Degree 25
2022-09-28 03:33:20 +00:00
-- parse_csv()
2022-10-03 17:53:23 +00:00
['']
2022-09-30 18:32:16 +00:00
['aaa']
2022-09-28 03:33:20 +00:00
['aa','b','cc']
['record1','a','b','c']