Github user gatorsmile commented on a diff in the pull request:

    https://github.com/apache/spark/pull/17015#discussion_r102545703
  
    --- Diff: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/catalog/interface.scala
 ---
    @@ -349,36 +350,44 @@ object CatalogTypes {
     
     
     /**
    - * An interface that is implemented by logical plans to return the 
underlying catalog table.
    - * If we can in the future consolidate SimpleCatalogRelation and 
MetastoreRelation, we should
    - * probably remove this interface.
    + * A [[LogicalPlan]] that represents a table.
      */
    -trait CatalogRelation {
    -  def catalogTable: CatalogTable
    -  def output: Seq[Attribute]
    -}
    +case class CatalogRelation(
    +    tableMeta: CatalogTable,
    +    dataCols: Seq[Attribute],
    +    partitionCols: Seq[Attribute]) extends LeafNode with 
MultiInstanceRelation {
    +  assert(tableMeta.identifier.database.isDefined)
    --- End diff --
    
    Add two more asserts?
    ```Scala
      assert(tableMeta.partitionSchema == 
StructType.fromAttributes(partitionCols))
      assert(tableMeta.dataSchema == StructType.fromAttributes(dataCols))
    ```


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

Reply via email to