[Improvement] remove UT for unused method (#11241)
* [Improvement] remove UT for unused method
This commit is contained in:
@ -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);
|
||||
|
||||
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user