This is an automated email from the ASF dual-hosted git repository. yiguolei pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/master by this push: new 9fc5ec48b4 [Improvement] remove UT for unused method (#11241) 9fc5ec48b4 is described below commit 9fc5ec48b42cd11d1087a27dcff87b5525aa3f89 Author: Gabriel <gabrielleeb...@gmail.com> AuthorDate: Wed Jul 27 13:55:36 2022 +0800 [Improvement] remove UT for unused method (#11241) * [Improvement] remove UT for unused method --- .../main/java/org/apache/doris/analysis/DateLiteral.java | 4 ---- .../java/org/apache/doris/analysis/DateLiteralTest.java | 15 --------------- 2 files changed, 19 deletions(-) diff --git a/fe/fe-core/src/main/java/org/apache/doris/analysis/DateLiteral.java b/fe/fe-core/src/main/java/org/apache/doris/analysis/DateLiteral.java index 2a08cb6e75..18cf7bff6a 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/analysis/DateLiteral.java +++ b/fe/fe-core/src/main/java/org/apache/doris/analysis/DateLiteral.java @@ -548,10 +548,6 @@ public class DateLiteral extends LiteralExpr { type = ScalarType.createDatetimeV2Type(newScale); } - public long getDecimalNumber() { - return Double.valueOf(microsecond / (Math.pow(10, 6 - ((ScalarType) type).decimalScale()))).longValue(); - } - private String convertToString(PrimitiveType type) { if (type == PrimitiveType.DATE || type == PrimitiveType.DATEV2) { return String.format("%04d-%02d-%02d", year, month, day); diff --git a/fe/fe-core/src/test/java/org/apache/doris/analysis/DateLiteralTest.java b/fe/fe-core/src/test/java/org/apache/doris/analysis/DateLiteralTest.java index dacce11b67..43271660e7 100644 --- a/fe/fe-core/src/test/java/org/apache/doris/analysis/DateLiteralTest.java +++ b/fe/fe-core/src/test/java/org/apache/doris/analysis/DateLiteralTest.java @@ -26,8 +26,6 @@ import org.apache.doris.common.jmockit.Deencapsulation; import org.junit.Assert; import org.junit.Test; -import java.time.LocalDateTime; - public class DateLiteralTest { @Test @@ -388,17 +386,4 @@ public class DateLiteralTest { } Assert.assertFalse(hasException); } - - @Test - public void testDateTimeV2Decimal() { - DateLiteral dateLiteral1 = new DateLiteral(LocalDateTime.now(), - DateLiteral.getDefaultDateType(ScalarType.createDatetimeV2Type(3))); - Assert.assertTrue((dateLiteral1.getDecimalNumber() >= 100 && dateLiteral1.getDecimalNumber() < 1000) - || dateLiteral1.getDecimalNumber() == 0); - - DateLiteral dateLiteral2 = new DateLiteral(LocalDateTime.now(), - DateLiteral.getDefaultDateType(ScalarType.createDatetimeV2Type(5))); - Assert.assertTrue((dateLiteral2.getDecimalNumber() >= 10000 && dateLiteral2.getDecimalNumber() < 100000) - || dateLiteral2.getDecimalNumber() == 0); - } } --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org