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



##########
File path: spark3/src/main/java/org/apache/iceberg/spark/source/SparkWrite.java
##########
@@ -168,9 +177,9 @@ private boolean isWapTable() {
 
   // the writer factory works for both batch and streaming
   private WriterFactory createWriterFactory() {
-    return new WriterFactory(
-        table.spec(), format, table.locationProvider(), table.properties(), 
io, encryptionManager, targetFileSize,
-        writeSchema, dsSchema, partitionedFanoutEnabled);
+    // broadcast the table metadata as the writer factory will be sent to 
executors
+    Broadcast<Table> staticTable = 
lazySparkContext().broadcast(SparkUtil.toStaticTable(table));

Review comment:
       @pvary, is there a broadcast concept in Hive too? We had some 
performance issues serializing/deserializing FileIO.

##########
File path: spark3/src/main/java/org/apache/iceberg/spark/source/SparkWrite.java
##########
@@ -168,9 +177,9 @@ private boolean isWapTable() {
 
   // the writer factory works for both batch and streaming
   private WriterFactory createWriterFactory() {
-    return new WriterFactory(
-        table.spec(), format, table.locationProvider(), table.properties(), 
io, encryptionManager, targetFileSize,
-        writeSchema, dsSchema, partitionedFanoutEnabled);
+    // broadcast the table metadata as the writer factory will be sent to 
executors
+    Broadcast<Table> staticTable = 
lazySparkContext().broadcast(SparkUtil.toStaticTable(table));

Review comment:
       @pvary, is there a broadcast concept in Hive too? We had some 
performance issues deserializing FileIO.




-- 
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:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to