wwj6591812 commented on code in PR #8219:
URL: https://github.com/apache/paimon/pull/8219#discussion_r3465981368


##########
paimon-format/src/main/java/org/apache/paimon/format/blob/BlobFormatWriter.java:
##########
@@ -127,6 +157,33 @@ public void addElement(InternalRow element) throws 
IOException {
         }
     }
 
+    private void writeNullElement() throws IOException {
+        lengths.add(NULL_LENGTH);
+        if (writeConsumer != null) {
+            writeConsumer.accept(blobFieldName, null);
+        }
+    }
+
+    private static String blobUri(Blob blob) {
+        if (blob instanceof BlobRef) {
+            return ((BlobRef) blob).toDescriptor().uri();
+        }
+        return "unknown";
+    }
+
+    private static boolean isNotFoundError(Throwable throwable) {
+        Throwable current = throwable;
+        while (current != null) {
+            if (current instanceof RuntimeException
+                    && current.getMessage() != null
+                    && current.getMessage().startsWith("HTTP error code: 
404")) {

Review Comment:
   Thanks for the review @JingsongLi. 
   
   Agreed — matching the 404 error by message string in BlobFormatWriter was 
too hacky.
   
   I've introduced a dedicated HttpNotFoundException in HttpClientUtils (thrown 
when getAsInputStream() receives HTTP 404, and propagated through 
HttpUriReader). HttpClientUtils.isNotFoundError() now checks the exception type 
in the cause chain instead of parsing messages. BlobFormatWriter reuses that 
helper and no longer contains its own string-matching logic.
   
   Please take another look when you have time.



-- 
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]

Reply via email to