Hisoka-X commented on code in PR #41662:
URL: https://github.com/apache/spark/pull/41662#discussion_r1243495987


##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/util/BadRecordException.scala:
##########
@@ -30,16 +30,29 @@ case class PartialResultException(
      cause: Throwable)
   extends Exception(cause)
 
+/**
+ * Exception thrown when the underlying parser returns partial result list of 
parsing.
+ * @param partialResults the partial result list of parsing bad records.
+ * @param cause the actual exception about why the parser cannot return full 
result.
+ */
+case class PartialResultArrayException(
+     partialResults: Array[InternalRow],
+     cause: Throwable)
+  extends Exception(cause)
+
 /**
  * Exception thrown when the underlying parser meet a bad record and can't 
parse it.
  * @param record a function to return the record that cause the parser to fail
  * @param partialResult a function that returns an optional row, which is the 
partial result of
  *                      parsing this bad record.
+ * @param partialResults a function that returns an row array, which is the 
partial results of
+ *                      parsing this bad record. Only used when the parsing 
array as structs.
  * @param cause the actual exception about why the record is bad and can't be 
parsed.
  */
 case class BadRecordException(
     @transient record: () => UTF8String,
     @transient partialResult: () => Option[InternalRow],
+    @transient partialResults: () => Array[InternalRow] = () => 
Array.empty[InternalRow],

Review Comment:
   Thanks for point that. Fixed.



##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/csv/UnivocityParser.scala:
##########
@@ -319,7 +319,7 @@ class UnivocityParser(
       throw BadRecordException(
         () => getCurrentInput,
         () => None,
-        QueryExecutionErrors.malformedCSVRecordError(""))
+        cause = QueryExecutionErrors.malformedCSVRecordError(""))

Review Comment:
   Done



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to