GitHub user MaxGekk opened a pull request: https://github.com/apache/spark/pull/21803
[SPARK-24849][SQL] Converting a value of StructType to a DDL string ## What changes were proposed in this pull request? In the PR, I propose to extend the `StructType` object by new method `toDDL` which converts a value of the `StructType` type to a string formatted in DDL style. The resulted string can be used in a table creation. ## How was this patch tested? I add a test for checking the new method and 2 round trip tests: `fromDDL` -> `toDDL` and `toDDL` -> `fromDDL` You can merge this pull request into a Git repository by running: $ git pull https://github.com/MaxGekk/spark-1 to-ddl Alternatively you can review and apply these changes as the patch at: https://github.com/apache/spark/pull/21803.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #21803 ---- commit 38f905ad61f9197d12213bd93f2f755d428ee431 Author: Maxim Gekk <maxim.gekk@...> Date: 2018-07-18T14:33:31Z New method - toDDL commit 6e0509326393ab0554b66df0ae65ba263b2c4fa9 Author: Maxim Gekk <maxim.gekk@...> Date: 2018-07-18T14:39:16Z Simplification of a test commit 34511db4c283e1013de203ca03ce152b26cf62f4 Author: Maxim Gekk <maxim.gekk@...> Date: 2018-07-18T14:44:38Z New test for cases ---- --- --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org