Skip to content

Commit

Permalink
Merge pull request #303 from Bit-Quill/dev/sl_trimWhiteSpace
Browse files Browse the repository at this point in the history
[Spotless] Trim whitespace
  • Loading branch information
MitchellGale authored Jul 24, 2023
2 parents 760d64d + dade5d5 commit 318af4a
Show file tree
Hide file tree
Showing 12 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ spotless {
// " * SPDX-License-Identifier: Apache-2.0\n" +
// " */\n\n\n")
// removeUnusedImports()
// trimTrailingWhitespace()
trimTrailingWhitespace()
endWithNewline()
// googleJavaFormat('1.17.0').reflowLongStrings().groupArtifact('com.google.googlejavaformat:google-java-format')
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
import org.opensearch.sql.planner.logical.LogicalPlan;

/**
* Micro batch streaming execution.
* Micro batch streaming execution.
*/
public class MicroBatchStreamingExecution {

Expand Down
2 changes: 1 addition & 1 deletion core/src/main/java/org/opensearch/sql/expression/DSL.java
Original file line number Diff line number Diff line change
Expand Up @@ -534,7 +534,7 @@ public static FunctionExpression str_to_date(FunctionProperties functionProperti
Expression... expressions) {
return compile(functionProperties, BuiltinFunctionName.STR_TO_DATE, expressions);
}

public static FunctionExpression sec_to_time(Expression... expressions) {
return compile(FunctionProperties.None, BuiltinFunctionName.SEC_TO_TIME, expressions);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1165,7 +1165,7 @@ private ExprValue exprDateApplyInterval(FunctionProperties functionProperties,
var dt = extractDateTime(datetime, functionProperties);
return new ExprDatetimeValue(isAdd ? dt.plus(interval) : dt.minus(interval));
}

/**
* Formats date according to format specifier. First argument is time, second is format.
* Detailed supported signatures:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public R visitValues(ValuesOperator node, C context) {
public R visitSort(SortOperator node, C context) {
return visitNode(node, context);
}

public R visitRareTopN(RareTopNOperator node, C context) {
return visitNode(node, context);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ Helper latestOffsetLogShouldBe(Long offsetId) {
* StreamingSource impl only for testing.
*
* <p>initially, offset is -1, getLatestOffset() will return Optional.emtpy().
*
*
* <p>call addData() add offset by one.
*/
static class TestStreamingSource implements StreamingSource {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -559,7 +559,7 @@ public void invalidDayOfYearArgument() {
() -> invalidDayOfYearQuery("asdfasdfasdf"))
);
}

@Test
public void from_days() {
FunctionExpression expression = DSL.from_days(DSL.literal(new ExprLongValue(730669)));
Expand Down Expand Up @@ -1712,7 +1712,7 @@ private static Stream<Arguments> getInvalidTestDataForTimeFormat() {
DSL.literal("%h"))
);
}

@ParameterizedTest(name = "{0}{1}")
@MethodSource("getInvalidTestDataForTimeFormat")
public void testInvalidTimeFormat(LiteralExpression arg, LiteralExpression format) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1485,7 +1485,7 @@ public void signum_double_value(Double value) {
signum.valueOf(valueEnv()),
allOf(hasType(INTEGER), hasValue((int) Math.signum(value))));
assertEquals(String.format("signum(%s)", value), signum.toString());
}
}

/**
* Test sinh with byte value.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public void testPI() throws IOException {
schema("PI()", null, "double"));
verifyDataRows(result, rows(3.141592653589793));
}

@Test
public void testCeil() throws IOException {
JSONObject result = executeQuery("select ceil(0)");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public class DeleteResultSetTest {

@Mock
Delete deleteQuery;

@Test
public void testDeleteResponseForJdbcFormat() throws IOException {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -227,14 +227,14 @@ public static TypeSafeMatcher<JSONObject> columnPattern(String regex) {
protected boolean matchesSafely(JSONObject jsonObject) {
return ((String)jsonObject.query("/name")).matches(regex);
}

@Override
public void describeTo(Description description) {
description.appendText(String.format("(column_pattern=%s)", regex));
}
};
}

public static TypeSafeMatcher<JSONObject> columnName(String name) {
return new TypeSafeMatcher<JSONObject>() {
@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -595,7 +595,7 @@ public void can_parse_sec_to_time_function() {
assertNotNull(parser.parse("SELECT sec_to_time(6897)"));
assertNotNull(parser.parse("SELECT sec_to_time(6897.123)"));
}

@Test
public void can_parse_last_day_function() {
assertNotNull(parser.parse("SELECT last_day(\"2017-06-20\")"));
Expand All @@ -607,7 +607,7 @@ public void can_parse_timestampadd_function() {
assertNotNull(parser.parse("SELECT TIMESTAMPADD(MINUTE, 1, '2003-01-02')"));
assertNotNull(parser.parse("SELECT TIMESTAMPADD(WEEK,1,'2003-01-02')"));
}

@Test
public void can_parse_timestampdiff_function() {
assertNotNull(parser.parse("SELECT TIMESTAMPDIFF(MINUTE, '2003-01-02', '2003-01-02')"));
Expand Down

0 comments on commit 318af4a

Please sign in to comment.