GitHub user windpiger opened a pull request: https://github.com/apache/spark/pull/16828
[SPARK-19484][SQL]continue work to create hive table with an empty schema ## What changes were proposed in this pull request? after [SPARK-19279](https://issues.apache.org/jira/browse/SPARK-19279), we could not create a Hive table with an empty schema, we should tighten up the condition when create a hive table in https://github.com/apache/spark/blob/master/sql/hive/src/main/scala/org/apache/spark/sql/hive/client/HiveClientImpl.scala#L835 That is if a CatalogTable t has an empty schema, and (there is no `spark.sql.schema.numParts` or its value is 0), we should not add a default `col` schema, if we did, a table with an empty schema will be created, that is not we expected. ## How was this patch tested? N/A You can merge this pull request into a Git repository by running: $ git pull https://github.com/windpiger/spark improveCreateTableWithEmptySchema Alternatively you can review and apply these changes as the patch at: https://github.com/apache/spark/pull/16828.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 #16828 ---- commit 40f28965f48c2de2cb02eb5a26a52a4ca27bda5b Author: windpiger <song...@outlook.com> Date: 2017-02-07T06:00:46Z [SPARK-19484][SQL]continue work to create hive table with an empty schema ---- --- 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