Github user maropu commented on a diff in the pull request:
https://github.com/apache/spark/pull/17406#discussion_r107853540
--- 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 --
Thanks for the valuable comments!
Yea, I basically agree with @HyukjinKwon idea. Also, `fromDdl` is better
than `fromString` to me as @viirya suggested. I'll update soon.
---
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 [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]