stream2000 commented on code in PR #9749:
URL: https://github.com/apache/hudi/pull/9749#discussion_r1332369029


##########
hudi-spark-datasource/hudi-spark-common/src/main/scala/org/apache/hudi/HoodieSparkSqlWriter.scala:
##########
@@ -165,8 +164,8 @@ object HoodieSparkSqlWriter {
     val sparkContext = sqlContext.sparkContext
 
     val fs = basePath.getFileSystem(sparkContext.hadoopConfiguration)
-    tableExists = fs.exists(new Path(basePath, 
HoodieTableMetaClient.METAFOLDER_NAME))
-    var tableConfig = getHoodieTableConfig(sparkContext, path, mode, 
streamingWritesParamsOpt.map( 
_.hoodieTableConfigOpt).orElse(Option.apply(Option.empty)).get)
+    var tableExists = fs.exists(new Path(basePath, 
HoodieTableMetaClient.METAFOLDER_NAME))
+    var tableConfig = getHoodieTableConfig(sparkContext, path, mode, 
streamingWritesParamsOpt.map( 
_.hoodieTableConfigOpt).orElse(Option.apply(Option.empty)).get, tableExists)

Review Comment:
   > I'm confused, the HoodieSparkSqlWriter is not designed as thread safe 
basically.
   
   We will create multiple writers concurrently in our application like this: 
   
   ```java
   DataFrameWriter<Row> writer =
               spark.createDataFrame(javaRDD, dataset.schema()).toDF().write();
   writer.format("org.apache.hudi").mode(SaveMode.Overwrite).save(targetPath);
   ```
   
   So we expect `HoodieSparkSqlWriter` to be thread-safe...



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