diff --git a/src/Parsers/tests/KQL/gtest_KQL_Conversion.cpp b/src/Parsers/tests/KQL/gtest_KQL_Conversion.cpp index 21edc27deb21..5173269d6d36 100644 --- a/src/Parsers/tests/KQL/gtest_KQL_Conversion.cpp +++ b/src/Parsers/tests/KQL/gtest_KQL_Conversion.cpp @@ -74,7 +74,7 @@ INSTANTIATE_TEST_SUITE_P( }, { "print time(1tick)", - "SELECT CAST('1e-10', 'Float64')" + "SELECT CAST('1e-07', 'Float64')" } }))); diff --git a/src/Parsers/tests/KQL/gtest_KQL_DataType.cpp b/src/Parsers/tests/KQL/gtest_KQL_DataType.cpp index a91c80432157..2f51d761b39b 100644 --- a/src/Parsers/tests/KQL/gtest_KQL_DataType.cpp +++ b/src/Parsers/tests/KQL/gtest_KQL_DataType.cpp @@ -61,9 +61,5 @@ INSTANTIATE_TEST_SUITE_P(ParserKQLQuery_DataType, ParserTest, { "print timespan('12.23:12:23');", "SELECT CAST('1120343', 'Float64')" - }, - { - "print timespan(12.23:12:23)", - "SELECT CAST('1120343', 'Float64')" } }))); diff --git a/src/Parsers/tests/KQL/gtest_KQL_StringFunctions.cpp b/src/Parsers/tests/KQL/gtest_KQL_StringFunctions.cpp index ea1fa0bb09df..7c1650bc585f 100644 --- a/src/Parsers/tests/KQL/gtest_KQL_StringFunctions.cpp +++ b/src/Parsers/tests/KQL/gtest_KQL_StringFunctions.cpp @@ -108,7 +108,7 @@ INSTANTIATE_TEST_SUITE_P(ParserKQLQuery_String, ParserTest, }, { "print res = bin_at(1h, 1d, 12h)", - "SELECT concat(toString(toInt32(((toFloat64(43200.) + (toInt64(((toFloat64(3600.) - toFloat64(43200.)) / 86400) + -1) * 86400)) AS x) / 3600)), ':', toString(toInt32((x % 3600) / 60)), ':', toString(toInt32((x % 3600) % 60))) AS res" + "SELECT concat(toString(toInt32(((toFloat64(43200) + (toInt64(((toFloat64(3600) - toFloat64(43200)) / 86400) + -1) * 86400)) AS x) / 3600)), ':', toString(toInt32((x % 3600) / 60)), ':', toString(toInt32((x % 3600) % 60))) AS res" }, { "print res = bin_at(datetime(2017-05-15 10:20:00.0), 1d, datetime(1970-01-01 12:00:00.0))", @@ -153,6 +153,8 @@ INSTANTIATE_TEST_SUITE_P(ParserKQLQuery_String, ParserTest, { "print extract('x=([0-9.]+)', 1, 'hello x=456|wo' , typeof(decimal));", "SELECT toDecimal128OrNull(if(countSubstrings(extract('hello x=456|wo', '[0-9.]+'), '.') > 1, NULL, extract('hello x=456|wo', '[0-9.]+')), length(substr(extract('hello x=456|wo', '[0-9.]+'), position(extract('hello x=456|wo', '[0-9.]+'), '.') + 1)))" + }, + { "print bin(datetime(1970-05-11 13:45:07.456345672), 1ms)", "SELECT toDateTime64(toInt64(toFloat64(parseDateTime64BestEffortOrNull('1970-05-11 13:45:07.456345672', 9, 'UTC')) / 0.001) * 0.001, 9, 'UTC')" }, diff --git a/src/Parsers/tests/KQL/gtest_KQL_dateTimeFunctions.cpp b/src/Parsers/tests/KQL/gtest_KQL_dateTimeFunctions.cpp index dbe0c9d59766..68c93b161033 100644 --- a/src/Parsers/tests/KQL/gtest_KQL_dateTimeFunctions.cpp +++ b/src/Parsers/tests/KQL/gtest_KQL_dateTimeFunctions.cpp @@ -52,7 +52,7 @@ INSTANTIATE_TEST_SUITE_P(ParserKQLQuery_Datetime, ParserTest, }, { "print unixtime_seconds_todatetime(1546300899)", - "SELECT multiIf((toTypeName(1546300899) = 'String') OR (toTypeName(1546300899) = 'UUID') OR (toTypeName(1546300899) = 'DateTime64(3)'), 'Only Accepted arguments are float , int and double', toString(toDateTime64(1546300899, 9, 'UTC')))" + "SELECT toDateTime64(1546300899, 9, 'UTC')" }, { "print dayofweek(datetime(2015-12-20))", @@ -64,11 +64,11 @@ INSTANTIATE_TEST_SUITE_P(ParserKQLQuery_Datetime, ParserTest, }, { "print now(1d)", - "SELECT now64(9, 'UTC') + 86400." + "SELECT now64(9, 'UTC') + 86400" }, { "print ago(2d)", - "SELECT now64(9, 'UTC') - 172800." + "SELECT now64(9, 'UTC') - 172800" }, { "print endofday(datetime(2017-01-01 10:10:17), -1)", @@ -200,7 +200,7 @@ INSTANTIATE_TEST_SUITE_P(ParserKQLQuery_Datetime, ParserTest, }, { "print totimespan(-1d)", - "SELECT -86400." + "SELECT -86400" }, { "print totimespan('abc')",