diff --git a/fe/src/main/java/org/apache/doris/common/util/PropertyAnalyzer.java b/fe/src/main/java/org/apache/doris/common/util/PropertyAnalyzer.java index f2a2a0dd3a9826..118288c3ab598a 100644 --- a/fe/src/main/java/org/apache/doris/common/util/PropertyAnalyzer.java +++ b/fe/src/main/java/org/apache/doris/common/util/PropertyAnalyzer.java @@ -110,7 +110,7 @@ public static DataProperty analyzeDataProperty(Map properties, D } else if (!hasCooldown && key.equalsIgnoreCase(PROPERTIES_STORAGE_COLDOWN_TIME)) { hasCooldown = true; DateLiteral dateLiteral = new DateLiteral(value, Type.DATETIME); - coolDownTimeStamp = dateLiteral.getLongValue(); + coolDownTimeStamp = dateLiteral.unixTimestamp(TimeUtils.getTimeZone()); } } // end for properties diff --git a/fe/src/test/java/org/apache/doris/common/PropertyAnalyzerTest.java b/fe/src/test/java/org/apache/doris/common/PropertyAnalyzerTest.java index 3aaaf203d2dec5..9ff9e6fc05c415 100644 --- a/fe/src/test/java/org/apache/doris/common/PropertyAnalyzerTest.java +++ b/fe/src/test/java/org/apache/doris/common/PropertyAnalyzerTest.java @@ -21,12 +21,14 @@ import org.apache.doris.catalog.Column; import org.apache.doris.catalog.ScalarType; import org.apache.doris.catalog.PrimitiveType; +import org.apache.doris.catalog.DataProperty; import org.apache.doris.common.util.PropertyAnalyzer; import com.google.common.collect.Lists; import com.google.common.collect.Maps; import com.google.common.collect.Sets; +import org.apache.doris.thrift.TStorageMedium; import org.junit.Assert; import org.junit.Test; @@ -115,4 +117,13 @@ public void testBfFpp() throws AnalysisException { properties.put(PropertyAnalyzer.PROPERTIES_BF_FPP, "0.05"); Assert.assertEquals(0.05, PropertyAnalyzer.analyzeBloomFilterFpp(properties), 0.0001); } + + @Test + public void testStorageMedium() throws AnalysisException { + Map properties = Maps.newHashMap(); + properties.put(PropertyAnalyzer.PROPERTIES_STORAGE_MEDIUM, "SSD"); + properties.put(PropertyAnalyzer.PROPERTIES_STORAGE_COLDOWN_TIME, "2020-05-01 00:00:00"); + DataProperty dataProperty = PropertyAnalyzer.analyzeDataProperty(properties, new DataProperty(TStorageMedium.SSD)); + Assert.assertEquals(1588262400, dataProperty.getCooldownTimeMs() / 1000); + } }