From dc42cc6ca4f278b7994ead383c49e4728058f4bc Mon Sep 17 00:00:00 2001 From: Lantao Jin Date: Sat, 2 Nov 2024 10:25:20 +0800 Subject: [PATCH] fix coverage Signed-off-by: Lantao Jin --- .../sql/planner/physical/collector/RoundingTest.java | 11 +++++++++++ 1 file changed, 11 insertions(+) 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"; + } + } }