From 925aa90169224542684b04d959b72f1da66d7d9e Mon Sep 17 00:00:00 2001 From: Matthew Wells Date: Tue, 11 Jul 2023 09:46:16 -0700 Subject: [PATCH] added newlines to documentation and updated case in tests to be consistent Signed-off-by: Matthew Wells --- docs/user/ppl/functions/datetime.rst | 2 ++ .../sql/ppl/antlr/PPLSyntaxParserTest.java | 16 ++++++++-------- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/docs/user/ppl/functions/datetime.rst b/docs/user/ppl/functions/datetime.rst index 9618ea77b7..8f844c75a2 100644 --- a/docs/user/ppl/functions/datetime.rst +++ b/docs/user/ppl/functions/datetime.rst @@ -1812,6 +1812,7 @@ If the third argument is a STRING, it must be formatted as a valid DATETIME. If If the third argument is a DATE, it will be automatically converted to a DATETIME. Argument type: INTERVAL, INTEGER, DATE/DATETIME/TIME/TIMESTAMP/STRING + INTERVAL must be one of the following tokens: [MICROSECOND, SECOND, MINUTE, HOUR, DAY, WEEK, MONTH, QUARTER, YEAR] Examples:: @@ -1837,6 +1838,7 @@ Arguments will be automatically converted to a DATETIME/TIME/TIMESTAMP when appr Any argument that is a STRING must be formatted as a valid DATETIME. Argument type: INTERVAL, DATE/DATETIME/TIME/TIMESTAMP/STRING, DATE/DATETIME/TIME/TIMESTAMP/STRING + INTERVAL must be one of the following tokens: [MICROSECOND, SECOND, MINUTE, HOUR, DAY, WEEK, MONTH, QUARTER, YEAR] Examples:: diff --git a/ppl/src/test/java/org/opensearch/sql/ppl/antlr/PPLSyntaxParserTest.java b/ppl/src/test/java/org/opensearch/sql/ppl/antlr/PPLSyntaxParserTest.java index dd663d916f..8ca6c5c84e 100644 --- a/ppl/src/test/java/org/opensearch/sql/ppl/antlr/PPLSyntaxParserTest.java +++ b/ppl/src/test/java/org/opensearch/sql/ppl/antlr/PPLSyntaxParserTest.java @@ -139,7 +139,7 @@ public void testTopCommandWithoutNAndGroupByShouldPass() { } @Test - public void can_parse_multi_match_relevance_function() { + public void testCanParseMultiMatchRelevanceFunction() { assertNotEquals(null, new PPLSyntaxParser().parse( "SOURCE=test | WHERE multi_match(['address'], 'query')")); assertNotEquals(null, new PPLSyntaxParser().parse( @@ -172,7 +172,7 @@ public void can_parse_multi_match_relevance_function() { } @Test - public void can_parse_simple_query_string_relevance_function() { + public void testCanParseSimpleQueryStringRelevanceFunction() { assertNotEquals(null, new PPLSyntaxParser().parse( "SOURCE=test | WHERE simple_query_string(['address'], 'query')")); assertNotEquals(null, new PPLSyntaxParser().parse( @@ -205,7 +205,7 @@ public void can_parse_simple_query_string_relevance_function() { } @Test - public void can_parse_query_string_relevance_function() { + public void testCanParseQueryStringRelevanceFunction() { assertNotEquals(null, new PPLSyntaxParser().parse( "SOURCE=test | WHERE query_string(['address'], 'query')")); assertNotEquals(null, new PPLSyntaxParser().parse( @@ -274,7 +274,7 @@ public void testDescribeCommandWithSourceShouldFail() { } @Test - public void testCan_parse_extract_function() { + public void testCanParseExtractFunction() { String[] parts = List.of("MICROSECOND", "SECOND", "MINUTE", "HOUR", "DAY", "WEEK", "MONTH", "QUARTER", "YEAR", "SECOND_MICROSECOND", "MINUTE_MICROSECOND", "MINUTE_SECOND", "HOUR_MICROSECOND", @@ -288,7 +288,7 @@ public void testCan_parse_extract_function() { } @Test - public void testCan_parse_get_format_function() { + public void testCanParseGetFormatFunction() { String[] types = {"DATE", "DATETIME", "TIME", "TIMESTAMP"}; String[] formats = {"'USA'", "'JIS'", "'ISO'", "'EUR'", "'INTERNAL'"}; @@ -301,7 +301,7 @@ public void testCan_parse_get_format_function() { } @Test - public void testCannot_parse_get_format_function_with_bad_arg() { + public void testCannotParseGetFormatFunctionWithBadArg() { assertThrows( SyntaxCheckException.class, () -> new PPLSyntaxParser().parse( @@ -309,7 +309,7 @@ public void testCannot_parse_get_format_function_with_bad_arg() { } @Test - public void can_parse_timestampadd_function() { + public void testCanParseTimestampaddFunction() { assertNotNull(new PPLSyntaxParser().parse( "SOURCE=test | eval k = TIMESTAMPADD(MINUTE, 1, '2003-01-02')")); assertNotNull(new PPLSyntaxParser().parse( @@ -317,7 +317,7 @@ public void can_parse_timestampadd_function() { } @Test - public void can_parse_timestampdiff_function() { + public void testCanParseTimestampdiffFunction() { assertNotNull(new PPLSyntaxParser().parse( "SOURCE=test | eval k = TIMESTAMPDIFF(MINUTE, '2003-01-02', '2003-01-02')")); assertNotNull(new PPLSyntaxParser().parse(