Skip to content

Commit

Permalink
added newlines to documentation and updated case in tests to be consi…
Browse files Browse the repository at this point in the history
…stent

Signed-off-by: Matthew Wells <[email protected]>
  • Loading branch information
matthewryanwells committed Jul 11, 2023
1 parent 50cce5a commit 925aa90
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
2 changes: 2 additions & 0 deletions docs/user/ppl/functions/datetime.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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::
Expand All @@ -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::
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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(
Expand Down Expand Up @@ -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(
Expand Down Expand Up @@ -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",
Expand All @@ -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'"};

Expand All @@ -301,23 +301,23 @@ 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(
"SOURCE=test | eval k = GET_FORMAT(NONSENSE_ARG,'INTERNAL')"));
}

@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(
"SOURCE=test | eval k = TIMESTAMPADD(WEEK,1,'2003-01-02')"));
}

@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(
Expand Down

0 comments on commit 925aa90

Please sign in to comment.