Skip to content

Commit 91350d2

Browse files
committed
Removed the toggle to control Direct Sink Write
1 parent 05090b8 commit 91350d2

File tree

4 files changed

+15
-46
lines changed

4 files changed

+15
-46
lines changed

docs/BigQueryPushdownEngine-sqlengine.md

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -73,17 +73,6 @@ completed. This API can be used if the execution environment for this environmen
7373
Note that this API has an on-demand price model. See the [Pricing](https://cloud.google.com/bigquery/pricing#storage-api)
7474
page for details related to pricing.
7575

76-
**Attempt direct copy to BigQuery sinks**: Performance can be greatly improved if the records from stages that are executed using
77-
BigQuery ELT Transformation Pushdown are copied directly into a configured table in a compatible BigQuery Sink. This eliminates
78-
the need to read records into the pipeline as no further processing is needed within the pipeline.
79-
To ensure this BigQuery Sink can take advantage of the performance improvements provided by this feature,
80-
the following requirements must be met:
81-
1. The service account configured for BigQuery ELT Transformation Pushdown has permissions to create and update tables in the dataset used by the BigQuery Sink.
82-
2. The datasets used for BigQuery ELT Transformation Pushdown and BigQuery Sink must be stored in the same **location**.
83-
3. The **operation** is either `insert` (With **Truncate Table** disabled), `update`or `upsert`
84-
85-
Note: If the direct copy operation does not succeed, the pipeline will proceed with the standard workflow in order to ensure completion.
86-
8776
**Service Account** - service account key used for authorization
8877

8978
* **File Path**: Path on the local file system of the service account key used for
@@ -121,6 +110,21 @@ corresponding BigQuery data type for each CDAP type, for updates and upserts.
121110
If any of the stages involved in a Join operation contains an unsupported type,
122111
this Join operation will be executed in Spark.
123112

113+
Writing to BigQuery Sinks
114+
-------------------------
115+
116+
Performance can be greatly improved if the records from stages that are executed using BigQuery Transformation
117+
Pushdown are copied directly into a configured table in a compatible BigQuery Sink.
118+
This eliminates the need to read records into the pipeline as no further processing is needed within the pipeline.
119+
120+
To ensure this BigQuery Sink can take advantage of the performance improvements provided by this feature,
121+
the following requirements must be met:
122+
1. The service account configured for BigQuery ELT Transformation Pushdown has permissions to create and update tables in the dataset used by the BigQuery Sink.
123+
2. The datasets used for BigQuery ELT Transformation Pushdown and BigQuery Sink must be stored in the same **location**.
124+
3. The **operation** is either `insert` (With **Truncate Table** disabled), `update`or `upsert`
125+
126+
Note: If the direct copy operation does not succeed, the pipeline will proceed with the standard workflow in order to ensure completion.
127+
124128
Trouble Shooting
125129
----------------
126130

src/main/java/io/cdap/plugin/gcp/bigquery/sqlengine/BigQuerySQLEngine.java

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -346,11 +346,6 @@ public Set<PullCapability> getPullCapabilities() {
346346
public SQLWriteResult write(SQLWriteRequest writeRequest) {
347347
String datasetName = writeRequest.getDatasetName();
348348

349-
// Check if direct sink write is enabled. If not, skip.
350-
if (!sqlEngineConfig.shouldUseDirectSinkWrite()) {
351-
return SQLWriteResult.unsupported(datasetName);
352-
}
353-
354349
// Check if this output matches the expected engine. If it doesn't, skip execution for this write operation.;
355350
if (!BigQuerySQLEngine.class.getName().equals(writeRequest.getOutput().getSqlEngineClassName())) {
356351
LOG.debug("Got output for another SQL engine {}, skipping", writeRequest.getOutput().getSqlEngineClassName());

src/main/java/io/cdap/plugin/gcp/bigquery/sqlengine/BigQuerySQLEngineConfig.java

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ public class BigQuerySQLEngineConfig extends BigQueryBaseConfig {
5050
public static final String NAME_INCLUDED_STAGES = "includedStages";
5151
public static final String NAME_EXCLUDED_STAGES = "excludedStages";
5252
public static final String NAME_USE_STORAGE_READ_API = "useStorageReadAPI";
53-
public static final String NAME_DIRECT_SINK_WRITE = "useDirectSinkWrite";
5453

5554
// Job priority options
5655
public static final String PRIORITY_BATCH = "batch";
@@ -97,15 +96,6 @@ public class BigQuerySQLEngineConfig extends BigQueryBaseConfig {
9796
"This requires Scala version 2.12 to be installed in the execution environment.")
9897
private Boolean useStorageReadAPI;
9998

100-
@Name(NAME_DIRECT_SINK_WRITE)
101-
@Macro
102-
@Nullable
103-
@Description("If enabled, the SQL engine will try to write output directly to BigQuery sinks using a BigQuery " +
104-
"job. This requires the service account used by the BigQuery ELT Transformation Pushdown to have permissions " +
105-
"in both datasets, and both datasets must be located in the same location. If this operation does not " +
106-
"succeed, the standard sink workflow will continue to execute.")
107-
private Boolean useDirectSinkWrite;
108-
10999
@Name(NAME_INCLUDED_STAGES)
110100
@Macro
111101
@Nullable
@@ -165,10 +155,6 @@ public Boolean shouldUseStorageReadAPI() {
165155
return useStorageReadAPI != null ? useStorageReadAPI : false;
166156
}
167157

168-
public Boolean shouldUseDirectSinkWrite() {
169-
return useDirectSinkWrite != null ? useDirectSinkWrite : false;
170-
}
171-
172158
public QueryJobConfiguration.Priority getJobPriority() {
173159
String priority = jobPriority != null ? jobPriority : "batch";
174160
return QueryJobConfiguration.Priority.valueOf(priority.toUpperCase());

widgets/BigQueryPushdownEngine-sqlengine.json

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -203,22 +203,6 @@
203203
},
204204
"default": "false"
205205
}
206-
},
207-
{
208-
"widget-type": "toggle",
209-
"label": "Attempt direct copy to BigQuery sinks",
210-
"name": "useDirectSinkWrite",
211-
"widget-attributes": {
212-
"on": {
213-
"value": "true",
214-
"label": "YES"
215-
},
216-
"off": {
217-
"value": "false",
218-
"label": "NO"
219-
},
220-
"default": "false"
221-
}
222206
}
223207
]
224208
}

0 commit comments

Comments
 (0)