From 3bdf3ee860dad2eb75f5046ecf672cc15a8e7fb8 Mon Sep 17 00:00:00 2001 From: jiangxingbo Date: Tue, 24 Jan 2017 12:37:30 +0800 Subject: [SPARK-19272][SQL] Remove the param `viewOriginalText` from `CatalogTable` ## What changes were proposed in this pull request? Hive will expand the view text, so it needs 2 fields: originalText and viewText. Since we don't expand the view text, but only add table properties, perhaps only a single field `viewText` is enough in CatalogTable. This PR brought in the following changes: 1. Remove the param `viewOriginalText` from `CatalogTable`; 2. Update the output of command `DescribeTableCommand`. ## How was this patch tested? Tested by exsiting test cases, also updated the failed test cases. Author: jiangxingbo Closes #16679 from jiangxb1987/catalogTable. --- .../main/scala/org/apache/spark/sql/catalyst/catalog/interface.scala | 2 -- .../org/apache/spark/sql/catalyst/catalog/ExternalCatalogSuite.scala | 1 - 2 files changed, 3 deletions(-) (limited to 'sql/catalyst/src') 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 80d32822f5..7bbaf6eb94 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 @@ -175,7 +175,6 @@ case class CatalogTable( lastAccessTime: Long = -1, properties: Map[String, String] = Map.empty, stats: Option[CatalogStatistics] = None, - viewOriginalText: Option[String] = None, viewText: Option[String] = None, comment: Option[String] = None, unsupportedFeatures: Seq[String] = Seq.empty, @@ -261,7 +260,6 @@ case class CatalogTable( if (provider.isDefined) s"Provider: ${provider.get}" else "", if (partitionColumnNames.nonEmpty) s"Partition Columns: $partitionColumns" else "" ) ++ bucketStrings ++ Seq( - viewOriginalText.map("Original View: " + _).getOrElse(""), viewText.map("View: " + _).getOrElse(""), comment.map("Comment: " + _).getOrElse(""), if (properties.nonEmpty) s"Properties: $tableProperties" else "", diff --git a/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/catalog/ExternalCatalogSuite.scala b/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/catalog/ExternalCatalogSuite.scala index ae65109b4d..a5d399a065 100644 --- a/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/catalog/ExternalCatalogSuite.scala +++ b/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/catalog/ExternalCatalogSuite.scala @@ -919,7 +919,6 @@ abstract class CatalogTestUtils { .add("col2", "string") .add("a", "int") .add("b", "string"), - viewOriginalText = Some("SELECT * FROM tbl1"), viewText = Some("SELECT * FROM tbl1"), properties = Map(CatalogTable.VIEW_DEFAULT_DATABASE -> viewDefaultDatabase)) } -- cgit v1.2.3