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



##########
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 ?
   
   It created a new one, with this sparkSession created inside 
HiveSchemaProvider i can not obtain glue data.
   I guess we need to refactor the jssc and sparksession, a big move.




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