mqliang commented on a change in pull request #6710:
URL: https://github.com/apache/incubator-pinot/pull/6710#discussion_r601806385



##########
File path: 
pinot-core/src/main/java/org/apache/pinot/core/common/datatable/DataTableImplV2.java
##########
@@ -209,24 +190,22 @@ public DataTableImplV2(ByteBuffer byteBuffer)
     }
   }
 
-  private static String decodeString(DataInputStream dataInputStream)
-      throws IOException {
-    int length = dataInputStream.readInt();
-    if (length == 0) {
-      return StringUtils.EMPTY;
-    } else {
-      byte[] buffer = new byte[length];
-      int numBytesRead = dataInputStream.read(buffer);
-      assert numBytesRead == length;
-      return StringUtil.decodeUtf8(buffer);
-    }
-  }
-
   @Override
   public void addException(ProcessingException processingException) {
     _metadata.put(EXCEPTION_METADATA_KEY + processingException.getErrorCode(), 
processingException.getMessage());
   }
 
+  @Override
+  public Map<Integer, String> getExceptions() {
+    Map<Integer, String> exceptions = new HashMap<>();
+    for (String key : _metadata.keySet()) {
+      if (key.startsWith(DataTable.EXCEPTION_METADATA_KEY)) {
+        exceptions.put(Integer.parseInt(key.substring(9)), _metadata.get(key));

Review comment:
       In V2, all exception was add into metadata, using key 
`"Exception"+errCode`, `"Exception".length() = 
8`,`Integer.parseInt(key.substring(9))` can extract the error code from the 
key. See code here: 
https://github.com/apache/incubator-pinot/blob/98d569db6deaab6ece09c08ece5e29a33eceab0f/pinot-core/src/main/java/org/apache/pinot/core/common/datatable/DataTableImplV2.java#L225-L228




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

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org
For additional commands, e-mail: commits-h...@pinot.apache.org

Reply via email to