steFaiz commented on code in PR #7889:
URL: https://github.com/apache/paimon/pull/7889#discussion_r3302910236
##########
paimon-format/src/main/java/org/apache/paimon/format/blob/BlobFormatWriter.java:
##########
@@ -43,9 +44,11 @@
/** {@link FormatWriter} for blob file. */
public class BlobFormatWriter implements FileAwareFormatWriter {
- public static final byte VERSION = 1;
+ public static final byte VERSION = 2;
Review Comment:
An old version BlobReader will throws an unexpected error when reading file
with placeholders.
The BlobFileMeta check nulls by -1:
```java
public boolean isNull(int i) {
return blobLengths[i] == -1;
}
```
So in BlobFormatReader it goes to the normal read code path:
```java
if (fileMeta.isNull(currentPosition)) {
blob = null;
} else {
// offsets and length are invalid.
long offset = fileMeta.blobOffset(currentPosition) + 4;
long length = fileMeta.blobLength(currentPosition) - 16;
if (in != null) {
blob = Blob.fromData(readInlineBlob(in, offset, length));
} else {
blob = Blob.fromFile(fileIO, filePathString, offset, length);
}
}
```
The error msg is:
```text
Invalid blob at index 2: offset=3, length=-18
java.io.IOException: Invalid blob at index 2: offset=3, length=-18
```
I think we should tell users that they are reading V2 data files rather than
just this vague error.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]