Skip to content

Commit

Permalink
Merge pull request #88 from ClibMouse/build_fix
Browse files Browse the repository at this point in the history
Build fix and Unit test fix in Kusto-phase2
  • Loading branch information
HeenaBansal2009 committed Sep 28, 2022
2 parents 8f3f4a7 + a3f068f commit 720903d
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/Parsers/tests/KQL/gtest_KQL_Conversion.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ INSTANTIATE_TEST_SUITE_P(
},
{
"print time(1tick)",
"SELECT CAST('1e-10', 'Float64')"
"SELECT CAST('1e-07', 'Float64')"
}

})));
4 changes: 0 additions & 4 deletions src/Parsers/tests/KQL/gtest_KQL_DataType.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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')"
}
})));
4 changes: 3 additions & 1 deletion src/Parsers/tests/KQL/gtest_KQL_StringFunctions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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))",
Expand Down Expand Up @@ -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')"
},
Expand Down
8 changes: 4 additions & 4 deletions src/Parsers/tests/KQL/gtest_KQL_dateTimeFunctions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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))",
Expand All @@ -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)",
Expand Down Expand Up @@ -200,7 +200,7 @@ INSTANTIATE_TEST_SUITE_P(ParserKQLQuery_Datetime, ParserTest,
},
{
"print totimespan(-1d)",
"SELECT -86400."
"SELECT -86400"
},
{
"print totimespan('abc')",
Expand Down

0 comments on commit 720903d

Please sign in to comment.