diff options
author | Reynold Xin <rxin@databricks.com> | 2016-04-22 20:30:51 -0700 |
---|---|---|
committer | Reynold Xin <rxin@databricks.com> | 2016-04-22 20:30:51 -0700 |
commit | c06110187b3e41405fc13aba367abdd4183ed9a6 (patch) | |
tree | a00225fb89f7d58542092e7ec6752af628d02d94 /sql/catalyst/src | |
parent | 7dde1da949d430c20a128bc3c6e5fe5c0271da11 (diff) | |
download | spark-c06110187b3e41405fc13aba367abdd4183ed9a6.tar.gz spark-c06110187b3e41405fc13aba367abdd4183ed9a6.tar.bz2 spark-c06110187b3e41405fc13aba367abdd4183ed9a6.zip |
[SPARK-14842][SQL] Implement view creation in sql/core
## What changes were proposed in this pull request?
This patch re-implements view creation command in sql/core, based on the pre-existing view creation command in the Hive module. This consolidates the view creation logical command and physical command into a single one, called CreateViewCommand.
## How was this patch tested?
All the code should've been tested by existing tests.
Author: Reynold Xin <rxin@databricks.com>
Closes #12615 from rxin/SPARK-14842-2.
Diffstat (limited to 'sql/catalyst/src')
-rw-r--r-- | sql/catalyst/src/main/scala/org/apache/spark/sql/types/DataType.scala | 3 | ||||
-rw-r--r-- | sql/catalyst/src/main/scala/org/apache/spark/sql/types/UserDefinedType.scala | 2 |
2 files changed, 5 insertions, 0 deletions
diff --git a/sql/catalyst/src/main/scala/org/apache/spark/sql/types/DataType.scala b/sql/catalyst/src/main/scala/org/apache/spark/sql/types/DataType.scala index 3d4a02b0ff..4fc65cbce1 100644 --- a/sql/catalyst/src/main/scala/org/apache/spark/sql/types/DataType.scala +++ b/sql/catalyst/src/main/scala/org/apache/spark/sql/types/DataType.scala @@ -62,6 +62,9 @@ abstract class DataType extends AbstractDataType { /** Readable string representation for the type. */ def simpleString: String = typeName + /** String representation for the type saved in external catalogs. */ + def catalogString: String = simpleString + /** Readable string representation for the type with truncation */ private[sql] def simpleString(maxNumberFields: Int): String = simpleString diff --git a/sql/catalyst/src/main/scala/org/apache/spark/sql/types/UserDefinedType.scala b/sql/catalyst/src/main/scala/org/apache/spark/sql/types/UserDefinedType.scala index 71a9b9f808..aa36121bde 100644 --- a/sql/catalyst/src/main/scala/org/apache/spark/sql/types/UserDefinedType.scala +++ b/sql/catalyst/src/main/scala/org/apache/spark/sql/types/UserDefinedType.scala @@ -91,6 +91,8 @@ abstract class UserDefinedType[UserType >: Null] extends DataType with Serializa case that: UserDefinedType[_] => this.acceptsType(that) case _ => false } + + override def catalogString: String = sqlType.simpleString } /** |