Github user mgaido91 commented on a diff in the pull request:
https://github.com/apache/spark/pull/19492#discussion_r144783859
--- Diff:
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/json/JacksonParser.scala
---
@@ -35,19 +35,25 @@ import org.apache.spark.util.Utils
/**
* Constructs a parser for a given schema that translates a json string to
an [[InternalRow]].
*/
-class JacksonParser(
- schema: StructType,
+private[sql] class JacksonParser(
+ schema: DataType,
val options: JSONOptions) extends Logging {
import JacksonUtils._
import com.fasterxml.jackson.core.JsonToken._
+ def this(schema: StructType, options: JSONOptions) = this(schema:
DataType, options)
+ def this(schema: ArrayType, options: JSONOptions) = this(schema:
DataType, options)
--- End diff --
These are to avoid that someone use the constructor specifying invalid
`DataType`, ie. anything which is not a `StructType` or `ArrayType`.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]