MaxGekk commented on a change in pull request #33706:
URL: https://github.com/apache/spark/pull/33706#discussion_r689312647
##########
File path:
sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/json/JsonSuite.scala
##########
@@ -2435,6 +2435,22 @@ abstract class JsonSuite
}
}
+ test(s"SPARK-36477: infer json schema handle invalid json values") {
+ withTempPath { tempDir =>
+ val path = tempDir.getAbsolutePath
+ val logAppender = new LogAppender(path)
Review comment:
Where is it used?
##########
File path:
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/json/JsonInferSchema.scala
##########
@@ -68,7 +70,8 @@ private[sql] class JsonInferSchema(options: JSONOptions)
extends Serializable {
Some(inferField(parser))
}
} catch {
- case e @ (_: RuntimeException | _: JsonProcessingException) =>
parseMode match {
+ case e @ (_: RuntimeException | _: JsonProcessingException |
+ _: CharConversionException | _: MalformedInputException)
=> parseMode match {
Review comment:
I wonder why do you capture only those exceptions? `createParser()` can
throw `java.io.IOException`:
```java
JsonParser createParser(byte[] data, int offset, int len) throws
IOException, JsonParseException
and
public final JsonToken nextToken() throws IOException
```
##########
File path:
sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/json/JsonSuite.scala
##########
@@ -2435,6 +2435,22 @@ abstract class JsonSuite
}
}
+ test(s"SPARK-36477: infer json schema handle invalid json values") {
Review comment:
`s` is not needed.
--
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]