Skip to content
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 @@ -263,7 +263,7 @@ public static SparkBigQueryConfig from(
return SparkBigQueryConfig.from(
ImmutableMap.copyOf(optionsMap),
ImmutableMap.copyOf(scalaMapToJavaMap(spark.conf().getAll())),
spark.sparkContext().hadoopConfiguration(),
spark.sessionState().newHadoopConf(),
customDefaults,
spark.sparkContext().defaultParallelism(),
spark.sqlContext().conf(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ public static SparkBigQueryConfig createSparkBigQueryConfig(
return SparkBigQueryConfig.from(
ImmutableMap.copyOf(optionsMap),
globalOptions,
spark.sparkContext().hadoopConfiguration(),
spark.sessionState().newHadoopConf(),
ImmutableMap.of(),
defaultParallelism,
spark.sqlContext().conf(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ public BigQueryWriteHelper(
this.config = config;
this.data = data;
this.tableInfo = tableInfo;
this.conf = sqlContext.sparkContext().hadoopConfiguration();
this.conf = sqlContext.sparkSession().sessionState().newHadoopConf();
this.gcsPath =
SparkBigQueryUtil.createGcsPath(config, conf, sqlContext.sparkContext().applicationId());
this.createTemporaryPathDeleter =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,21 +92,20 @@ public BigQueryIndirectDataSourceWriterContext provideIndirectDataSourceWriterCo
Path gcsPath =
SparkBigQueryUtil.createGcsPath(
tableConfig,
spark.sparkContext().hadoopConfiguration(),
spark.sessionState().newHadoopConf(),
spark.sparkContext().applicationId());
Optional<IntermediateDataCleaner> intermediateDataCleaner =
tableConfig
.getTemporaryGcsBucket()
.map(
ignored ->
new IntermediateDataCleaner(
gcsPath, spark.sparkContext().hadoopConfiguration()));
new IntermediateDataCleaner(gcsPath, spark.sessionState().newHadoopConf()));
// based on pmkc's suggestion at https://git.io/JeWRt
intermediateDataCleaner.ifPresent(cleaner -> Runtime.getRuntime().addShutdownHook(cleaner));
return new BigQueryIndirectDataSourceWriterContext(
bigQueryClient,
tableConfig,
spark.sparkContext().hadoopConfiguration(),
spark.sessionState().newHadoopConf(),
sparkSchema,
writeUUID,
mode,
Expand Down