Skip to content

[GLUTEN-6705] [CORE] Refactor: Introduce GlutenCommitProtocol#6706

Closed
baibaichen wants to merge 1 commit intoapache:mainfrom
baibaichen:feature/refactor_spark_committer
Closed

[GLUTEN-6705] [CORE] Refactor: Introduce GlutenCommitProtocol#6706
baibaichen wants to merge 1 commit intoapache:mainfrom
baibaichen:feature/refactor_spark_committer

Conversation

@baibaichen
Copy link
Copy Markdown
Contributor

@baibaichen baibaichen commented Aug 4, 2024

What changes were proposed in this pull request?

(Fixes: #6705)

In ClickHouse Backend, we are preparing to support native delta write in Spark 3.5 and delta 3.2. This PR refactor codes to support DelayedCommitProtocol in ColumnarWriteFilesRDD. The Basic idea is introducing GlutenCommitProtocol,

trait GlutenCommitProtocol {
  def setupTask(): Unit
  def commitTask(batch: ColumnarBatch): Option[WriteTaskResult]
  def abortTask(): Unit
  def jobId: String
  def taskAttemptContext: TaskAttemptContext
}

The main difference between DelayedCommitProtocol and HadoopMapReduceCommitProtocol are how to setup and commit task. and hence SparkWriteFilesCommitProtocol is the direct implentation of GlutenCommitProtocol for jobId and taskAttemptContext.

Here are class hierarchy:

GlutenCommitProtocol
  |_ SparkWriteFilesCommitProtocol
     |_ SparkHadoopMapReduceCommitProtocol
     |  |_ VeloxBackendWrite
     |  |_ ClickhouseBackendWrite
     |__ DeltaXXX
  1. SparkHadoopMapReduceCommitProtocol is response for implmenting setup up task
  2. VeloxBackendWrite and ClickhouseBackendWrite is response for convert ColumnBatch to WriteTaskResult

How was this patch tested?

Using Existed UTs

@github-actions github-actions bot added CORE works for Gluten Core VELOX CLICKHOUSE labels Aug 4, 2024
@github-actions
Copy link
Copy Markdown

github-actions bot commented Aug 4, 2024

#6705

@github-actions
Copy link
Copy Markdown

github-actions bot commented Aug 4, 2024

Run Gluten Clickhouse CI

@baibaichen baibaichen force-pushed the feature/refactor_spark_committer branch from 1ec1963 to 5b32882 Compare August 4, 2024 06:38
@github-actions
Copy link
Copy Markdown

github-actions bot commented Aug 4, 2024

Run Gluten Clickhouse CI

@baibaichen baibaichen force-pushed the feature/refactor_spark_committer branch from 5b32882 to f37fada Compare August 4, 2024 10:57
@github-actions
Copy link
Copy Markdown

github-actions bot commented Aug 4, 2024

Run Gluten Clickhouse CI

@baibaichen baibaichen changed the title [GLUTEN-6705] [CORE][WIP]Refactor: Introduce GlutenCommitProtocol [GLUTEN-6705] [CORE] ]Refactor: Introduce GlutenCommitProtocol Aug 5, 2024
@ulysses-you
Copy link
Copy Markdown
Contributor

thank you @baibaichen , can we make a copy for CH backend ? I think it's unnecessary to have to make abstract for diffferent backends... it just makes things complex. I'd like a stable code base.

For ColumnarWriteFiles, we can add VeloxColumnarWriteFiles and CHColumnarWriteFiles, then you can do anything in CHColumnarWriteFiles and I also can help review that.

@baibaichen baibaichen changed the title [GLUTEN-6705] [CORE] ]Refactor: Introduce GlutenCommitProtocol [GLUTEN-6705] [CORE] Refactor: Introduce GlutenCommitProtocol Aug 7, 2024
@baibaichen baibaichen closed this Aug 8, 2024
@baibaichen
Copy link
Copy Markdown
Contributor Author

Re-implment in #6761

@baibaichen baibaichen deleted the feature/refactor_spark_committer branch September 8, 2024 07:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLICKHOUSE CORE works for Gluten Core VELOX

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[CH] Basic Support Write Paruet in Delta

2 participants