Skip to content

Commit ee5fffc

Browse files
authored
Add an instance of validation. (#707)
* Add an instance of validation. * Add a comment.
1 parent d234430 commit ee5fffc

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

  • java/tsfile/src/main/java/org/apache/tsfile/read/common/block/column

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,10 @@ 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) {
106+
// To be compatible with the Python client, because it does not support data type values other
107+
// than 0-5, the value of DATE is 9.
108+
if ((tsBlock.getColumn(i) instanceof IntColumn)
109+
&& tsBlock.getColumn(i).getDataType() == TSDataType.DATE) {
107110
((IntColumn) tsBlock.getColumn(i)).modifyDataType(TSDataType.INT32);
108111
}
109112
tsBlock.getColumn(i).getDataType().serializeTo(dataOutputStream);

0 commit comments

Comments
 (0)