Skip to content

Commit

Permalink
Removed unused import, removed accidentilly added test, removed ignor…
Browse files Browse the repository at this point in the history
…e from test

Signed-off-by: Matthew Wells <[email protected]>
  • Loading branch information
matthewryanwells committed Jul 14, 2023
1 parent e5f7364 commit 966efbb
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1773,23 +1773,6 @@ public void testTimeFormatAndDateFormatReturnSameResult() {
assertEquals(eval(dateFormatExpr), eval(timeFormatExpr));
}

@Test
public void testTimestampBracket() {
FunctionExpression expr = DSL.time_format(
functionProperties,
DSL.literal(new ExprDateValue("2023-01-16")),
DSL.literal(new ExprStringValue("%h %s")));

assertEquals(
expr.toString(),
"time_format(DATE '2023-01-16', \"%h %s\")"
);
assertEquals(
"\"12 00\"",
eval(expr).toString()
);
}

private ExprValue eval(Expression expression) {
return expression.valueOf();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -746,7 +746,6 @@ public void dateSearch() throws IOException {
}
}

@Ignore
@Test
public void dateSearchBraces() throws IOException {
DateTimeFormatter formatter = DateTimeFormat.forPattern(TestsConstants.TS_DATE_FORMAT);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1298,6 +1298,14 @@ public void testTimestampBracket() throws IOException {
result = executeQuery("select {ts '2020-09-16 17:30:00'}");
verifySchema(result, schema("{ts '2020-09-16 17:30:00'}", null, "timestamp"));
verifyDataRows(result, rows("2020-09-16 17:30:00"));

result = executeQuery("select {timestamp '2020-09-16 17:30:00.123'}");
verifySchema(result, schema("{timestamp '2020-09-16 17:30:00.123'}", null, "timestamp"));
verifyDataRows(result, rows("2020-09-16 17:30:00.123"));

result = executeQuery("select {ts '2020-09-16 17:30:00.123'}");
verifySchema(result, schema("{ts '2020-09-16 17:30:00.123'}", null, "timestamp"));
verifyDataRows(result, rows("2020-09-16 17:30:00.123"));
}

@Test
Expand All @@ -1309,6 +1317,14 @@ public void testTimeBracket() throws IOException {
result = executeQuery("select {t '17:30:00'}");
verifySchema(result, schema("{t '17:30:00'}", null, "time"));
verifyDataRows(result, rows("17:30:00"));

result = executeQuery("select {time '17:30:00'}");
verifySchema(result, schema("{time '17:30:00'}", null, "time"));
verifyDataRows(result, rows("17:30:00"));

result = executeQuery("select {t '17:30:00'}");
verifySchema(result, schema("{t '17:30:00'}", null, "time"));
verifyDataRows(result, rows("17:30:00"));
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
import static org.opensearch.sql.ast.dsl.AstDSL.between;
import static org.opensearch.sql.ast.dsl.AstDSL.not;
import static org.opensearch.sql.ast.dsl.AstDSL.qualifiedName;
import static org.opensearch.sql.expression.function.BuiltinFunctionName.DATETIME;
import static org.opensearch.sql.expression.function.BuiltinFunctionName.IS_NOT_NULL;
import static org.opensearch.sql.expression.function.BuiltinFunctionName.IS_NULL;
import static org.opensearch.sql.expression.function.BuiltinFunctionName.LIKE;
Expand Down

0 comments on commit 966efbb

Please sign in to comment.