diff options
author | Wenchen Fan <wenchen@databricks.com> | 2016-07-25 22:02:00 +0800 |
---|---|---|
committer | Cheng Lian <lian@databricks.com> | 2016-07-25 22:02:00 +0800 |
commit | d27d362ebae0c4a5cc6c99f13ef20049214dd4f9 (patch) | |
tree | 0f214921fc8ac1aff74f0c8e4f171adb724c43fc /sql/catalyst/src/main/scala | |
parent | 7ffd99ec5f267730734431097cbb700ad074bebe (diff) | |
download | spark-d27d362ebae0c4a5cc6c99f13ef20049214dd4f9.tar.gz spark-d27d362ebae0c4a5cc6c99f13ef20049214dd4f9.tar.bz2 spark-d27d362ebae0c4a5cc6c99f13ef20049214dd4f9.zip |
[SPARK-16660][SQL] CreateViewCommand should not take CatalogTable
## What changes were proposed in this pull request?
`CreateViewCommand` only needs some information of a `CatalogTable`, but not all of them. We have some tricks(e.g. we need to check the table type is `VIEW`, we need to make `CatalogColumn.dataType` nullable) to allow it to take a `CatalogTable`.
This PR cleans it up and only pass in necessary information to `CreateViewCommand`.
## How was this patch tested?
existing tests.
Author: Wenchen Fan <wenchen@databricks.com>
Closes #14297 from cloud-fan/minor2.
Diffstat (limited to 'sql/catalyst/src/main/scala')
-rw-r--r-- | sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/catalog/interface.scala | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/catalog/interface.scala b/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/catalog/interface.scala index b7f35b3af4..2a20651459 100644 --- a/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/catalog/interface.scala +++ b/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/catalog/interface.scala @@ -81,9 +81,9 @@ object CatalogStorageFormat { */ case class CatalogColumn( name: String, - // This may be null when used to create views. TODO: make this type-safe; this is left - // as a string due to issues in converting Hive varchars to and from SparkSQL strings. - @Nullable dataType: String, + // TODO: make this type-safe; this is left as a string due to issues in converting Hive + // varchars to and from SparkSQL strings. + dataType: String, nullable: Boolean = true, comment: Option[String] = None) { |