Skip to content
This repository has been archived by the owner on Aug 2, 2022. It is now read-only.

Commit

Permalink
Bug fix, using Local.Root when format the string in DateTimeFunctionIT (
Browse files Browse the repository at this point in the history
  • Loading branch information
penghuo committed Oct 21, 2020
1 parent 275fddb commit 2e1dbff
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import static com.amazon.opendistroforelasticsearch.sql.util.MatcherUtils.verifySchema;
import static com.amazon.opendistroforelasticsearch.sql.util.TestUtils.getResponseBody;

import com.amazon.opendistroforelasticsearch.sql.common.utils.StringUtils;
import com.amazon.opendistroforelasticsearch.sql.legacy.SQLIntegTestCase;
import com.amazon.opendistroforelasticsearch.sql.util.TestUtils;
import java.io.IOException;
Expand Down Expand Up @@ -354,9 +355,10 @@ public void testYear() throws IOException {
}

private void week(String date, int mode, int expectedResult) throws IOException {
JSONObject result = executeQuery(String.format("select week(date('%s'), %d)", date, mode));
JSONObject result = executeQuery(StringUtils.format("select week(date('%s'), %d)", date,
mode));
verifySchema(result,
schema(String.format("week(date('%s'), %d)", date, mode), null, "integer"));
schema(StringUtils.format("week(date('%s'), %d)", date, mode), null, "integer"));
verifyDataRows(result, rows(expectedResult));
}

Expand Down

0 comments on commit 2e1dbff

Please sign in to comment.