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 2021/03/04 21:38:02 UTC

[GitHub] [iceberg] aokolnychyi commented on a change in pull request #2297: Spark: Refactor BaseSparkAction

aokolnychyi commented on a change in pull request #2297:
URL: https://github.com/apache/iceberg/pull/2297#discussion_r587844230



##########
File path: spark/src/main/java/org/apache/iceberg/actions/BaseSparkAction.java
##########
@@ -48,7 +48,21 @@
 
 abstract class BaseSparkAction<ThisT, R> implements Action<ThisT, R> {
 
-  protected abstract Table table();
+  private final SparkSession spark;

Review comment:
       Previously, we always assumed there is going to be a table we operate on. That's not the case with actions like snapshot and migrate. Plus, it does not make sense to init the Java context in all actions. We can do this in parent.

##########
File path: spark/src/main/java/org/apache/iceberg/actions/BaseSparkAction.java
##########
@@ -48,7 +48,21 @@
 
 abstract class BaseSparkAction<ThisT, R> implements Action<ThisT, R> {
 
-  protected abstract Table table();
+  private final SparkSession spark;

Review comment:
       Previously, we always assumed there is going to be a table we operate on. That's not the case with actions like snapshot and migrate. Plus, it does not make sense to init the Java context in all actions. We can do this in the parent class.




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