Skip to content

[SPARK-17927][SQL] Remove dead code in WriterContainer. #15477

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

Closed
wants to merge 1 commit into from
Closed
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 @@ -49,7 +49,6 @@ private[datasources] case class WriteRelation(

object WriterContainer {
val DATASOURCE_WRITEJOBUUID = "spark.sql.sources.writeJobUUID"
val DATASOURCE_OUTPUTPATH = "spark.sql.sources.output.path"
}

private[datasources] abstract class BaseWriterContainer(
Expand All @@ -73,9 +72,6 @@ private[datasources] abstract class BaseWriterContainer(
// This is only used on driver side.
@transient private val jobContext: JobContext = job

private val speculationEnabled: Boolean =
relation.sparkSession.sparkContext.conf.getBoolean("spark.speculation", defaultValue = false)

// The following fields are initialized and used on both driver and executor side.
@transient protected var outputCommitter: OutputCommitter = _
@transient private var jobId: JobID = _
Expand Down Expand Up @@ -247,8 +243,6 @@ private[datasources] class DefaultWriterContainer(

def writeRows(taskContext: TaskContext, iterator: Iterator[InternalRow]): Unit = {
executorSideSetup(taskContext)
val configuration = taskAttemptContext.getConfiguration
configuration.set(WriterContainer.DATASOURCE_OUTPUTPATH, outputPath)
var writer = newOutputWriter(getWorkPath)
writer.initConverter(dataSchema)

Expand Down Expand Up @@ -353,15 +347,10 @@ private[datasources] class DynamicPartitionWriterContainer(
private def newOutputWriter(
key: InternalRow,
getPartitionString: UnsafeProjection): OutputWriter = {
val configuration = taskAttemptContext.getConfiguration
val path = if (partitionColumns.nonEmpty) {
val partitionPath = getPartitionString(key).getString(0)
configuration.set(
WriterContainer.DATASOURCE_OUTPUTPATH,
new Path(outputPath, partitionPath).toString)
new Path(getWorkPath, partitionPath).toString
} else {
configuration.set(WriterContainer.DATASOURCE_OUTPUTPATH, outputPath)
getWorkPath
}
val bucketId = getBucketIdFromKey(key)
Expand Down