Skip to content

Commit da6f36b

Browse files
committed
Resolve the problem that time series value cannot be standard date format.
1 parent 51b547e commit da6f36b

File tree

3 files changed

+8
-5
lines changed

3 files changed

+8
-5
lines changed

integration-test/src/test/java/org/apache/iotdb/relational/it/schema/IoTDBAlterTimeSeriesTypeIT.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,7 @@ private void doWriteAndAlter(TSDataType from, TSDataType to)
299299
session.insertTablet(tablet);
300300
tablet.reset();
301301

302-
log.error("Write completely");
302+
log.info("Write completely");
303303

304304
dataSet =
305305
session.executeQueryStatement(
@@ -1223,7 +1223,7 @@ public void testAlignDeviceSequenceDataQuery(TSDataType from, TSDataType to)
12231223
} finally {
12241224
try (ISession session = EnvFactory.getEnv().getSessionConnection()) {
12251225
session.executeNonQueryStatement(
1226-
"DELETE TIMESERIES " + database + ".construct_and_alter_column_type.**");
1226+
"DELETE TIMESERIES " + database + ".construct_and_alter_column_type.**");
12271227
}
12281228
}
12291229
}

iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/execution/operator/source/SeriesScanUtil.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@
8484
import java.io.IOException;
8585
import java.io.Serializable;
8686
import java.nio.charset.StandardCharsets;
87+
import java.util.Arrays;
8788
import java.util.Collections;
8889
import java.util.Comparator;
8990
import java.util.LinkedList;
@@ -922,7 +923,10 @@ private TsBlock getTransferedDataTypeTsBlock(TsBlock tsBlock) {
922923
for (int i = 0; i < length; i++) {
923924
TSDataType finalDataType = getTsDataTypeList().get(i);
924925
if ((valueColumns[i].getDataType() != finalDataType)
925-
&& SchemaUtils.isUsingSameColumn(valueColumns[i].getDataType(), finalDataType)) {
926+
&& (SchemaUtils.isUsingSameColumn(valueColumns[i].getDataType(), finalDataType)
927+
|| (valueColumns[i].getDataType().equals(TSDataType.DATE)
928+
&& Arrays.asList(TSDataType.STRING, TSDataType.TEXT)
929+
.contains(finalDataType)))) {
926930
isTypeInconsistent = true;
927931
break;
928932
}

iotdb-core/datanode/src/main/java/org/apache/iotdb/db/utils/datastructure/IntTVList.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,8 +135,7 @@ protected void expandValues() {
135135

136136
@Override
137137
public TimeValuePair getTimeValuePair(int index) {
138-
return new TimeValuePair(
139-
getTime(index), TsPrimitiveType.getByType(dataType, getInt(index)));
138+
return new TimeValuePair(getTime(index), TsPrimitiveType.getByType(dataType, getInt(index)));
140139
}
141140

142141
@Override

0 commit comments

Comments
 (0)