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

    https://github.com/apache/spark/pull/14207#discussion_r71363705
  
    --- Diff: 
sql/core/src/main/scala/org/apache/spark/sql/catalog/Catalog.scala ---
    @@ -223,6 +223,9 @@ abstract class Catalog {
        * If this table is cached as an InMemoryRelation, drop the original 
cached version and make the
        * new version cached lazily.
        *
    +   * If the table's schema is inferred at runtime, infer the schema again 
and update the schema
    --- End diff --
    
    cc @rxin, I'm thinking of what's the main reason to allow inferring the 
table schema at run time. IIRC, it's mainly because we wanna save some typing 
when creating data source table by SQL string, which usually have very long 
schema, e.g. json files.
    
    If this is true, then the table schema is not supposed to change. If users 
do wanna change it, I'd argue that it's a different table, users should drop 
this table and create a new one. Then we don't need to make `refresh table` 
support schema changing and thus don't need to store the 
`DATASOURCE_SCHEMA_ISINFERRED` flag.


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