JingsongLi commented on code in PR #8464:
URL: https://github.com/apache/paimon/pull/8464#discussion_r3549057670
##########
paimon-format/src/main/java/org/apache/paimon/format/blob/BlobFormatWriter.java:
##########
@@ -203,10 +230,34 @@ private boolean tryWriteNullOnFetchFailure(Throwable e,
@Nullable Blob blob)
blobFieldName,
e);
}
+ blobFetchMetricReporter.recordFetchFailureNullWritten(e);
writeNullElement();
return true;
}
+ private void recordPreCheckedMissingFileNull(InternalRow element) {
+ if (!writeNullOnMissingFile) {
+ return;
+ }
+ BlobDescriptor descriptor = tryGetBlobDescriptor(element);
+ if (descriptor != null) {
+
blobFetchMetricReporter.recordMissingFileNullWritten(isHttpUri(descriptor.uri()));
+ }
+ }
+
+ @Nullable
+ private BlobDescriptor tryGetBlobDescriptor(InternalRow element) {
+ try {
+ byte[] bytes = element.getBinary(0);
+ if (bytes != null && BlobDescriptor.isBlobDescriptor(bytes)) {
+ return BlobDescriptor.deserialize(bytes);
+ }
+ } catch (RuntimeException ignored) {
Review Comment:
Looks tricky. A better way?
--
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]