Github user cloud-fan commented on a diff in the pull request:
https://github.com/apache/spark/pull/21667#discussion_r201747795
--- Diff:
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/json/JsonFileFormat.scala
---
@@ -148,6 +144,23 @@ class JsonFileFormat extends TextBasedFileFormat with
DataSourceRegister {
override def hashCode(): Int = getClass.hashCode()
override def equals(other: Any): Boolean =
other.isInstanceOf[JsonFileFormat]
+
+ override def supportDataType(dataType: DataType, isReadPath: Boolean):
Boolean = dataType match {
+ case _: AtomicType => true
+
+ case st: StructType => st.forall { f => supportDataType(f.dataType,
isReadPath) }
+
+ case ArrayType(elementType, _) => supportDataType(elementType,
isReadPath)
+
+ case MapType(keyType, valueType, _) =>
+ supportDataType(keyType, isReadPath) && supportDataType(valueType,
isReadPath)
+
+ case udt: UserDefinedType[_] => supportDataType(udt.sqlType,
isReadPath)
+
+ case _: NullType => true
+
+ case _ => false
--- End diff --
which type we don't support here?
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]