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

    https://github.com/apache/spark/pull/23086#discussion_r236816739
  
    --- Diff: sql/core/src/main/java/org/apache/spark/sql/sources/v2/Table.java 
---
    @@ -0,0 +1,51 @@
    +/*
    + * Licensed to the Apache Software Foundation (ASF) under one or more
    + * contributor license agreements.  See the NOTICE file distributed with
    + * this work for additional information regarding copyright ownership.
    + * The ASF licenses this file to You under the Apache License, Version 2.0
    + * (the "License"); you may not use this file except in compliance with
    + * the License.  You may obtain a copy of the License at
    + *
    + *    http://www.apache.org/licenses/LICENSE-2.0
    + *
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
    + */
    +
    +package org.apache.spark.sql.sources.v2;
    --- End diff --
    
    I can understand wanting to keep everything in Catalyst private. That's 
fine with me, but I think that Catalyst does need to be able to interact with 
tables and catalogs that are supplied by users.
    
    For example: Our tables support schema evolution. Specifically, reading 
files that were written before a column was added. When we add a column, Spark 
shouldn't start failing in analysis for an AppendData operation in a scheduled 
job (as it would today). We need to be able to signal to the validation rule 
that the table supports reading files that are missing columns, so that Spark 
can do the right validation and allow writes that used to work to continue.
    
    How would that information -- support for reading missing columns -- be 
communicated to the analyzer?
    
    Also, what about my example above: how will the analyzer load tables using 
a user-supplied catalog if catalyst can't use any user-supplied implementations?
    
    We could move all of the v2 analysis rules, like ResolveRelations, into the 
core module, but it seems to me that this requirement is no longer providing 
value if we have to do that. I think that catalyst is the right place for 
common plans and analysis rules to live because it is the library of common SQL 
components.
    
    Wherever the rules and plans end up, they will need to access to the 
`TableCatalog` API.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to