Github user cloud-fan commented on a diff in the pull request:
https://github.com/apache/spark/pull/21667#discussion_r199861581
--- Diff:
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/FileFormat.scala
---
@@ -152,6 +152,12 @@ trait FileFormat {
}
}
+ /**
+ * Validate the given [[DataType]] in read/write path for this file
format.
+ * If the [[DataType]] is not supported, an exception will be thrown.
+ * By default all data types are supported.
+ */
+ def validateDataType(dataType: DataType, isReadPath: Boolean): Unit = {}
--- End diff --
it's better to return boolean here, and let the caller side to throw
exception, so that we can unify the error message.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]