You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2020/07/31 11:56:51 UTC

[GitHub] [spark] stczwd edited a comment on pull request #28617: [SPARK-31694][SQL] Add SupportsPartitions APIs on DataSourceV2

stczwd edited a comment on pull request #28617:
URL: https://github.com/apache/spark/pull/28617#issuecomment-667083355


   @cloud-fan Thanks for paying attention on this PR. This can be changed to `WIP` if we still have some conflicts.
   
   > What is the reason to extend `TableCatalog` instead of `Table`? I think it would be better to support partitions at a table level.
   > 
   > Doing it this way creates more complexity for implementations because they need to handle more cases. For example, if the table doesn't exist, this should throw `NoSuchTableException` just like `loadTable`. It would be simpler for the API if these methods were used to manipulate a table, not to load _and_ manipulate a table. Loading should be orthogonal to partition operations.
   > 
   > Another issue is that this assumes a table catalog contains tables that support partitions, or tables that do not. But Spark's built-in catalog supports some sources that don't expose partitions and some that do. This would cause more work for many catalogs, which would need to detect whether a table has support and throw `UnsupportedOperationException` if it does not. That also makes integration more difficult for Spark because it can't check a table in the analyzer to determine whether it supports the operation or not. Instead, Spark would need to handle exceptions at runtime.
   
   
   This is the comment given by @rdblue before, and I also agree with it.
   Firstly, in many sources, except hive external table, the partition operation may modify actual table data.
   Secondly, most of partition commands, such as `AlterTableAddPartitionCommand`, we need loadTable before operate the partition.
   Finally, it will be easily to do more partition operations on Table, such as truncate partition in mysql.


----------------------------------------------------------------
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:
users@infra.apache.org



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