Skip to content

Commit d234430

Browse files
authored
Resolve the problem that python client don't support DATE data type in the IntColumn (#705)
* Resolve the problem that python client don't support DATE data type in the IntColumn; Support data type compatible validation in the TimeSeriesMetadata. * Fix.
1 parent e4c11a8 commit d234430

2 files changed

Lines changed: 4 additions & 1 deletion

File tree

java/tsfile/src/main/java/org/apache/tsfile/file/metadata/TimeseriesMetadata.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,7 @@ public boolean typeMatch(List<TSDataType> dataTypes) {
328328
}
329329

330330
public boolean typeMatch(TSDataType dataType) {
331-
return this.dataType == dataType;
331+
return dataType.isCompatible(getTsDataType());
332332
}
333333

334334
@Override

java/tsfile/src/main/java/org/apache/tsfile/read/common/block/column/TsBlockSerde.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,9 @@ public ByteBuffer serialize(TsBlock tsBlock) throws IOException {
103103

104104
// Value column data types.
105105
for (int i = 0; i < tsBlock.getValueColumnCount(); i++) {
106+
if (tsBlock.getColumn(i).getDataType() == TSDataType.DATE) {
107+
((IntColumn) tsBlock.getColumn(i)).modifyDataType(TSDataType.INT32);
108+
}
106109
tsBlock.getColumn(i).getDataType().serializeTo(dataOutputStream);
107110
}
108111

0 commit comments

Comments
 (0)