diff --git a/tests/queries/0_stateless/02366_kql_datatype.reference b/tests/queries/0_stateless/02366_kql_datatype.reference index 138a53b33e9..d9ec946ecb1 100644 --- a/tests/queries/0_stateless/02366_kql_datatype.reference +++ b/tests/queries/0_stateless/02366_kql_datatype.reference @@ -34,6 +34,7 @@ inf 6e-9 6e-7 172800 +259200 -- guid \N -- timespan (time) diff --git a/tests/queries/0_stateless/02366_kql_datatype.sql b/tests/queries/0_stateless/02366_kql_datatype.sql index 4a465a63989..1bb8599ae2b 100644 --- a/tests/queries/0_stateless/02366_kql_datatype.sql +++ b/tests/queries/0_stateless/02366_kql_datatype.sql @@ -39,6 +39,7 @@ print time(-1d); print time(6nanoseconds); print time(6tick); print time(2); +print time(2) + 1d; print '-- guid' print guid(74be27de-1e4e-49d9-b579-fe0b331d3642); print guid(null); diff --git a/tests/queries/0_stateless/02366_kql_func_datetime.reference b/tests/queries/0_stateless/02366_kql_func_datetime.reference index e3173b935a3..27668293b3b 100644 --- a/tests/queries/0_stateless/02366_kql_func_datetime.reference +++ b/tests/queries/0_stateless/02366_kql_func_datetime.reference @@ -40,6 +40,8 @@ 2018-12-31 23:59:59.999999000 -- unixtime_seconds_todatetime() 2019-01-01 00:00:00.000000000 +1970-01-02 00:00:00.000000000 +1969-12-31 00:00:00.000000000 -- unixtime_microseconds_todatetime 2019-01-01 00:00:00.000000 -- unixtime_milliseconds_todatetime() diff --git a/tests/queries/0_stateless/02366_kql_func_datetime.sql b/tests/queries/0_stateless/02366_kql_func_datetime.sql index 07d201567e7..6a6bdb97382 100644 --- a/tests/queries/0_stateless/02366_kql_func_datetime.sql +++ b/tests/queries/0_stateless/02366_kql_func_datetime.sql @@ -42,6 +42,8 @@ print endofyear(datetime(2017-01-01 10:10:17), -1); print endofyear(datetime(2017-01-01 10:10:17), 1); print '-- unixtime_seconds_todatetime()'; print unixtime_seconds_todatetime(1546300800); +print unixtime_seconds_todatetime(1d); +print unixtime_seconds_todatetime(-1d); print '-- unixtime_microseconds_todatetime'; print unixtime_microseconds_todatetime(1546300800000000); print '-- unixtime_milliseconds_todatetime()'; diff --git a/tests/queries/0_stateless/02366_kql_func_dynamic.reference b/tests/queries/0_stateless/02366_kql_func_dynamic.reference index d262b9d0610..9386ea92b24 100644 --- a/tests/queries/0_stateless/02366_kql_func_dynamic.reference +++ b/tests/queries/0_stateless/02366_kql_func_dynamic.reference @@ -1,3 +1,5 @@ +-- constant index value +1 c ['A',NULL,'C'] -- array_length() 1 1 @@ -107,6 +109,7 @@ nan [86400,86400,86400] [true,true,true] [NULL] +[NULL] -- set_difference() [] [] diff --git a/tests/queries/0_stateless/02366_kql_func_dynamic.sql b/tests/queries/0_stateless/02366_kql_func_dynamic.sql index 283e52f8562..ec5746a12bf 100644 --- a/tests/queries/0_stateless/02366_kql_func_dynamic.sql +++ b/tests/queries/0_stateless/02366_kql_func_dynamic.sql @@ -1,4 +1,12 @@ +DROP TABLE IF EXISTS array_test; +CREATE TABLE array_test (floats Array(Float64), + strings Array(String), + nullable_strings Array(Nullable(String)) + ) ENGINE=Memory; +INSERT INTO array_test VALUES([1.0, 2.5], ['a', 'c'], ['A', NULL, 'C']); set dialect = 'kusto'; +print '-- constant index value'; +array_test | project floats[0], strings[1], nullable_strings; print '-- array_length()'; print array_length(dynamic(['John', 'Denver', 'Bob', 'Marley'])) == 4; print array_length(dynamic([1, 2, 3])) == 3; @@ -109,6 +117,7 @@ print repeat("asd", 3); print repeat(timespan(1d), 3); print repeat(true, 3); print repeat(1, -3); +print repeat(6.7,-4); print '-- set_difference()'; print set_difference(dynamic([]), dynamic([])); print set_difference(dynamic([]), dynamic([9])); @@ -149,4 +158,4 @@ print zip(dynamic([]), dynamic([])); print zip(dynamic([1,3,5]), dynamic([2,4,6])); print zip(dynamic(['Darth','Master']), dynamic(['Vader','Yoda']), dynamic(['has a suit','doesn\'t have a suit'])); print zip(dynamic([1,2,3]), dynamic([10,20])); -print zip(dynamic([]), dynamic([1,2,3])); +print zip(dynamic([]), dynamic([1,2,3])); \ No newline at end of file diff --git a/tests/queries/0_stateless/02366_kql_func_string.reference b/tests/queries/0_stateless/02366_kql_func_string.reference index f971361ef9c..ebad8414b90 100644 --- a/tests/queries/0_stateless/02366_kql_func_string.reference +++ b/tests/queries/0_stateless/02366_kql_func_string.reference @@ -285,6 +285,8 @@ YWUzMTMzZjItNmUyMi00OWFlLWIwNmEtMTZlNmE5YjIxMmVi {"Query Parameters":{"k1":"v1","k2":"v2","k3":"v3"}} -- strcmp() 0 1 -1 1 +-- substring() +CD -- translate() kusto xxx -- trim() diff --git a/tests/queries/0_stateless/02366_kql_func_string.sql b/tests/queries/0_stateless/02366_kql_func_string.sql index ba86e60d8a8..42c15e597df 100644 --- a/tests/queries/0_stateless/02366_kql_func_string.sql +++ b/tests/queries/0_stateless/02366_kql_func_string.sql @@ -205,7 +205,6 @@ print extract_json('$.phoneNumbers[0].type', ''); print extractjson('$.firstName', '{"firstName":"John","lastName":"doe","age":26,"address":{"streetAddress":"naist street","city":"Nara","postalCode":"630-0192"},"phoneNumbers":[{"type":"iPhone","number":"0123-4567-8888"},{"type":"home","number":"0123-4567-8910"}]}'); print extract_json('$.phoneNumbers[0].type', '{"firstName":"John","lastName":"doe","age":26,"address":{"streetAddress":"naist street","city":"Nara","postalCode":"630-0192"},"phoneNumbers":[{"type":"iPhone","number":"0123-4567-8888"},{"type":"home","number":"0123-4567-8910"}]}', typeof(string)); print extract_json('$.phoneNumbers[0].type', '{"firstName":"John","lastName":"doe","age":26,"address":{"streetAddress":"naist street","city":"Nara","postalCode":"630-0192"},"phoneNumbers":[{"type":"iPhone","number":"0123-4567-8888"},{"type":"home","number":"0123-4567-8910"}]}', typeof(int)); --- print extract_json('$.phoneNumbers[:1].type', '{"firstName":"John","lastName":"doe","age":26,"address":{"streetAddress":"naist street","city":"Nara","postalCode":"630-0192"},"phoneNumbers":[{"type":"iPhone","number":"0123-4567-8888"},{"type":"home","number":"0123-4567-8910"}]}'); -> iPhone print extract_json('$.age', '{"firstName":"John","lastName":"doe","age":26,"address":{"streetAddress":"naist street","city":"Nara","postalCode":"630-0192"},"phoneNumbers":[{"type":"iPhone","number":"0123-4567-8888"},{"type":"home","number":"0123-4567-8910"}]}'); print extract_json('$.age', '{"firstName":"John","lastName":"doe","age":26,"address":{"streetAddress":"naist street","city":"Nara","postalCode":"630-0192"},"phoneNumbers":[{"type":"iPhone","number":"0123-4567-8888"},{"type":"home","number":"0123-4567-8910"}]}', typeof(int)); print extract_json('$.age', '{"firstName":"John","lastName":"doe","age":26,"address":{"streetAddress":"naist street","city":"Nara","postalCode":"630-0192"},"phoneNumbers":[{"type":"iPhone","number":"0123-4567-8888"},{"type":"home","number":"0123-4567-8910"}]}', typeof(long)); @@ -242,6 +241,8 @@ print '-- parse_urlquery()'; print parse_urlquery('k1=v1&k2=v2&k3=v3'); print '-- strcmp()'; print strcmp('ABC','ABC'), strcmp('abc','ABC'), strcmp('ABC','abc'), strcmp('abcde','abc'); +print '-- substring()'; +print substring("ABCD", -2, 2); print '-- translate()'; print translate('krasp', 'otsku', 'spark'), translate('abc', '', 'ab'), translate('abc', 'x', 'abc'); print '-- trim()'; diff --git a/tests/queries/0_stateless/02366_kql_summarize.sql b/tests/queries/0_stateless/02366_kql_summarize.sql index 00bc67b1a66..62d69a95a08 100644 --- a/tests/queries/0_stateless/02366_kql_summarize.sql +++ b/tests/queries/0_stateless/02366_kql_summarize.sql @@ -54,6 +54,7 @@ Customers | summarize dcount(Education); Customers | summarize dcountif(Education, Occupation=='Professional'); Customers | summarize count_ = count() by bin(Age, 10) | order by count_ asc; Customers | summarize job_count = count() by Occupation | where job_count > 0; +Customers | summarize 'Edu Count'=count() by Education | sort by 'Edu Count' desc; -- { clientError 62 } print '-- make_list() --'; Customers | summarize f_list = make_list(Education) by Occupation;