diff --git a/core/src/test/java/org/opensearch/sql/planner/physical/collector/RoundingTest.java b/core/src/test/java/org/opensearch/sql/planner/physical/collector/RoundingTest.java index 4f6d51c901..467a4e1abf 100644 --- a/core/src/test/java/org/opensearch/sql/planner/physical/collector/RoundingTest.java +++ b/core/src/test/java/org/opensearch/sql/planner/physical/collector/RoundingTest.java @@ -57,6 +57,10 @@ void datetime_rounding_non_core_type_span() { DSL.span(DSL.ref("timestamp", new MockTimestampExprType()), DSL.literal(1), "h"); rounding = Rounding.createRounding(timestampSpan); assertInstanceOf(Rounding.TimestampRounding.class, rounding); + SpanExpression datetimeSpan = + DSL.span(DSL.ref("datetime", new MockDateTimeExprType()), DSL.literal(1), "h"); + rounding = Rounding.createRounding(datetimeSpan); + assertInstanceOf(Rounding.DatetimeRounding.class, rounding); } @Test @@ -95,4 +99,11 @@ public String typeName() { return "TIMESTAMP"; } } + + static class MockDateTimeExprType implements ExprType { + @Override + public String typeName() { + return "DATETIME"; + } + } }