Skip to content

Commit ce83051

Browse files
committed
Resolve the problem that cannot format standard date string for the accumulator query among tree and table model.
1 parent da6f36b commit ce83051

File tree

7 files changed

+672
-52
lines changed

7 files changed

+672
-52
lines changed

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

Lines changed: 21 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -125,18 +125,16 @@ public void testWriteAndAlter()
125125
typesToTest.remove(TSDataType.VECTOR);
126126
typesToTest.remove(TSDataType.UNKNOWN);
127127

128-
doWriteAndAlter(TSDataType.INT64, TSDataType.STRING);
129-
130-
// for (TSDataType from : typesToTest) {
131-
// for (TSDataType to : typesToTest) {
132-
// if (from != to && to.isCompatible(from)) {
133-
// System.out.printf("testing %s to %s%n", from, to);
134-
// doWriteAndAlter(from, to);
135-
// testAlignDeviceSequenceDataQuery(from, to);
136-
// testAlignDeviceUnSequenceDataQuery(from, to);
137-
// }
138-
// }
139-
// }
128+
for (TSDataType from : typesToTest) {
129+
for (TSDataType to : typesToTest) {
130+
if (from != to && to.isCompatible(from)) {
131+
System.out.printf("testing %s to %s%n", from, to);
132+
doWriteAndAlter(from, to);
133+
testAlignDeviceSequenceDataQuery(from, to);
134+
testAlignDeviceUnSequenceDataQuery(from, to);
135+
}
136+
}
137+
}
140138
}
141139

142140
private void doWriteAndAlter(TSDataType from, TSDataType to)
@@ -265,8 +263,8 @@ private void doWriteAndAlter(TSDataType from, TSDataType to)
265263
session.insert(tablet);
266264
tablet.reset();
267265

268-
tablet.addTimestamp(0, 3);
269-
tablet.addValue("s1", 0, genValue(newType, 3));
266+
tablet.addTimestamp(0, 2);
267+
tablet.addValue("s1", 0, genValue(newType, 2));
270268
session.insert(tablet);
271269
tablet.reset();
272270

@@ -315,7 +313,10 @@ private void doWriteAndAlter(TSDataType from, TSDataType to)
315313
assertFalse(dataSet.hasNext());
316314
}
317315

318-
session.executeNonQueryStatement("DROP TABLE write_and_alter_column_type");
316+
} finally {
317+
try (ITableSession session = EnvFactory.getEnv().getTableSessionConnectionWithDB("test")) {
318+
session.executeNonQueryStatement("DROP TABLE write_and_alter_column_type");
319+
}
319320
}
320321
}
321322

@@ -1334,9 +1335,10 @@ public void testAlignDeviceSequenceDataQuery(TSDataType from, TSDataType to)
13341335
dataSet.close();
13351336

13361337
try {
1337-
standardSelectTest(session, from, to);
1338+
// standardSelectTest(session, from, to);
13381339
standardAccumulatorQueryTest(session, from);
13391340
} catch (Exception e) {
1341+
log.error("{}", e.getStackTrace());
13401342
log.info(e.getMessage());
13411343
}
13421344

@@ -1369,6 +1371,7 @@ public void testAlignDeviceSequenceDataQuery(TSDataType from, TSDataType to)
13691371
// Accumulator query test
13701372
standardAccumulatorQueryTest(session, from, newType);
13711373
} catch (Exception e) {
1374+
log.error("{}", e.getStackTrace());
13721375
log.info(e.getMessage());
13731376
}
13741377

@@ -1441,6 +1444,7 @@ public void testAlignDeviceUnSequenceDataQuery(TSDataType from, TSDataType to)
14411444
standardSelectTest(session, from, to);
14421445
standardAccumulatorQueryTest(session, from);
14431446
} catch (Exception e) {
1447+
log.error("{}", e.getStackTrace());
14441448
log.info(e.getMessage());
14451449
}
14461450

@@ -1474,6 +1478,7 @@ public void testAlignDeviceUnSequenceDataQuery(TSDataType from, TSDataType to)
14741478
// Accumulator query test
14751479
standardAccumulatorQueryTest(session, from, newType);
14761480
} catch (Exception e) {
1481+
log.error("{}", e.getStackTrace());
14771482
log.info(e.getMessage());
14781483
}
14791484

0 commit comments

Comments
 (0)