Github user cloud-fan commented on a diff in the pull request:

    https://github.com/apache/spark/pull/16233#discussion_r95514996
  
    --- Diff: 
sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/catalog/ExternalCatalogSuite.scala
 ---
    @@ -860,6 +864,24 @@ abstract class CatalogTestUtils {
           bucketSpec = Some(BucketSpec(4, Seq("col1"), Nil)))
       }
     
    +  def newView(
    +      name: String,
    +      database: Option[String] = None): CatalogTable = {
    +    val viewDefaultDatabase = database.getOrElse("default")
    +    CatalogTable(
    +      identifier = TableIdentifier(name, database),
    +      tableType = CatalogTableType.VIEW,
    +      storage = CatalogStorageFormat.empty,
    +      schema = new StructType()
    +        .add("col1", "int")
    +        .add("col2", "string")
    +        .add("a", "int")
    +        .add("b", "string"),
    +      viewOriginalText = Some("SELECT * FROM tbl1"),
    +      viewText = Some("SELECT * FROM tbl1"),
    +      properties = Map[String, String] {CatalogTable.VIEW_DEFAULT_DATABASE 
-> viewDefaultDatabase})
    --- End diff --
    
    nit: `Map(CatalogTable.VIEW_DEFAULT_DATABASE -> viewDefaultDatabase)`, 
scala comiler will infer the type for us


---
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

Reply via email to