cloud-fan commented on code in PR #57924:
URL: https://github.com/apache/spark/pull/57924#discussion_r3764152422


##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/OptimizeCsvJsonExprs.scala:
##########
@@ -414,9 +418,18 @@ object OptimizeCsvJsonExprs extends Rule[LogicalPlan] {
       // `JsonToStructs` does not support parsing json with duplicated field 
names.
       val duplicateFields = c.names.map(_.toString).distinct.length != 
c.names.length
 
+      // Dropping a field stops the parser from converting it, so a malformed 
value in that field
+      // no longer records the row and the corrupt record column comes back 
null. Selecting as

Review Comment:
   **Nit:**
   
   Please make the parser the actor that records the corrupt row. The same 
wording occurs at `OptimizeCsvJsonExprs.scala:463`; there too, say that the 
parser never records the row when a dropped field contains a malformed value.



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