Skip to content

Commit ea323d5

Browse files
[SDP] BatchTableWrite Flow Execution
1 parent 2b3591a commit ea323d5

File tree

4 files changed

+43
-12
lines changed

4 files changed

+43
-12
lines changed
Lines changed: 35 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
# BatchTableWrite
1+
---
2+
title: BatchTableWrite
3+
---
4+
5+
# BatchTableWrite Flow Execution
26

37
`BatchTableWrite` is a [FlowExecution](FlowExecution.md) that writes a batch `DataFrame` to a [Table](#destination).
48

@@ -7,26 +11,46 @@
711
`BatchTableWrite` takes the following to be created:
812

913
* <span id="identifier"> `TableIdentifier`
10-
* <span id="flow"> `ResolvedFlow`
14+
* <span id="flow"> [ResolvedFlow](ResolvedFlow.md)
1115
* <span id="graph"> [DataflowGraph](DataflowGraph.md)
1216
* <span id="destination"> [Table](Table.md)
1317
* <span id="updateContext"> [PipelineUpdateContext](PipelineUpdateContext.md)
1418
* <span id="sqlConf"> Configuration Properties
1519

1620
`BatchTableWrite` is created when:
1721

18-
* FIXME
22+
* `FlowPlanner` is requested to [plan a CompleteFlow](FlowPlanner.md#plan)
1923

20-
## executeInternal { #executeInternal }
24+
## Execute { #executeInternal }
2125

22-
```scala
23-
executeInternal(): Future[Unit]
24-
```
26+
??? note "FlowExecution"
2527

26-
`executeInternal`...FIXME
28+
```scala
29+
executeInternal(): Future[Unit]
30+
```
2731

28-
---
32+
`executeInternal` is part of the [FlowExecution](FlowExecution.md#executeInternal) abstraction.
33+
34+
`executeInternal` activates the [configuration properties](#sqlConf) in the current [SparkSession](FlowExecution.md#spark).
35+
36+
`executeInternal` requests this [PipelineUpdateContext](#updateContext) for the [FlowProgressEventLogger](PipelineUpdateContext.md#flowProgressEventLogger) to [recordRunning](FlowProgressEventLogger.md#recordRunning) with this [ResolvedFlow](#flow).
37+
38+
`executeInternal` requests this [DataflowGraph](#graph) to [re-analyze](DataflowGraph.md#reanalyzeFlow) this [ResolvedFlow](#flow) to get the [DataFrame](ResolvedFlow.md#df) (the logical query plan)
39+
40+
`executeInternal` executes `append` batch write asynchronously:
41+
42+
1. Creates a [DataFrameWriter](../DataFrameWriter.md) for the batch query's logical plan (the [DataFrame](ResolvedFlow.md#df)).
43+
1. Sets the write format to the [format](Table.md#format) of this [Table](#destination).
44+
1. In the end, `executeInternal` appends the rows to this [Table](#destination) (using [DataFrameWriter.saveAsTable](../DataFrameWriter.md#saveAsTable) operator).
45+
46+
## isStreaming { #isStreaming }
47+
48+
??? note "FlowExecution"
49+
50+
```scala
51+
isStreaming: Boolean
52+
```
2953

30-
`executeInternal` is used when:
54+
`isStreaming` is part of the [FlowExecution](FlowExecution.md#isStreaming) abstraction.
3155

32-
* FIXME
56+
`isStreaming` is always disabled (`false`).

docs/declarative-pipelines/FlowExecution.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,10 @@ getOrigin: QueryOrigin
3030
isStreaming: Boolean
3131
```
3232

33+
See:
34+
35+
* [BatchTableWrite](BatchTableWrite.md#isStreaming)
36+
3337
### PipelineUpdateContext { #updateContext }
3438

3539
```scala
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# FlowProgressEventLogger
2+
3+
`FlowProgressEventLogger` is...FIXME

docs/declarative-pipelines/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ subtitle: ⚠️ 4.1.0-SNAPSHOT
44

55
# Declarative Pipelines
66

7-
**Spark Declarative Pipelines (SDP)** is a declarative framework for building ETL pipelines on Apache Spark.
7+
**Spark Declarative Pipelines (SDP)** is a declarative framework for building ETL pipelines on Apache Spark using Python or SQL.
88

99
!!! danger
1010
Declarative Pipelines framework is only available in the development branch of Apache Spark 4.1.0-SNAPSHOT.

0 commit comments

Comments
 (0)