bowenli86 opened a new pull request #8458: [FLINK-12452][table][hive] 
alterTable() should ensure existing base table and the new one are of the same 
type
URL: https://github.com/apache/flink/pull/8458
 
 
   ## What is the purpose of the change
   
   Currently all catalogs doesn't check if existing base table and the new one 
are of the same type in alterTable(), e.g. existing table is a view but user 
tries to replace it with a table. This PR adds such checks to all catalogs
   
   ## Brief change log
   
   - added check in in-memory catalog to make sure existing and new table are 
of the same classes since in-memory catalog theoretically can store any table 
and view implementations 
   - added checks in `HiveCatalogBase` to make sure 1) existing and new table 
are of the same type 2) not alter existing Hive tables in types that Flink 
cannot create for now, including EXTERNAL_TABLE, INDEX_TABLE and 
MATERIALZED_VIEW. Flink of course cannot alter existing ones if it cannot 
create them.
   
   Note that though Flink cannot create them, it's able to read most parts of 
their metadata, like schema and properties, thru existing mechanism, but not 
their unique metadata. 
   
   Also note that add capability of creating EXTERNAL_TABLE should be fairly 
easy to do, e.g. with a table property "table_type=external", we just haven't 
done it yet.  INDEX_TABLE and MATERIALZED_VIEW need more research.
   
   ## Verifying this change
   
   Added new unit tests in `GenericInMemoryCatalogTest` and `CatalogTestBase`.
   
   ## Does this pull request potentially affect one of the following parts:
   
     - Dependencies (does it add or upgrade a dependency): (no)
     - The public API, i.e., is any changed class annotated with 
`@Public(Evolving)`: (no)
     - The serializers: (no)
     - The runtime per-record code paths (performance sensitive): (no)
     - Anything that affects deployment or recovery: JobManager (and its 
components), Checkpointing, Yarn/Mesos, ZooKeeper: (no)
     - The S3 file system connector: (no)
   
   ## Documentation
   
     - Does this pull request introduce a new feature? (no)
     - If yes, how is the feature documented? (not applicable)
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to