Github user viirya commented on a diff in the pull request: https://github.com/apache/spark/pull/17406#discussion_r107853315 --- Diff: sql/catalyst/src/main/scala/org/apache/spark/sql/types/DataType.scala --- @@ -103,6 +106,13 @@ object DataType { def fromJson(json: String): DataType = parseDataType(parse(json)) + // Until Spark-2.1, we use json strings for defining schemas in user-facing APIs. + // Since we add an user-friendly API in the DDL parser, we employ DDL formats for the case. + // To keep back-compatibility, we use `fromJson` first, and then try the new API. + def fromString(text: String): DataType = { --- End diff -- If we are going to support both json schema string and DDL format in `from_json`, shall we add a `DataType.fromStringOrJson` that does exactly the current `DataType.fromString` does? And let `DataType.fromString` only accepts DDL format.
--- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. --- --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org