nsivabalan commented on a change in pull request #4918:
URL: https://github.com/apache/hudi/pull/4918#discussion_r818126472



##########
File path: 
hudi-utilities/src/main/java/org/apache/hudi/utilities/deltastreamer/HoodieDeltaStreamer.java
##########
@@ -137,9 +138,9 @@ public HoodieDeltaStreamer(Config cfg, JavaSparkContext 
jssc, FileSystem fs, Con
 
     this.cfg = cfg;
     this.bootstrapExecutor = Option.ofNullable(

Review comment:
       Can we instantiate JavaSparkContext as local variable and use it in 
lines 141 and 143. 

##########
File path: 
hudi-utilities/src/main/java/org/apache/hudi/utilities/schema/HiveSchemaProvider.java
##########
@@ -52,12 +52,11 @@
   private final Schema sourceSchema;
   private Schema targetSchema;
 
-  public HiveSchemaProvider(TypedProperties props, JavaSparkContext jssc) {
-    super(props, jssc);
+  public HiveSchemaProvider(TypedProperties props, SparkSession spark) {
+    super(props, JavaSparkContext.fromSparkContext(spark.sparkContext()));
     DataSourceUtils.checkRequiredProperties(props, 
Collections.singletonList(Config.SOURCE_SCHEMA_TABLE_PROP));
     String sourceSchemaDatabaseName = 
props.getString(Config.SOURCE_SCHEMA_DATABASE_PROP, "default");
     String sourceSchemaTableName = 
props.getString(Config.SOURCE_SCHEMA_TABLE_PROP);
-    SparkSession spark = 
SparkSession.builder().config(jssc.getConf()).enableHiveSupport().getOrCreate();

Review comment:
       does this create a new sparkSession rather than fetching an existing one 
and hence we had to do all the refactoring with JSSC and spark session is it ?




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

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to