Skip to content

Commit fb38bd9

Browse files
committed
Throw exception while readObject column is not OBJECT type
1 parent 3df7063 commit fb38bd9

File tree

2 files changed

+6
-0
lines changed
  • iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/execution/operator

2 files changed

+6
-0
lines changed

iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/execution/operator/process/function/partition/Slice.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,9 @@ public Optional<File> getObjectFile(int columnIndex) {
221221

222222
@Override
223223
public Binary readObject(int columnIndex, long offset, int length) {
224+
if (getDataType(columnIndex) != Type.OBJECT) {
225+
throw new UnsupportedOperationException("current column is not object column");
226+
}
224227
Binary binary = getBinarySafely(columnIndex);
225228
return new Binary(ObjectTypeUtils.readObjectContent(binary, offset, length, true).array());
226229
}

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,9 @@ public Optional<File> getObjectFile(int columnIndex) {
166166

167167
@Override
168168
public Binary readObject(int columnIndex, long offset, int length) {
169+
if (getDataType(columnIndex) != Type.OBJECT) {
170+
throw new UnsupportedOperationException("current column is not object column");
171+
}
169172
Binary binary = getBinarySafely(columnIndex);
170173
return new Binary(ObjectTypeUtils.readObjectContent(binary, offset, length, true).array());
171174
}

0 commit comments

Comments
 (0)