Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test Spark broadcast #156

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ private List<ManifestFileBean> toBeans(List<ManifestFile> manifests) {
private Broadcast<Table> tableBroadcast() {
if (tableBroadcast == null) {
Table serializableTable = SerializableTableWithSize.copyOf(table());
this.tableBroadcast = sparkContext.broadcast(serializableTable);
this.tableBroadcast = sparkContext.broadcast(table());
}

return tableBroadcast;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ protected Dataset<FileInfo> contentFileDS(Table table) {

protected Dataset<FileInfo> contentFileDS(Table table, Set<Long> snapshotIds) {
Table serializableTable = SerializableTableWithSize.copyOf(table);
Broadcast<Table> tableBroadcast = sparkContext.broadcast(serializableTable);
Broadcast<Table> tableBroadcast = sparkContext.broadcast(table);
int numShufflePartitions = spark.sessionState().conf().numShufflePartitions();

Dataset<ManifestFileBean> manifestBeanDS =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@
import org.apache.iceberg.spark.SparkContentFile;
import org.apache.iceberg.spark.SparkDataFile;
import org.apache.iceberg.spark.SparkDeleteFile;
import org.apache.iceberg.spark.source.SerializableTableWithSize;
import org.apache.iceberg.types.Types;
import org.apache.iceberg.util.PropertyUtil;
import org.apache.iceberg.util.ThreadPools;
Expand Down Expand Up @@ -378,7 +377,7 @@ private void deleteFiles(Iterable<String> locations) {

private ManifestWriterFactory manifestWriters() {
return new ManifestWriterFactory(
sparkContext().broadcast(SerializableTableWithSize.copyOf(table)),
sparkContext().broadcast(table),
formatVersion,
spec.specId(),
outputLocation,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ public class SparkMicroBatchStream implements MicroBatchStream, SupportsAdmissio
this.caseSensitive = readConf.caseSensitive();
this.expectedSchema = SchemaParser.toJson(expectedSchema);
this.localityPreferred = readConf.localityEnabled();
this.tableBroadcast = sparkContext.broadcast(SerializableTableWithSize.copyOf(table));
this.tableBroadcast = sparkContext.broadcast(table);
this.splitSize = readConf.splitSize();
this.splitLookback = readConf.splitLookback();
this.splitOpenFileCost = readConf.splitOpenFileCost();
Expand Down
Loading