Skip to content

Commit 764e450

Browse files
committed
Test sort date
Signed-off-by: Yuanchun Shen <yuanchu@amazon.com>
1 parent e13dc72 commit 764e450

1 file changed

Lines changed: 18 additions & 0 deletions

File tree

integ-test/src/test/java/org/opensearch/sql/calcite/remote/CalcitePPLSortIT.java

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,4 +217,22 @@ public void testSortWithNullValue() throws IOException {
217217
rows("Elinor", null),
218218
rows("Virginia", null));
219219
}
220+
221+
@Test
222+
public void testSortDate() throws IOException {
223+
JSONObject result =
224+
executeQuery(
225+
String.format(
226+
"source=%s | sort birthdate | fields firstname, birthdate", TEST_INDEX_BANK));
227+
verifySchema(result, schema("firstname", "string"), schema("birthdate", "timestamp"));
228+
verifyDataRowsInOrder(
229+
result,
230+
rows("Amber JOHnny", "2017-10-23 00:00:00"),
231+
rows("Hattie", "2017-11-20 00:00:00"),
232+
rows("Nanette", "2018-06-23 00:00:00"),
233+
rows("Elinor", "2018-06-27 00:00:00"),
234+
rows("Dillard", "2018-08-11 00:00:00"),
235+
rows("Virginia", "2018-08-19 00:00:00"),
236+
rows("Dale", "2018-11-13 23:33:20"));
237+
}
220238
}

0 commit comments

Comments
 (0)