You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by GitBox <gi...@apache.org> on 2020/10/14 22:52:57 UTC

[GitHub] [iceberg] rdblue commented on a change in pull request #1613: Provide Actions class for Spark2 and Spark3

rdblue commented on a change in pull request #1613:
URL: https://github.com/apache/iceberg/pull/1613#discussion_r505041306



##########
File path: spark/src/main/java/org/apache/iceberg/actions/BaseActions.java
##########
@@ -22,24 +22,16 @@
 import org.apache.iceberg.Table;
 import org.apache.spark.sql.SparkSession;
 
-public class Actions {
+public abstract class BaseActions {
 
   private SparkSession spark;
   private Table table;
 
-  private Actions(SparkSession spark, Table table) {
+  protected BaseActions(SparkSession spark, Table table) {

Review comment:
       Is there a simpler way to split this between Spark 2 and 3?
   
   What about extending `Actions` and then selecting whether `Spark2Actions` or `Spark3Actions` will be used at runtime using reflection? Then these two static methods would have to change, but none of the test could would. Anything that is only implemented in Spark 3 would throw `UnsupportedOperationException` here and override the method in `Spark3Actions`.
   
   I think that might significantly reduce the amount of changes needed for this.




----------------------------------------------------------------
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: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org