Github user gatorsmile commented on a diff in the pull request:
https://github.com/apache/spark/pull/16674#discussion_r97231186
--- Diff:
sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/SQLViewSuite.scala
---
@@ -739,18 +706,7 @@ class SQLViewSuite extends QueryTest with SQLTestUtils
with TestHiveSingleton {
withTable("testTable") {
spark.range(1, 10).selectExpr("id", "id + 1
id1").write.saveAsTable("testTable")
withView("testView") {
- val testView = CatalogTable(
- identifier = TableIdentifier("testView"),
- tableType = CatalogTableType.VIEW,
- storage = CatalogStorageFormat.empty,
- schema = new StructType().add("id", "long").add("id1", "long"),
- viewOriginalText = Some("SELECT * FROM testTable"),
- viewText = Some("SELECT * FROM testTable"),
- properties = Map(CatalogTable.VIEW_DEFAULT_DATABASE -> "default",
- CatalogTable.VIEW_QUERY_OUTPUT_NUM_COLUMNS -> "2",
- s"${CatalogTable.VIEW_QUERY_OUTPUT_COLUMN_NAME_PREFIX}0" ->
"id",
- s"${CatalogTable.VIEW_QUERY_OUTPUT_COLUMN_NAME_PREFIX}1" ->
"id1"))
- hiveContext.sessionState.catalog.createTable(testView,
ignoreIfExists = false)
+ sql("CREATE VIEW testView AS SELECT * FROM testTable")
--- End diff --
How about creating a new test case? First, create a view using a regular
SQL statement, and then fetch the metadata and verify the fetched metadata is
still matching what we expect?
---
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 [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]